diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-07-26 04:53:10 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-07-26 04:53:10 +0000 |
commit | a4eb8be71c809905f1fc08d8c3f12ed53bfa28ce (patch) | |
tree | d531d197ede1dceabd2da494572b51f360ec3c66 /libc/sysdeps | |
parent | 726b66de5cffd0069a0117fc2fbc5207608c0197 (diff) |
The __set_errno macro _must_ match that defined in include/bits/errno.h. We
can't tack in the return -1 since then when people include errno.h, the return
-1 mysteriously vanishes... Setting the __set_errno back and restoring the
'return -1;' calls to each _syscall[0-n] macro makes mips syscalls work again.
-Erik
Diffstat (limited to 'libc/sysdeps')
-rw-r--r-- | libc/sysdeps/linux/mips/bits/syscalls.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/mips/bits/syscalls.h b/libc/sysdeps/linux/mips/bits/syscalls.h index 2be184527..788e84769 100644 --- a/libc/sysdeps/linux/mips/bits/syscalls.h +++ b/libc/sysdeps/linux/mips/bits/syscalls.h @@ -10,7 +10,7 @@ #include <bits/syscall.h> #ifndef __set_errno -# define __set_errno(val) { (*__errno_location ()) = (val); return -1; } +# define __set_errno(val) (*__errno_location ()) = (val) #endif #ifndef SYS_ify # define SYS_ify(syscall_name) (__NR_##syscall_name) @@ -34,6 +34,7 @@ __asm__ volatile ("li\t$2,%2\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } /* @@ -55,6 +56,7 @@ __asm__ volatile ("move\t$4,%3\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } #define _syscall2(type,name,atype,a,btype,b) \ @@ -75,6 +77,7 @@ __asm__ volatile ("move\t$4,%3\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } #define _syscall3(type,name,atype,a,btype,b,ctype,c) \ @@ -97,6 +100,7 @@ __asm__ volatile ("move\t$4,%3\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \ @@ -121,6 +125,7 @@ __asm__ volatile ("move\t$4,%3\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } #define _syscall5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ @@ -150,6 +155,7 @@ __asm__ volatile ("move\t$4,%3\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \ @@ -182,6 +188,7 @@ __asm__ volatile ("move\t$4,%3\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } #define _syscall7(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f,gtype,g) \ @@ -217,6 +224,7 @@ __asm__ volatile ("move\t$4,%3\n\t" \ if (__err == 0) \ return (type) __res; \ __set_errno(__res); \ +return -1; \ } #endif /* __ASSEMBLER__ */ |