Skip to content

Conversation

@MacroModel
Copy link
Collaborator

The POSIX API is poorly designed, allowing modifiable parameters that are never actually changed in practice.

The POSIX API is poorly designed, allowing modifiable parameters that are never actually changed in practice.
@MacroModel
Copy link
Collaborator Author

cooperating) programs.
The exec functions always save the value of the effective user ID and effective group ID of the
process at the completion of the exec, whether or not the set-user-ID or the set-group-ID bit of
the process image file is set.
The statement about argu[] and enopl] being constants is included to make explicit to future
writers of language bindings that these objects are completely constant. Due toa limitation of
the ISOC standard, it is not possible to state that idea in standard C. Specifying two levels of
const-qualification for the argol] and enopll parameters for the exec functions may seem to be the
natural choice, given that these functions do not modify either the array of pointers or the
characters to which the function points, but this would disallow existing correct code. Instead,
only the array of pointers is noted as constant. The table of assignment compatibility for dst=src
derived from the ISOC standard summarizes the compatibility:

@trcrsired
Copy link
Member

use const cast insteadd

MacroModel and others added 3 commits November 12, 2025 04:56
…rectness

Updated the parameter types for `libc_execveat` to accept non-const pointers for `argv` and `envp`, enhancing compatibility with existing code. Adjusted calls to `libc_execveat` in `vfork_and_execveat` to use `const_cast` for proper type handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants