- If the function called is `posix_spawnp`, and the passed program name **does not** contain a slash, the path is used unmodified, and the path to the directory containing the program on $PATH is prepended to the program's path and assigned to `argv[0]. If the program name **does** contain a slash, the path is absolutised relative to CWD, and assigned to argv[0]
- If the function called is `posix_spawn`, the behaviour is as described above in the case where path contains a slash
* Add initial tests
Introduce a new test for the alarm(2) system call.
This test verifies the behavior of setting, cancelling,
and re-arming alarms, ensuring correct signal delivery
and return values.
`posix_fallocate` ensures that a byte range in a file is allocated so
that subsequent writes don't fail. Unlike ftruncate, posix_fallocate
does not shrink files.
The Linux syscall fallocate is similar to posix_fallocate except with
far more control over how byte ranges are allocated (e.g. it supports
file holes and other features). This MR doesn't implement fallocate as
it requires syscall and redoxfs support.
Finally, I changed the flags for flock from usize to c_int. That matches
what we have in libc and also avoids some silly, needless type casting.
Like the other "at" functions, renameat renames files with respect with
a directory descriptor. "renameat2" is Linux specific but really nice -
it adds a flag which supports atomically swapping two files or failing
if the target already exists. The latter is easily supported in relibc.
The former requires redoxfs support.
Besides the impl itself, I refactored "cap_path_at" into what it really
is: a mini openat2-like function.
Capability based `fchmod`. I also implemented unit tests for chmod,
fchmod, and fchmodat.
The unit tests check Redox-specific behavior, so some of the tests are
disabled for Linux.
`fdopendir` takes ownership of a directory file descriptor instead of
opening one with a path. `fdclosedir` is a FreeBSD extension that
transfers ownership of the file descriptor in DIR to the user.