Browse Source

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 <gustavo@zacarias.com.ar>
Waldemar Brodkorb 8 years ago
parent
commit
e89e3af8f6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libc/inet/socketcalls.c

+ 2 - 1
libc/inet/socketcalls.c

@@ -31,7 +31,8 @@
 #define SYS_ACCEPT4     18
 #endif
 
-#ifdef __sparc__
+/* exposed on x86 since Linux commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb */
+#if defined(__sparc__) || defined(__i386__)
 #undef __NR_accept
 #undef __NR_accept4
 #undef __NR_bind