4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-28 10:00:23 +08:00
Thomas Fitzsimmons 9b022d6db8 * libc/argz/argz_replace.c: Include buf_findstr.h.
* libc/argz/buf_findstr.c: Likewise.
	* libc/argz/envz_entry.c: Include buf_findstr.h.  Cast return
	value to (char *).
	* libc/argz/envz_get.c: Likewise.
	* libc/include/sys/unistd.h: Add getopt and getsubopt declarations.
	* libc/stdlib/Makefile.am (LIB_SOURCES): Add getsubopt.c.
	* libc/stdlib/getsubopt.3: New file.
	* libc/stdlib/getsubopt.c: New file.
	* libc/sys/linux/machine/i386/socketcall.h (__sockcall_base):
	Change esp to ebp.
2002-07-19 20:36:09 +00:00

64 lines
1.8 KiB
C

/* libc/sys/linux/machine/i386/socketcall.h - x86 linux socket system calls */
/* Copyright 2002, Red Hat Inc. */
#ifndef _SOCKETCALL_H
#define _SOCKETCALL_H
#include <machine/weakalias.h>
#include <sys/errno.h>
#include <asm/unistd.h>
#include "sockops.h"
/*
* PIC uses %ebx, so we need to save it during system calls
*/
#define __sockcall_base(type, name) \
{ \
long __res; \
__asm__ volatile ("push %%ebx; movl %2,%%ebx; lea 8(%%ebp),%%ecx; int $0x80; pop %%ebx" \
: "=a" (__res) \
: "0" (__NR_socketcall),"r" (SOCK_##name)); \
__syscall_return(type,__res); \
}
#undef _sockcall1
#define _sockcall1(type,name,type1,arg1) \
type __libc_##name(type1 arg1) \
__sockcall_base(type,name) \
weak_alias(__libc_##name,name)
#undef _sockcall2
#define _sockcall2(type,name,type1,arg1,type2,arg2) \
type __libc_##name(type1 arg1, type2 arg2) \
__sockcall_base(type,name) \
weak_alias(__libc_##name,name)
#undef _sockcall3
#define _sockcall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type __libc_##name(type1 arg1, type2 arg2, type3 arg3) \
__sockcall_base(type,name) \
weak_alias(__libc_##name,name)
#undef _sockcall4
#define _sockcall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type __libc_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
__sockcall_base(type,name) \
weak_alias(__libc_##name,name)
#undef _sockcall5
#define _sockcall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type __libc_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
__sockcall_base(type,name) \
weak_alias(__libc_##name,name)
#undef _sockcall6
#define _sockcall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
type __libc_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
__sockcall_base(type,name) \
weak_alias(__libc_##name,name)
#endif /* _SOCKETCALL_H */