diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-09-17 19:46:34 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-09-17 19:46:34 +0000 |
commit | 8f66179f076e1c89602828046113b996d5b4f07a (patch) | |
tree | 5ef4f6d4fe59dce4b4c65ce5025a41155713cb28 /loader | |
parent | 3a4938a5008281426e0eb1c8d5a248871938f20d (diff) | |
download | anaconda-8f66179f076e1c89602828046113b996d5b4f07a.tar.gz anaconda-8f66179f076e1c89602828046113b996d5b4f07a.tar.xz anaconda-8f66179f076e1c89602828046113b996d5b4f07a.zip |
x86_64 doesn't use socketcall and instead has separate syscalls for socket,
bind, listen, accept, etc. deal with appropriately.
Diffstat (limited to 'loader')
-rw-r--r-- | loader/minilibc.c | 5 | ||||
-rw-r--r-- | loader/minilibc.h | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/loader/minilibc.c b/loader/minilibc.c index 783681757..85ec3c0ff 100644 --- a/loader/minilibc.c +++ b/loader/minilibc.c @@ -33,6 +33,10 @@ __libc_start_main (int (*main) (int, char **, char **), int argc, void _fini (int __status) { } +/* x86_64 has to be different and use a separate syscall for each of the + * socket calls instead of doing a socketcall multiplexor. bleah + */ +#if !defined(__x86_64__) inline int socket(int a, int b, int c) { unsigned long args[] = { a, b, c }; @@ -56,6 +60,7 @@ inline int accept(int a, void * addr, void * addr2) { return socketcall(SYS_ACCEPT, args); } +#endif size_t strlen(const char * string) { size_t i = 0; diff --git a/loader/minilibc.h b/loader/minilibc.h index 2dd087c9c..1f21f177d 100644 --- a/loader/minilibc.h +++ b/loader/minilibc.h @@ -129,7 +129,6 @@ void exit(int arg); /* x86_64 doesn't have some old crufty syscalls */ #if defined(__x86_64__) #define __NR__newselect __NR_select -#define __NR_socketcall __NR_socket #define __NR_signal __NR_rt_sigaction #endif @@ -188,10 +187,22 @@ static inline _syscall0(int,fork) #endif static inline _syscall0(pid_t,setsid) static inline _syscall3(int,syslog,int, type, char *, buf, int, len); + +/* socket calls don't use the socketcall multiplexor on x86_64 */ +#if defined(__x86_64__) +static inline _syscall3(int,socket,int,domain,int,type,int,protocol); +static inline _syscall3(int,bind,int,sockfd,void *,addr,int,addrlen); +static inline _syscall2(int,listen,int,sockfd,int,backlog); +static inline _syscall3(int,accept,int,sockfd,void *,addr,void *,addrlen); +#endif /* x86_64 */ + + #else static inline _syscall5(int,_newselect,int,n,fd_set *,rd,fd_set *,wr,fd_set *,ex,struct timeval *,timeval); static inline _syscall3(int,write,int,fd,const char *,buf,unsigned long,count) +#if !defined(__x86_64__) static inline _syscall2(int,socketcall,int,code,unsigned long *, args) +#endif #define __NR__do_exit __NR_exit extern inline _syscall1(int,_do_exit,int,exitcode) #endif @@ -200,10 +211,15 @@ extern inline _syscall1(int,_do_exit,int,exitcode) extern int errno; +/* socket calls don't use the socketcall multiplexor on x86_64 */ +#if !defined(__x86_64__) inline int socket(int a, int b, int c); inline int bind(int a, void * b, int c); inline int listen(int a, int b); inline int accept(int a, void * addr, void * addr2); +#endif + + size_t strlen(const char * string); char * strcpy(char * dst, const char * src); void * memcpy(void * dst, const void * src, size_t count); |