summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2017-12-23 18:07:43 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2017-12-23 18:07:43 +0000
commit16545cf5d5f51cb67c03923cbb9c75a024bdaca8 (patch)
tree6160101b7e535d3742fe9e30f99767e718cd4e5b /include/stdlib.h
parent6d41588b6b96171640f07e9805193623636ac11b (diff)
downloadsrc-test2-16545cf5d5f51cb67c03923cbb9c75a024bdaca8.tar.gz
src-test2-16545cf5d5f51cb67c03923cbb9c75a024bdaca8.zip
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
Notes
Notes: svn path=/head/; revision=327115
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 93c4bb50cd79..56bb1566d58e 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -274,6 +274,7 @@ int cgetstr(char *, const char *, char **);
int cgetustr(char *, const char *, char **);
int daemon(int, int);
+int daemonfd(int, int);
char *devname(__dev_t, __mode_t);
char *devname_r(__dev_t, __mode_t, char *, int);
char *fdevname(int);