summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_socket.h
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2009-05-16 18:48:41 +0000
committerdchagin <dchagin@FreeBSD.org>2009-05-16 18:48:41 +0000
commit5351e066994a3d70d5c9b6c7a9d290bd517a8966 (patch)
tree4a61d560f65b84512f56bd4994c667b74585cb37 /sys/compat/linux/linux_socket.h
parenta0c026b20b499c61df6fa4153a626efb7ccb0e59 (diff)
downloadFreeBSD-src-5351e066994a3d70d5c9b6c7a9d290bd517a8966.zip
FreeBSD-src-5351e066994a3d70d5c9b6c7a9d290bd517a8966.tar.gz
Somewhere between 2.6.23 and 2.6.27, Linux added SOCK_CLOEXEC and
SOCK_NONBLOCK flags, that allow to save fcntl() calls. Implement a variation of the socket() syscall which takes a flags in addition to the type argument. Approved by: kib (mentor) MFC after: 1 month
Diffstat (limited to 'sys/compat/linux/linux_socket.h')
-rw-r--r--sys/compat/linux/linux_socket.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h
index 0730761..67903c5 100644
--- a/sys/compat/linux/linux_socket.h
+++ b/sys/compat/linux/linux_socket.h
@@ -100,6 +100,13 @@
#define LINUX_SOCK_MAX LINUX_SOCK_SEQPACKET
+#define LINUX_SOCK_TYPE_MASK 0xf
+
+/* Flags for socket, socketpair, accept4 */
+
+#define LINUX_SOCK_CLOEXEC LINUX_O_CLOEXEC
+#define LINUX_SOCK_NONBLOCK LINUX_O_NONBLOCK
+
struct l_ucred {
uint32_t pid;
uint32_t uid;
OpenPOWER on IntegriCloud