cleanup socketcall syscall interface to ease porting to sane(r) archs

This commit is contained in:
Rich Felker
2011-02-15 04:40:40 -05:00
parent cfe373146d
commit 03a2f3e48c
21 changed files with 45 additions and 94 deletions
+7
View File
@@ -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
+21
View File
@@ -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