HomeFreeBSD

Introduce the daemonfd function.

Description

Introduce the daemonfd function.

The daemonfd function is equivalent to the daemon(3) function expect that
arguments are descriptors. For example dhclient(8) which is sandboxed is
unable to open /dev/null to close stdio instead it's allows to fail
daemon(3) function to close the descriptors and then do it explicit in code.
Instead of such hacks we can use now daemonfd.

This API can be also helpful to migrate system to platforms like CheriBSD.

Reviewed by: brooks@, bcr@, jilles@ (earlier version)
Differential Revision: https://reviews.freebsd.org/D13433

Details

Provenance
oshogboAuthored on
Differential Revision
D13433: Introduce daemonfd.
Parents
rS327114: Reverse the check to allocate the buffer if cached pointer is NULL.
Branches
Unknown
Tags
Unknown