20 #ifndef SFSOCKETCALL_H
21 #define SFSOCKETCALL_H
30 #define SYS_getsockname 6
31 #define SYS_getpeername 7
32 #define SYS_socketpair 8
36 #define SYS_recvfrom 12
37 #define SYS_shutdown 13
38 #define SYS_setsockopt 14
39 #define SYS_getsockopt 15
40 #define SYS_sendmsg 16
41 #define SYS_recvmsg 17
44 #define __sys_socketcall0(type, name) \
47 return socketcall(SYS_##name, 0); \
50 #define __sys_socketcall1(type, name, type0, arg0) \
51 type name(type0 arg0) \
53 unsigned long arr[1]; \
54 arr[0] = (long)arg0; \
55 return socketcall(SYS_##name, arr); \
58 #define __sys_socketcall2(type, name, type0,arg0, type1,arg1) \
59 type name(type0 arg0, type1 arg1) \
61 unsigned long arr[2]; \
62 arr[0] = (long)arg0; \
63 arr[1] = (long)arg1; \
64 return socketcall(SYS_##name, arr); \
67 #define __sys_socketcall3(type, name, type0,arg0, type1,arg1, type2,arg2) \
68 type name(type0 arg0, type1 arg1, type2 arg2) \
70 unsigned long arr[3]; \
71 arr[0] = (long)arg0; \
72 arr[1] = (long)arg1; \
73 arr[2] = (long)arg2; \
74 return socketcall(SYS_##name, arr); \
77 #define __sys_socketcall4(type, name, type0,arg0, type1,arg1, type2,arg2, type3,arg3) \
78 type name(type0 arg0, type1 arg1, type2 arg2, type3 arg3) \
80 unsigned long arr[4]; \
81 arr[0] = (long)arg0; \
82 arr[1] = (long)arg1; \
83 arr[2] = (long)arg2; \
84 arr[3] = (long)arg3; \
85 return socketcall(SYS_##name, arr); \
88 #define __sys_socketcall5(type, name, type0,arg0, type1,arg1, type2,arg2, type3,arg3, type4,arg4) \
89 type name(type0 arg0, type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
91 unsigned long arr[5]; \
92 arr[0] = (long)arg0; \
93 arr[1] = (long)arg1; \
94 arr[2] = (long)arg2; \
95 arr[3] = (long)arg3; \
96 arr[4] = (long)arg4; \
97 return socketcall(SYS_##name, arr); \
100 #define __sys_socketcall6(type, name, type0,arg0, type1,arg1, type2,arg2, type3,arg3, type4,arg4, type5,arg5) \
101 type name(type0 arg0, type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
103 unsigned long arr[6]; \
104 arr[0] = (long)arg0; \
105 arr[1] = (long)arg1; \
106 arr[2] = (long)arg2; \
107 arr[3] = (long)arg3; \
108 arr[4] = (long)arg4; \
109 arr[5] = (long)arg5; \
110 return socketcall(SYS_##name, arr); \
123 inline static
__sys_socketcall6(
ssize_t,
recvfrom,
int,
s,
void *,
buf,
size_t,
len,
int,
flags, struct
sockaddr *,
from,
socklen_t *,fromlen)
125 inline static
__sys_socketcall6(
ssize_t,
sendto,
int,
s,
const void *,
buf,
size_t,
len,
int,
flags,
const struct
sockaddr *,
to,
socklen_t,tolen)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd domain
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd socket
static const void static count static fd struct stat static buf struct pollfd unsigned static timeout void static offset void static length char static len const struct iovec static count unsigned long static filedes static sched_yield static flags static oldfd static pause unsigned static seconds static protocol accept
static const void static count static fd struct stat static buf struct pollfd unsigned static timeout void static offset void static length char static len const struct iovec static count unsigned long static filedes static sched_yield static flags static oldfd static pause unsigned static seconds static protocol struct sockaddr addrlen
static struct sockaddr static addrlen static backlog send
int socketcall(int call, unsigned long *args)
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen listen
static struct sockaddr static addrlen static backlog const void static flags recvfrom
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
static struct sockaddr static addrlen static backlog const void static flags void flags
#define __sys_socketcall2(type, name, type0, arg0, type1, arg1)
#define __sys_socketcall3(type, name, type0, arg0, type1, arg1, type2, arg2)
#define __sys_socketcall4(type, name, type0, arg0, type1, arg1, type2, arg2, type3, arg3)
static struct sockaddr static addrlen static backlog const void len
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen sendto
static struct sockaddr static addrlen s
static struct sockaddr my_addr
#define __sys_socketcall6(type, name, type0, arg0, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5)
static struct sockaddr static addrlen static backlog const void msg