summaryrefslogtreecommitdiffstats
path: root/libc/misc/internals
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/internals')
-rw-r--r--libc/misc/internals/__uClibc_main.c8
-rw-r--r--libc/misc/internals/errno.c16
2 files changed, 11 insertions, 13 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index a1e02c4e4..ab6adb130 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -51,10 +51,6 @@ libc_hidden_proto(geteuid)
libc_hidden_proto(fstat)
/* libc_hidden_proto(abort) */
-extern __typeof(open) __libc_open;
-libc_hidden_proto(__libc_open)
-extern __typeof(fcntl) __libc_fcntl;
-libc_hidden_proto(__libc_fcntl)
#endif
#ifndef SHARED
@@ -150,10 +146,10 @@ size_t __pagesize = 0;
static void __check_one_fd(int fd, int mode)
{
/* Check if the specified fd is already open */
- if (__libc_fcntl(fd, F_GETFD) == -1)
+ if (fcntl(fd, F_GETFD) == -1)
{
/* The descriptor is probably not open, so try to use /dev/null */
- int nullfd = __libc_open(_PATH_DEVNULL, mode);
+ int nullfd = open(_PATH_DEVNULL, mode);
/* /dev/null is major=1 minor=3. Make absolutely certain
* that is in fact the device that we have opened and not
* some other wierd file... */
diff --git a/libc/misc/internals/errno.c b/libc/misc/internals/errno.c
index 23b2bb375..a89b5addf 100644
--- a/libc/misc/internals/errno.c
+++ b/libc/misc/internals/errno.c
@@ -19,18 +19,20 @@ extern __thread int __libc_h_errno __attribute__ ((alias ("h_errno")));
#define h_errno __libc_h_errno
#else
-extern int errno;
-extern int h_errno;
-
+#include "internal_errno.h"
#if 0
/* Unfortunately, this doesn't work... */
int h_errno __attribute__ ((section (".bss"))) = 0;
int errno __attribute__ ((section (".bss"))) = 0;
#else
-int _errno = 0;
-int _h_errno = 0;
+int errno = 0;
+int h_errno = 0;
#endif
-weak_alias(_errno, errno)
-weak_alias(_h_errno, h_errno)
+#ifdef __UCLIBC_HAS_THREADS__
+libc_hidden_def(errno)
+weak_alias(errno, _errno)
+libc_hidden_def(h_errno)
+weak_alias(h_errno, _h_errno)
+#endif
#endif