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
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)
{
}
# 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
/* 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
#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
const char *locuser, *remuser, *cmd;
int *fd2p;
{
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
int herr;
struct hostent hostbuf;
size_t hstbuflen;
pid = getpid();
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
hstbuflen = 1024;
#ifdef __UCLIBC_HAS_MMU__
tmphstbuf = alloca (hstbuflen);
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);
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__
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;
return negate * (! (raddr ^ laddr));
/* Better be a hostname. */
-#ifdef _LIBC_REENTRANT
+#ifdef __UCLIBC_HAS_THREADS__
buflen = 1024;
buffer = malloc(buflen);
save_errno = errno;
__set_errno (save_errno);
#else
hp = gethostbyname(lhost);
-#endif /* _LIBC_REENTRANT */
+#endif /* __UCLIBC_HAS_THREADS__ */
if (hp == NULL)
return 0;
# 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
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 */
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 */
# 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