diff options
Diffstat (limited to 'libc/sysdeps/linux')
| -rw-r--r-- | libc/sysdeps/linux/common/bits/errno.h | 12 | ||||
| -rw-r--r-- | libc/sysdeps/linux/mips/bits/syscalls.h | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/libc/sysdeps/linux/common/bits/errno.h b/libc/sysdeps/linux/common/bits/errno.h index bf73a8fe1..03d4729f6 100644 --- a/libc/sysdeps/linux/common/bits/errno.h +++ b/libc/sysdeps/linux/common/bits/errno.h @@ -31,20 +31,10 @@ # ifndef __ASSEMBLER__ -/* We now need a declaration of the `errno' variable. */ -extern int errno; - /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); -# if defined _LIBC -/* We wouldn't need a special macro anymore but it is history. */ -# ifndef __set_errno -# define __set_errno(val) ((errno) = (val)) -# endif -# endif /* _LIBC */ - -# if defined __UCLIBC_HAS_THREADS__ +# if !defined _LIBC || defined __UCLIBC_HAS_THREADS__ /* When using threads, errno is a per-thread value. */ # define errno (*__errno_location ()) # endif diff --git a/libc/sysdeps/linux/mips/bits/syscalls.h b/libc/sysdeps/linux/mips/bits/syscalls.h index 8645d9d75..09688dd1b 100644 --- a/libc/sysdeps/linux/mips/bits/syscalls.h +++ b/libc/sysdeps/linux/mips/bits/syscalls.h @@ -10,7 +10,11 @@ #include <bits/sysnum.h> #ifndef __set_errno -# define __set_errno(val) (*__errno_location ()) = (val) +# ifdef __UCLIBC_HAS_THREADS__ +# define __set_errno(val) (*__errno_location ()) = (val) +# else +# define __set_errno(val) (errno = (val)) +# endif #endif #ifndef SYS_ify # define SYS_ify(syscall_name) (__NR_##syscall_name) |
