]> Git Repo - uclibc-ng.git/commitdiff
The __set_errno macro _must_ match that defined in include/bits/errno.h. We
authorEric Andersen <[email protected]>
Fri, 26 Jul 2002 04:53:10 +0000 (04:53 -0000)
committerEric Andersen <[email protected]>
Fri, 26 Jul 2002 04:53:10 +0000 (04:53 -0000)
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

libc/sysdeps/linux/mips/bits/syscalls.h

index 2be184527878412bad685692262af14721121d20..788e847698fc8ef06b4a5918ba9fe1c2da990acb 100644 (file)
@@ -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__ */
This page took 0.029243 seconds and 4 git commands to generate.