path: root/libc/inet
diff options
authorWaldemar Brodkorb <>2015-11-13 05:13:42 (GMT)
committerWaldemar Brodkorb <>2015-11-13 05:22:30 (GMT)
commite89e3af8f64bded3920f046fb8db2b95a188ff55 (patch)
tree187ccbb765e8b4622c9f560f3b665882cb475d7f /libc/inet
parent1780cf1823bc36a9588b86c87f965bd298c2b4f9 (diff)
i386: use socketcall even if newer linux exposes direct syscalls
The changeset 9dea5dc921b5f4045a18c63eb92e84dc274d17eb in the Linux kernel expose the direct syscalls for sockets. For example udhcpc then will use sendto syscall directly and get an EINVAL error. Disable direct syscalls as it was done for SPARC in the past. Musl and GNU libc are not affected, as they already disable direct socket syscalls on i386. Reported-by: Gustavo Zacarias <>
Diffstat (limited to 'libc/inet')
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c
index 6f4054b..1fef810 100644
--- a/libc/inet/socketcalls.c
+++ b/libc/inet/socketcalls.c
@@ -31,7 +31,8 @@
#define SYS_ACCEPT4 18
-#ifdef __sparc__
+/* exposed on x86 since Linux commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb */
+#if defined(__sparc__) || defined(__i386__)
#undef __NR_accept
#undef __NR_accept4
#undef __NR_bind