about summary refs log tree commit diff
path: root/arch/i386/syscall.h
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/i386/syscall.h
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/i386/syscall.h')
-rw-r--r--arch/i386/syscall.h21
1 files changed, 21 insertions, 0 deletions
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