Browse Source

Replace all instances of _LIBC_REENTRANT with __UCLIBC_HAS_THREADS__
-Erik

Eric Andersen 22 years ago
parent
commit
f106775df1

+ 0 - 3
Rules.mak

@@ -120,9 +120,6 @@ endif
 ifeq ($(strip $(DOPIC)),true)
     CFLAGS += -fPIC
 endif
-ifeq ($(strip $(INCLUDE_THREADS)),true)
-    CFLAGS  += -D_LIBC_REENTRANT
-endif
 # Currently locale support requires wide char support.
 ifeq ($(strip $(HAS_LOCALE)),true)
     HAS_WCHAR:=true

+ 3 - 3
include/netdb.h

@@ -60,7 +60,7 @@ extern int h_errno;
 extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
 
 #ifdef _LIBC
-# ifdef _LIBC_REENTRANT
+# ifdef __UCLIBC_HAS_THREADS__
 static inline int
 __set_h_errno (int __err)
 {
@@ -68,11 +68,11 @@ __set_h_errno (int __err)
 }
 # else
 #  define __set_h_errno(x) (h_errno = (x))
-# endif	/* _LIBC_REENTRANT */
+# endif	/* __UCLIBC_HAS_THREADS__ */
 #endif /* _LIBC */
 
 
-#if !defined _LIBC || defined _LIBC_REENTRANT
+#if !defined _LIBC || defined __UCLIBC_HAS_THREADS__
 /* Use a macro to access always the thread specific `h_errno' variable.  */
 # define h_errno (*__h_errno_location ())
 #endif

+ 1 - 1
include/resolv.h

@@ -217,7 +217,7 @@ typedef struct __res_state *res_state;
 /*			0x00008000	*/
 
 /* Things involving an internal (static) resolver context. */
-#if !defined _LIBC || defined _LIBC_REENTRANT
+#if !defined _LIBC || defined __UCLIBC_HAS_THREADS__
 __BEGIN_DECLS
 extern struct __res_state *__res_state(void) __attribute__ ((__const__));
 __END_DECLS

+ 10 - 10
libc/inet/rpc/rcmd.c

@@ -38,8 +38,8 @@ static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
 #define __FORCE_GLIBC
 #include <features.h>
 
-#ifdef _LIBC_REENTRANT
-#undef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
+#undef __UCLIBC_HAS_THREADS__
 #warning FIXME I am not reentrant yet...
 #endif
 
@@ -81,7 +81,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
      const char *locuser, *remuser, *cmd;
      int *fd2p;
 {
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	int herr;
         struct hostent hostbuf;
 	size_t hstbuflen;
@@ -97,7 +97,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 
 	pid = getpid();
 
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	hstbuflen = 1024;
 #ifdef __UCLIBC_HAS_MMU__
 	tmphstbuf = alloca (hstbuflen);
@@ -304,14 +304,14 @@ int ruserok(rhost, superuser, ruser, luser)
         struct hostent *hp;
 	u_int32_t addr;
 	char **ap;
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	size_t buflen;
 	char *buffer;
 	int herr;
 	struct hostent hostbuf;
 #endif
 
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	buflen = 1024;
 #ifdef __UCLIBC_HAS_MMU__
 	buffer = alloca (buflen);
@@ -437,7 +437,7 @@ iruserok2 (raddr, superuser, ruser, luser, rhost)
 		size_t dirlen;
 		uid_t uid;
 
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 		size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
 		struct passwd pwdbuf;
 #ifdef __UCLIBC_HAS_MMU__
@@ -520,7 +520,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
 	int negate=1;    /* Multiply return with this to get -1 instead of 1 */
 	char **pp;
 
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	int save_errno;
 	size_t buflen;
 	char *buffer;
@@ -550,7 +550,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
 		return negate * (! (raddr ^ laddr));
 
 	/* Better be a hostname. */
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	buflen = 1024;
 	buffer = malloc(buflen);
 	save_errno = errno;
@@ -564,7 +564,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
 	__set_errno (save_errno);
 #else
 	hp = gethostbyname(lhost);
-#endif /* _LIBC_REENTRANT */
+#endif /* __UCLIBC_HAS_THREADS__ */
 
 	if (hp == NULL)
 		return 0;

+ 1 - 1
libc/sysdeps/linux/common/bits/errno.h

@@ -43,7 +43,7 @@ extern int *__errno_location (void) __THROW __attribute__ ((__const__));
 #   define __set_errno(val) (*__errno_location ()) = (val)
 #  endif /* _LIBC */
 
-#  if !defined _LIBC || defined _LIBC_REENTRANT
+#  if !defined _LIBC || defined __UCLIBC_HAS_THREADS__
 /* When using threads, errno is a per-thread value.  */
 #   define errno (*__errno_location ())
 #  endif

+ 4 - 4
libc/sysdeps/linux/i386/syscall.S

@@ -47,21 +47,21 @@ Lhere:
 	addl $_GLOBAL_OFFSET_TABLE_+[.-Lhere],%ebx
 	negl %eax
 	movl %eax,%ecx
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	call __errno_location@PLT
 #else
 	movl errno@GOT(%ebx),%eax
-#endif /* _LIBC_REENTRANT */
+#endif /* __UCLIBC_HAS_THREADS__ */
 	movl %ecx,(%eax)
 #else
 	negl %eax
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	movl %eax,%ecx
 	call __errno_location
 	movl %ecx,(%eax)
 #else
 	movl %eax,errno
-#endif /* _LIBC_REENTRANT */
+#endif /* __UCLIBC_HAS_THREADS__ */
 
 #endif /* PIC */
 

+ 4 - 4
libc/sysdeps/linux/i386/vfork.S

@@ -36,22 +36,22 @@ vfork:
 	addl $_GLOBAL_OFFSET_TABLE_+[.-.Lhere],%ebx
 	negl %eax
 	movl %eax,%ecx
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	call __errno_location@PLT
 #else
 	movl errno@GOT(%ebx),%eax
-#endif /* _LIBC_REENTRANT */
+#endif /* __UCLIBC_HAS_THREADS__ */
 	movl %ecx,(%eax)
 	popl %ebx
 #else
 	negl %eax
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
 	movl %eax,%ecx
 	call __errno_location
 	movl %ecx,(%eax)
 #else
 	movl %eax,errno
-#endif /* _LIBC_REENTRANT */
+#endif /* __UCLIBC_HAS_THREADS__ */
 
 #endif /* PIC */
 	

+ 1 - 1
libc/sysdeps/linux/mips/bits/errno.h

@@ -39,7 +39,7 @@ extern int *__errno_location (void) __THROW __attribute__ ((__const__));
 #   define __set_errno(val) (*__errno_location ()) = (val)
 #  endif /* _LIBC */
 
-#  if !defined _LIBC || defined _LIBC_REENTRANT
+#  if !defined _LIBC || defined __UCLIBC_HAS_THREADS__
 /* When using threads, errno is a per-thread value.  */
 #   define errno (*__errno_location ())
 #  endif