about summary refs log tree commit diff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-15 04:40:40 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-15 04:40:40 -0500
commit03a2f3e48caec15b1a9cebccc85328e9b8169df0 (patch)
tree58db0d85a26142b4ec2b8334f7e898a7b49e90dd /arch
parentcfe373146d232d7c89a60920f77b9451bcfee96b (diff)
downloadmusl-03a2f3e48caec15b1a9cebccc85328e9b8169df0.tar.gz
musl-03a2f3e48caec15b1a9cebccc85328e9b8169df0.tar.xz
musl-03a2f3e48caec15b1a9cebccc85328e9b8169df0.zip
cleanup socketcall syscall interface to ease porting to sane(r) archs
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/bits/ioctl.h7
-rw-r--r--arch/i386/syscall.h21
2 files changed, 28 insertions, 0 deletions
diff --git a/arch/i386/bits/ioctl.h b/arch/i386/bits/ioctl.h
index 544bbdce..336c71c3 100644
--- a/arch/i386/bits/ioctl.h
+++ b/arch/i386/bits/ioctl.h
@@ -127,6 +127,13 @@ struct winsize {
 #define N_SYNC_PPP      14
 #define N_HCI           15
 
+#define FIOSETOWN       0x8901
+#define SIOCSPGRP       0x8902
+#define FIOGETOWN       0x8903
+#define SIOCGPGRP       0x8904
+#define SIOCATMARK      0x8905
+#define SIOCGSTAMP      0x8906
+
 #define SIOCADDRT       0x890B
 #define SIOCDELRT       0x890C
 #define SIOCRTMSG       0x890D
diff --git a/arch/i386/syscall.h b/arch/i386/syscall.h
index 114aa688..fcdae241 100644
--- a/arch/i386/syscall.h
+++ b/arch/i386/syscall.h
@@ -501,6 +501,27 @@ static inline long syscall6(long n, long a1, long a2, long a3, long a4, long a5,
 #define __NR_pread __NR_pread64
 #define __NR_pwrite __NR_pwrite64
 
+#define __SC_socket      1
+#define __SC_bind        2
+#define __SC_connect     3
+#define __SC_listen      4
+#define __SC_accept      5
+#define __SC_getsockname 6
+#define __SC_getpeername 7
+#define __SC_socketpair  8
+#define __SC_send        9
+#define __SC_recv        10
+#define __SC_sendto      11
+#define __SC_recvfrom    12
+#define __SC_shutdown    13
+#define __SC_setsockopt  14
+#define __SC_getsockopt  15
+#define __SC_sendmsg     16
+#define __SC_recvmsg     17
+
+
+#define socketcall(nm, a, b, c, d, e, f) syscall2(__NR_socketcall, __SC_##nm, \
+    (long)(long [6]){ (long)a, (long)b, (long)c, (long)d, (long)e, (long)f })
 
 
 #undef O_LARGEFILE