You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change argv and envp types in execveat declaration (#1218)
* Change argv and envp types in execveat declaration
The POSIX API is poorly designed, allowing modifiable parameters that are never actually changed in practice.
* Update posix.h
* Refactor execveat function signatures in posix.h to improve const correctness
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.
* Update bsd.h
* Update nt_at.h
* update
* update
* Enforce no-follow mode for unlinkat operations in nt_at.h to match POSIX semantics
- Updated `calculate_nt_delete_flag` to unconditionally set `FILE_FLAG_OPEN_REPARSE_POINT` flag.
- Removed conditional check for `symlink_nofollow` flag as POSIX requires unlinkat() to always operate in no-follow mode.
- Added comment explaining that symlinks must be unlinked as directory entries and never resolved, matching POSIX behavior.
* fix
Copy file name to clipboardExpand all lines: include/fast_io_hosted/process/process/posix.h
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,11 @@ namespace fast_io
8
8
9
9
namespaceposix
10
10
{
11
+
// 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.
12
+
// 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
13
+
// 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
14
+
// function points, but this would disallow existing correct code. Instead, only the array of pointers is noted as constant.
0 commit comments