1 /* libc/sys/linux/machine/i386/socketcall.h - x86 linux socket system calls */
3 /* Copyright 2002, Red Hat Inc. */
10 #include <asm/unistd.h>
14 * PIC uses %ebx, so we need to save it during system calls
17 #define __sockcall_base(type, name) \
20 __asm__ volatile ("push %%ebx; movl %2,%%ebx; lea 8(%%esp),%%ecx; int $0x80; pop %%ebx" \
22 : "0" (__NR_socketcall),"r" (SOCK_##name)); \
23 __syscall_return(type,__res); \
27 #define _sockcall1(type,name,type1,arg1) \
28 type name(type1 arg1) \
29 __sockcall_base(type,name)
32 #define _sockcall2(type,name,type1,arg1,type2,arg2) \
33 type name(type1 arg1, type2 arg2) \
34 __sockcall_base(type,name)
37 #define _sockcall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
38 type name(type1 arg1, type2 arg2, type3 arg3) \
39 __sockcall_base(type,name)
42 #define _sockcall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
43 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
44 __sockcall_base(type,name)
47 #define _sockcall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
48 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
49 __sockcall_base(type,name)
52 #define _sockcall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
53 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
54 __sockcall_base(type,name)
56 #endif /* _SOCKETCALL_H */