Skip to content

Move processes' cwd state into relibc

Jacob Lorentzon requested to merge 4lDO2/relibc:relibc_cwd into master

This moves the current working directory into a global variable in relibc. fexec_impl has been modified to also support passing pointers to data in auxiliary vectors, where the cwd is passed to the next process. The main downside with this, is that because most C library functions requiring canonicalization, are also async-signal-safe, we must run sigprocmask before and after locking the CWD. This could probably be solved using arc-swap or re-entrant mutexes, but since syscalls (in theory) should be faster than context switches, this ought to be fine. And, a large fraction of the SYS_OPEN calls from most programs, are already absolute. This MR is independent of the kernel MR, although this should be merged first.

Bootstrap and escalated must update their git dependency, and change a few lines, accordingly.

Edited by Jeremy Soller

Merge request reports