summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/common/__syscall_fcntl.c5
-rw-r--r--libc/sysdeps/linux/common/close.c6
-rw-r--r--libc/sysdeps/linux/common/fsync.c5
-rw-r--r--libc/sysdeps/linux/common/llseek.c5
-rw-r--r--libc/sysdeps/linux/common/lseek.c5
-rw-r--r--libc/sysdeps/linux/common/msync.c5
-rw-r--r--libc/sysdeps/linux/common/nanosleep.c5
-rw-r--r--libc/sysdeps/linux/common/open.c5
-rw-r--r--libc/sysdeps/linux/common/open64.c5
-rw-r--r--libc/sysdeps/linux/common/pause.c11
-rw-r--r--libc/sysdeps/linux/common/poll.c23
-rw-r--r--libc/sysdeps/linux/common/read.c5
-rw-r--r--libc/sysdeps/linux/common/wait.c9
-rw-r--r--libc/sysdeps/linux/common/waitpid.c7
-rw-r--r--libc/sysdeps/linux/common/write.c6
15 files changed, 83 insertions, 24 deletions
diff --git a/libc/sysdeps/linux/common/__syscall_fcntl.c b/libc/sysdeps/linux/common/__syscall_fcntl.c
index 8b896b4f7..355b22b00 100644
--- a/libc/sysdeps/linux/common/__syscall_fcntl.c
+++ b/libc/sysdeps/linux/common/__syscall_fcntl.c
@@ -38,7 +38,12 @@ int fcntl(int fd, int cmd, ...)
return (__syscall_fcntl(fd, cmd, arg));
}
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(fcntl)
+#else
+libc_hidden_weak(fcntl)
+strong_alias(fcntl,__libc_fcntl)
+#endif
#if ! defined __NR_fcntl64 && defined __UCLIBC_HAS_LFS__
strong_alias(fcntl,fcntl64)
diff --git a/libc/sysdeps/linux/common/close.c b/libc/sysdeps/linux/common/close.c
index be3d2e051..d6b5fbb20 100644
--- a/libc/sysdeps/linux/common/close.c
+++ b/libc/sysdeps/linux/common/close.c
@@ -11,4 +11,10 @@
#include <unistd.h>
_syscall1(int, close, int, fd)
+
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(close)
+#else
+libc_hidden_weak(close)
+strong_alias(close,__libc_close)
+#endif
diff --git a/libc/sysdeps/linux/common/fsync.c b/libc/sysdeps/linux/common/fsync.c
index 838cb7d21..774efc9ce 100644
--- a/libc/sysdeps/linux/common/fsync.c
+++ b/libc/sysdeps/linux/common/fsync.c
@@ -10,4 +10,9 @@
#include <sys/syscall.h>
#include <unistd.h>
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(fsync) weak_function fsync;
+strong_alias(fsync,__libc_fsync)
+#endif
+
_syscall1(int, fsync, int, fd)
diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c
index 6bb88cac5..29582f768 100644
--- a/libc/sysdeps/linux/common/llseek.c
+++ b/libc/sysdeps/linux/common/llseek.c
@@ -36,4 +36,9 @@ loff_t lseek64(int fd, loff_t offset, int whence)
#endif
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(lseek64)
+#else
+libc_hidden_weak(lseek64)
+strong_alias(lseek64,__libc_lseek64)
+#endif
diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c
index b58f75c01..9ff424048 100644
--- a/libc/sysdeps/linux/common/lseek.c
+++ b/libc/sysdeps/linux/common/lseek.c
@@ -19,4 +19,9 @@ __off_t lseek(int fildes, __off_t offset, int whence)
return lseek64(fildes, offset, whence);
}
#endif
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(lseek)
+#else
+libc_hidden_weak(lseek)
+strong_alias(lseek,__libc_lseek)
+#endif
diff --git a/libc/sysdeps/linux/common/msync.c b/libc/sysdeps/linux/common/msync.c
index a0b47f913..7a46f0c32 100644
--- a/libc/sysdeps/linux/common/msync.c
+++ b/libc/sysdeps/linux/common/msync.c
@@ -14,6 +14,11 @@
#include <sys/mman.h>
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(msync) weak_function msync;
+strong_alias(msync,__libc_msync)
+#endif
+
_syscall3(int, msync, void *, addr, size_t, length, int, flags)
#endif
diff --git a/libc/sysdeps/linux/common/nanosleep.c b/libc/sysdeps/linux/common/nanosleep.c
index 19f01183b..0849127db 100644
--- a/libc/sysdeps/linux/common/nanosleep.c
+++ b/libc/sysdeps/linux/common/nanosleep.c
@@ -13,5 +13,10 @@
#if defined __USE_POSIX199309 && defined __NR_nanosleep
_syscall2(int, nanosleep, const struct timespec *, req,
struct timespec *, rem)
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(nanosleep)
+#else
+libc_hidden_weak(nanosleep)
+strong_alias(nanosleep,__libc_nanosleep)
+#endif
#endif
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index 0faf02a00..66c266371 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -31,7 +31,12 @@ int open(const char *file, int oflag, ...)
return __syscall_open(file, oflag, mode);
}
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(open)
+#else
+libc_hidden_weak(open)
+strong_alias(open,__libc_open)
+#endif
int creat(const char *file, mode_t mode)
{
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index 19ec33321..cfe471c64 100644
--- a/libc/sysdeps/linux/common/open64.c
+++ b/libc/sysdeps/linux/common/open64.c
@@ -30,6 +30,11 @@ int open64 (const char *file, int oflag, ...)
return open(file, oflag | O_LARGEFILE, mode);
}
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(open64)
+#else
+libc_hidden_weak(open64)
+strong_alias(open64,__libc_open64)
+#endif
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c
index 7f2ca57a5..30963d623 100644
--- a/libc/sysdeps/linux/common/pause.c
+++ b/libc/sysdeps/linux/common/pause.c
@@ -10,17 +10,18 @@
#define __UCLIBC_HIDE_DEPRECATED__
#include <sys/syscall.h>
#include <unistd.h>
+#include <signal.h>
-#ifdef __NR_pause
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(pause) weak_function pause;
+strong_alias(pause,__libc_pause)
+#endif
+#ifdef __NR_pause
_syscall0(int, pause)
-
#else
-
-#include <signal.h>
int pause(void)
{
return (__sigpause(sigblock(0), 0));
}
-
#endif
diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c
index e5f5f771f..4a6f06e19 100644
--- a/libc/sysdeps/linux/common/poll.c
+++ b/libc/sysdeps/linux/common/poll.c
@@ -20,18 +20,14 @@
#include <sys/syscall.h>
#include <sys/poll.h>
-extern __typeof(poll) __libc_poll;
-
#ifdef __NR_poll
-# define __NR___libc_poll __NR_poll
-_syscall3(int, __libc_poll, struct pollfd *, fds,
+_syscall3(int, poll, struct pollfd *, fds,
unsigned long int, nfds, int, timeout)
#elif defined(__NR_ppoll) && defined __UCLIBC_LINUX_SPECIFIC__
-/* libc_hidden_proto(ppoll) */
-int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
{
struct timespec *ts = NULL, tval;
if (timeout > 0) {
@@ -57,11 +53,6 @@ int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
#include <sys/param.h>
#include <unistd.h>
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* Experimentally off - libc_hidden_proto(memset) */
-/* libc_hidden_proto(getdtablesize) */
-/* libc_hidden_proto(select) */
-
/* uClinux 2.0 doesn't have poll, emulate it using select */
/* Poll the file descriptors described by the NFDS structures starting at
@@ -70,7 +61,7 @@ int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
Returns the number of file descriptors with events, zero if timed out,
or -1 for errors. */
-int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
{
static int max_fd_size;
struct timeval tv;
@@ -229,6 +220,10 @@ int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
}
#endif
-/* libc_hidden_proto(poll) */
-weak_alias(__libc_poll,poll)
+
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(poll)
+#else
libc_hidden_weak(poll)
+strong_alias(poll,__libc_poll)
+#endif
diff --git a/libc/sysdeps/linux/common/read.c b/libc/sysdeps/linux/common/read.c
index b380812e6..9e122fc10 100644
--- a/libc/sysdeps/linux/common/read.c
+++ b/libc/sysdeps/linux/common/read.c
@@ -11,4 +11,9 @@
#include <unistd.h>
_syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(read)
+#else
+libc_hidden_weak(read)
+strong_alias(read,__libc_read)
+#endif
diff --git a/libc/sysdeps/linux/common/wait.c b/libc/sysdeps/linux/common/wait.c
index 32602e80f..b16495314 100644
--- a/libc/sysdeps/linux/common/wait.c
+++ b/libc/sysdeps/linux/common/wait.c
@@ -10,11 +10,14 @@
#include <sys/wait.h>
#include <sys/resource.h>
-/* libc_hidden_proto(wait4) */
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(wait) weak_function wait;
+strong_alias(wait,__libc_wait)
+#endif
/* Wait for a child to die. When one does, put its status in *STAT_LOC
* and return its process ID. For errors, return (pid_t) -1. */
-__pid_t wait (__WAIT_STATUS_DEFN stat_loc)
+__pid_t wait(__WAIT_STATUS_DEFN stat_loc)
{
- return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
+ return wait4(WAIT_ANY, stat_loc, 0, NULL);
}
diff --git a/libc/sysdeps/linux/common/waitpid.c b/libc/sysdeps/linux/common/waitpid.c
index 16075cad9..e46499377 100644
--- a/libc/sysdeps/linux/common/waitpid.c
+++ b/libc/sysdeps/linux/common/waitpid.c
@@ -10,10 +10,13 @@
#include <sys/wait.h>
#include <sys/resource.h>
-/* libc_hidden_proto(wait4) */
-
__pid_t waitpid(__pid_t pid, int *wait_stat, int options)
{
return wait4(pid, wait_stat, options, NULL);
}
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(waitpid)
+#else
+libc_hidden_weak(waitpid)
+strong_alias(waitpid,__libc_waitpid)
+#endif
diff --git a/libc/sysdeps/linux/common/write.c b/libc/sysdeps/linux/common/write.c
index b6d71f033..5a6f7225f 100644
--- a/libc/sysdeps/linux/common/write.c
+++ b/libc/sysdeps/linux/common/write.c
@@ -11,7 +11,13 @@
#include <unistd.h>
_syscall3(ssize_t, write, int, fd, const __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
libc_hidden_def(write)
+#else
+libc_hidden_weak(write)
+strong_alias(write,__libc_write)
+#endif
+
#if 0
/* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o
* which is a blatant GNU libc-ism... */