OSDN Git Service

Replace all instances of _LIBC_REENTRANT with __UCLIBC_HAS_THREADS__
authorEric Andersen <andersen@codepoet.org>
Fri, 16 Aug 2002 04:49:08 +0000 (04:49 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 16 Aug 2002 04:49:08 +0000 (04:49 -0000)
 -Erik

Rules.mak
include/netdb.h
include/resolv.h
libc/inet/rpc/rcmd.c
libc/sysdeps/linux/common/bits/errno.h
libc/sysdeps/linux/i386/syscall.S
libc/sysdeps/linux/i386/vfork.S
libc/sysdeps/linux/mips/bits/errno.h

index 53e3240..5a912ae 100644 (file)
--- a/Rules.mak
+++ b/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
index c3e0772..ffa9cd5 100644 (file)
@@ -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
index 2d2258c..d77a42e 100644 (file)
@@ -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
index de7433d..b813849 100644 (file)
@@ -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;
index ac59d4c..97e4320 100644 (file)
@@ -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
index c67b39e..a70a997 100644 (file)
@@ -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 */
 
index 10e95b1..176f25c 100644 (file)
@@ -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 */
        
index 29ba980..ca9c32f 100644 (file)
@@ -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