bitwiseworks / libcx

kLIBC Extension Library
GNU Lesser General Public License v2.1
11 stars 1 forks source link

Enhance spawn2 to allow for selective file handle inheritance #77

Closed dmik closed 4 years ago

dmik commented 4 years ago

Now the child process inherits either every handle not specifically disabled for inheritance with O_NOINHERIT or fcntl(F_SETFD, FD_CLOEXEC) or nothing if P_2_NOINHERIT is given. However, there are cases when the parent wants specific file handles to be inherited and sometimes even under a different file number in the child.

This is needed e.g. for Chromium, see https://github.com/bitwiseworks/qtwebengine-chromium-os2/issues/3#issuecomment-595739228.