summaryrefslogtreecommitdiffstats
path: root/sys/sys/syscallsubr.h
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-05-01 20:10:21 +0000
committerjilles <jilles@FreeBSD.org>2013-05-01 20:10:21 +0000
commit299afd25fd6dead39bf5c78572782db885579911 (patch)
treec530c7ecc418cacfa14b49c004393242e6613d6b /sys/sys/syscallsubr.h
parent19e5409088a95e1f704e9a1b2e7737b3e76608e9 (diff)
downloadFreeBSD-src-299afd25fd6dead39bf5c78572782db885579911.zip
FreeBSD-src-299afd25fd6dead39bf5c78572782db885579911.tar.gz
Add accept4() system call.
The accept4() function, compared to accept(), allows setting the new file descriptor atomically close-on-exec and explicitly controlling the non-blocking status on the new socket. (Note that the latter point means that accept() is not equivalent to any form of accept4().) The linuxulator's accept4 implementation leaves a race window where the new file descriptor is not close-on-exec because it calls sys_accept(). This implementation leaves no such race window (by using falloc() flags). The linuxulator could be fixed and simplified by using the new code. Like accept(), accept4() is async-signal-safe, a cancellation point and permitted in capability mode.
Diffstat (limited to 'sys/sys/syscallsubr.h')
-rw-r--r--sys/sys/syscallsubr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h
index fa0d351..49e8be1 100644
--- a/sys/sys/syscallsubr.h
+++ b/sys/sys/syscallsubr.h
@@ -60,6 +60,8 @@ int kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg,
u_int buflen);
int kern_accept(struct thread *td, int s, struct sockaddr **name,
socklen_t *namelen, struct file **fp);
+int kern_accept4(struct thread *td, int s, struct sockaddr **name,
+ socklen_t *namelen, int flags, struct file **fp);
int kern_access(struct thread *td, char *path, enum uio_seg pathseg,
int flags);
int kern_accessat(struct thread *td, int fd, char *path,
OpenPOWER on IntegriCloud