diff options
author | 2002-11-05 22:19:55 +0000 | |
---|---|---|
committer | 2002-11-05 22:19:55 +0000 | |
commit | a04bf6e3c68b13ba327bbea611ce4eb0077d850c (patch) | |
tree | 1f337008ce2905978f12317a8d4fd0dfc618fcd8 /lib/libc/arch | |
parent | Updated from ftp.internic.net (diff) | |
download | wireguard-openbsd-a04bf6e3c68b13ba327bbea611ce4eb0077d850c.tar.xz wireguard-openbsd-a04bf6e3c68b13ba327bbea611ce4eb0077d850c.zip |
thread safe libc -- 2nd try. OK miod@, millert@
Thanks to miod@ for m68k and vax fixes
Diffstat (limited to 'lib/libc/arch')
-rw-r--r-- | lib/libc/arch/m68k/SYS.h | 37 | ||||
-rw-r--r-- | lib/libc/arch/vax/SYS.h | 38 |
2 files changed, 38 insertions, 37 deletions
diff --git a/lib/libc/arch/m68k/SYS.h b/lib/libc/arch/m68k/SYS.h index 6708c564600..2c5cd215982 100644 --- a/lib/libc/arch/m68k/SYS.h +++ b/lib/libc/arch/m68k/SYS.h @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.12 2002/11/05 00:02:17 miod Exp $ + * $OpenBSD: SYS.h,v 1.13 2002/11/05 22:19:55 marc Exp $ */ #include <sys/syscall.h> @@ -83,27 +83,28 @@ rts -#ifdef _THREAD_SAFE +#ifdef __STDC__ +#define __ALIAS(prefix,name) \ + WEAK_ALIAS(name,prefix##name); +#else +#define __ALIAS(prefix,name) \ + WEAK_ALIAS(name,prefix/**/name); +#endif + /* * For the thread_safe versions, we prepend _thread_sys_ to the function * name so that the 'C' wrapper can go around the real name. */ -# define SYSCALL(x) __SYSCALL(_thread_sys_,x,x) -# define RSYSCALL(x) __PSEUDO(_thread_sys_,x,x) -# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) -# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) -# define SYSENTRY(x) __ENTRY(_thread_sys_,x) -#else /* _THREAD_SAFE */ -/* - * The non-threaded library defaults to traditional syscalls where - * the function name matches the syscall name. - */ -# define SYSCALL(x) __SYSCALL(,x,x) -# define RSYSCALL(x) __PSEUDO(,x,x) -# define PSEUDO(x,y) __PSEUDO(,x,y) -# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y) -# define SYSENTRY(x) __ENTRY(,x) -#endif /* _THREAD_SAFE */ +# define SYSCALL(x) __ALIAS(_thread_sys_,x) \ + __SYSCALL(_thread_sys_,x,x) +# define RSYSCALL(x) __ALIAS(_thread_sys_,x) \ + __PSEUDO(_thread_sys_,x,x) +# define PSEUDO(x,y) __ALIAS(_thread_sys_,x) \ + __PSEUDO(_thread_sys_,x,y) +# define PSEUDO_NOERROR(x,y) __ALIAS(_thread_sys_,x) \ + __PSEUDO_NOERROR(_thread_sys_,x,y) +# define SYSENTRY(x) __ALIAS(_thread_sys_,x) \ + __ENTRY(_thread_sys_,x) #define ASMSTR .asciz diff --git a/lib/libc/arch/vax/SYS.h b/lib/libc/arch/vax/SYS.h index 6f7a0966ce4..42a80fbea73 100644 --- a/lib/libc/arch/vax/SYS.h +++ b/lib/libc/arch/vax/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.11 2002/11/05 00:37:05 miod Exp $ */ +/* $OpenBSD: SYS.h,v 1.12 2002/11/05 22:19:55 marc Exp $ */ /* $NetBSD: SYS.h,v 1.4 1997/05/02 18:15:32 kleink Exp $ */ /* @@ -65,28 +65,28 @@ __DO_SYSCALL(y); \ ret -#ifdef _THREAD_SAFE +#ifdef __STDC__ +#define __ALIAS(prefix,name) \ + WEAK_ALIAS(name,prefix##name); +#else +#define __ALIAS(prefix,name) \ + WEAK_ALIAS(name,prefix/**/name); +#endif + /* * For the thread_safe versions, we prepend _thread_sys_ to the function * name so that the 'C' wrapper can go around the real name. */ -#define SYSCALL(x) __SYSCALL(_thread_sys_,x,x) -#define RSYSCALL(x) __PSEUDO(_thread_sys_,x,x) -#define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) -#define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) -#define SYSENTRY(x) __ENTRY(_thread_sys_,x) +#define SYSCALL(x) __ALIAS(_thread_sys_,x) \ + __SYSCALL(_thread_sys_,x,x) +#define RSYSCALL(x) __ALIAS(_thread_sys_,x) \ + __PSEUDO(_thread_sys_,x,x) +#define PSEUDO(x,y) __ALIAS(_thread_sys_,x) \ + __PSEUDO(_thread_sys_,x,y) +#define PSEUDO_NOERROR(x,y) __ALIAS(_thread_sys_,x) \ + __PSEUDO_NOERROR(_thread_sys_,x,y) +#define SYSENTRY(x) __ALIAS(_thread_sys_,x) \ + __ENTRY(_thread_sys_,x) #define SYSNAME(x) _CAT(__thread_sys_,x) -#else _THREAD_SAFE -/* - * The non-threaded library defaults to traditional syscalls where - * the function name matches the syscall name. - */ -#define SYSCALL(x) __SYSCALL(,x,x) -#define RSYSCALL(x) __PSEUDO(,x,x) -#define PSEUDO(x,y) __PSEUDO(,x,y) -#define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y) -#define SYSENTRY(x) __ENTRY(,x) -#define SYSNAME(x) _CAT(_,x) -#endif _THREAD_SAFE .globl __cerror |