summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/close.c8
-rw-r--r--libc/sysdeps/linux/common/creat64.c10
-rw-r--r--libc/sysdeps/linux/common/fsync.c5
-rw-r--r--libc/sysdeps/linux/common/llseek.c20
-rw-r--r--libc/sysdeps/linux/common/lseek.c18
-rw-r--r--libc/sysdeps/linux/common/msync.c5
-rw-r--r--libc/sysdeps/linux/common/nanosleep.c9
-rw-r--r--libc/sysdeps/linux/common/open.c23
-rw-r--r--libc/sysdeps/linux/common/open64.c14
-rw-r--r--libc/sysdeps/linux/common/pause.c14
-rw-r--r--libc/sysdeps/linux/common/pread_write.c8
-rw-r--r--libc/sysdeps/linux/common/read.c8
-rw-r--r--libc/sysdeps/linux/common/readv.c6
-rw-r--r--libc/sysdeps/linux/common/truncate64.c19
-rw-r--r--libc/sysdeps/linux/common/wait.c5
-rw-r--r--libc/sysdeps/linux/common/waitpid.c7
-rw-r--r--libc/sysdeps/linux/common/write.c12
-rw-r--r--libc/sysdeps/linux/common/writev.c6
18 files changed, 60 insertions, 137 deletions
diff --git a/libc/sysdeps/linux/common/close.c b/libc/sysdeps/linux/common/close.c
index 6a160b43e..be3d2e051 100644
--- a/libc/sysdeps/linux/common/close.c
+++ b/libc/sysdeps/linux/common/close.c
@@ -10,9 +10,5 @@
#include <sys/syscall.h>
#include <unistd.h>
-extern __typeof(close) __libc_close;
-#define __NR___libc_close __NR_close
-_syscall1(int, __libc_close, int, fd)
-/* libc_hidden_proto(close) */
-weak_alias(__libc_close,close)
-libc_hidden_weak(close)
+_syscall1(int, close, int, fd)
+libc_hidden_def(close)
diff --git a/libc/sysdeps/linux/common/creat64.c b/libc/sysdeps/linux/common/creat64.c
index 6fa010545..577ad14b5 100644
--- a/libc/sysdeps/linux/common/creat64.c
+++ b/libc/sysdeps/linux/common/creat64.c
@@ -22,15 +22,9 @@
#include <fcntl.h>
#include <sys/types.h>
-extern __typeof(open64) __libc_open64;
-libc_hidden_proto(__libc_open64)
-
-extern __typeof(creat64) __libc_creat64;
-
/* Create FILE with protections MODE. */
-int __libc_creat64 (const char *file, mode_t mode)
+int creat64(const char *file, mode_t mode)
{
- return __libc_open64 (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+ return open64(file, O_WRONLY|O_CREAT|O_TRUNC, mode);
}
-weak_alias(__libc_creat64,creat64)
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/common/fsync.c b/libc/sysdeps/linux/common/fsync.c
index 1066770d5..838cb7d21 100644
--- a/libc/sysdeps/linux/common/fsync.c
+++ b/libc/sysdeps/linux/common/fsync.c
@@ -10,7 +10,4 @@
#include <sys/syscall.h>
#include <unistd.h>
-extern __typeof(fsync) __libc_fsync;
-#define __NR___libc_fsync __NR_fsync
-_syscall1(int, __libc_fsync, int, fd)
-weak_alias(__libc_fsync, fsync)
+_syscall1(int, fsync, int, fd)
diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c
index 1879464f7..6bb88cac5 100644
--- a/libc/sysdeps/linux/common/llseek.c
+++ b/libc/sysdeps/linux/common/llseek.c
@@ -11,8 +11,6 @@
#include <sys/types.h>
#include <sys/syscall.h>
-extern __typeof(lseek64) __libc_lseek64;
-
#if defined __NR__llseek && defined __UCLIBC_HAS_LFS__
# ifndef INLINE_SYSCALL
@@ -22,22 +20,20 @@ static __inline__ _syscall5(int, __syscall_llseek, int, fd, off_t, offset_hi,
off_t, offset_lo, loff_t *, result, int, whence)
# endif
-loff_t __libc_lseek64(int fd, loff_t offset, int whence)
+loff_t lseek64(int fd, loff_t offset, int whence)
{
loff_t result;
- return(loff_t)(INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32),
+ return (loff_t)(INLINE_SYSCALL(_llseek, 5, fd, (off_t) (offset >> 32),
(off_t) (offset & 0xffffffff), &result, whence) ?: result);
}
+
#else
-extern __typeof(lseek) __libc_lseek;
-/* libc_hidden_proto(__libc_lseek) */
-loff_t __libc_lseek64(int fd, loff_t offset, int whence)
+loff_t lseek64(int fd, loff_t offset, int whence)
{
- return(loff_t)(__libc_lseek(fd, (off_t) (offset), whence));
+ return (loff_t)(lseek(fd, (off_t) (offset), whence));
}
+
#endif
-/* libc_hidden_proto(lseek64) */
-weak_alias(__libc_lseek64,lseek64)
-libc_hidden_weak(lseek64)
-/*strong_alias(__libc_lseek64,_llseek) */
+
+libc_hidden_def(lseek64)
diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c
index ee49c9f25..b58f75c01 100644
--- a/libc/sysdeps/linux/common/lseek.c
+++ b/libc/sysdeps/linux/common/lseek.c
@@ -10,23 +10,13 @@
#include <sys/syscall.h>
#include <unistd.h>
-extern __typeof(lseek) __libc_lseek;
-libc_hidden_proto(__libc_lseek)
-
#ifdef __NR_lseek
-#define __NR___libc_lseek __NR_lseek
-_syscall3(__off_t, __libc_lseek, int, fildes, __off_t, offset, int, whence)
+_syscall3(__off_t, lseek, int, fildes, __off_t, offset, int, whence)
#else
-extern __typeof(lseek64) __libc_lseek64;
-libc_hidden_proto(__libc_lseek64)
-__off_t __libc_lseek(int fildes, __off_t offset, int whence)
+__off_t lseek(int fildes, __off_t offset, int whence)
{
- return __libc_lseek64(fildes, offset, whence);
+ return lseek64(fildes, offset, whence);
}
#endif
-libc_hidden_def(__libc_lseek)
-
-/* libc_hidden_proto(lseek) */
-weak_alias(__libc_lseek,lseek)
-libc_hidden_weak(lseek)
+libc_hidden_def(lseek)
diff --git a/libc/sysdeps/linux/common/msync.c b/libc/sysdeps/linux/common/msync.c
index 0b33fb659..a0b47f913 100644
--- a/libc/sysdeps/linux/common/msync.c
+++ b/libc/sysdeps/linux/common/msync.c
@@ -14,9 +14,6 @@
#include <sys/mman.h>
-extern __typeof(msync) __libc_msync;
-#define __NR___libc_msync __NR_msync
-_syscall3(int, __libc_msync, void *, addr, size_t, length, int, flags)
-weak_alias(__libc_msync,msync)
+_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 24b2eb080..19f01183b 100644
--- a/libc/sysdeps/linux/common/nanosleep.c
+++ b/libc/sysdeps/linux/common/nanosleep.c
@@ -11,12 +11,7 @@
#include <time.h>
#if defined __USE_POSIX199309 && defined __NR_nanosleep
-
-extern __typeof(nanosleep) __libc_nanosleep;
-#define __NR___libc_nanosleep __NR_nanosleep
-_syscall2(int, __libc_nanosleep, const struct timespec *, req,
+_syscall2(int, nanosleep, const struct timespec *, req,
struct timespec *, rem)
-/* libc_hidden_proto(nanosleep) */
-weak_alias(__libc_nanosleep,nanosleep)
-libc_hidden_weak(nanosleep)
+libc_hidden_def(nanosleep)
#endif
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index a39093bd1..0faf02a00 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -14,35 +14,26 @@
#include <string.h>
#include <sys/param.h>
-extern __typeof(open) __libc_open;
-extern __typeof(creat) __libc_creat;
-
#define __NR___syscall_open __NR_open
static __inline__ _syscall3(int, __syscall_open, const char *, file,
int, flags, __kernel_mode_t, mode)
-libc_hidden_proto(__libc_open)
-int __libc_open(const char *file, int oflag, ...)
+int open(const char *file, int oflag, ...)
{
mode_t mode = 0;
if (oflag & O_CREAT) {
va_list arg;
- va_start (arg, oflag);
- mode = va_arg (arg, mode_t);
- va_end (arg);
+ va_start(arg, oflag);
+ mode = va_arg(arg, mode_t);
+ va_end(arg);
}
return __syscall_open(file, oflag, mode);
}
-libc_hidden_def(__libc_open)
-
-/* libc_hidden_proto(open) */
-weak_alias(__libc_open,open)
-libc_hidden_weak(open)
+libc_hidden_def(open)
-int __libc_creat(const char *file, mode_t mode)
+int creat(const char *file, mode_t mode)
{
- return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+ return open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
}
-weak_alias(__libc_creat,creat)
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index 4d965aeba..19ec33321 100644
--- a/libc/sysdeps/linux/common/open64.c
+++ b/libc/sysdeps/linux/common/open64.c
@@ -14,14 +14,9 @@
# define O_LARGEFILE 0100000
#endif
-extern __typeof(open64) __libc_open64;
-extern __typeof(open) __libc_open;
-libc_hidden_proto(__libc_open)
-
/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
a third argument is the file protection. */
-libc_hidden_proto(__libc_open64)
-int __libc_open64 (const char *file, int oflag, ...)
+int open64 (const char *file, int oflag, ...)
{
mode_t mode = 0;
@@ -33,11 +28,8 @@ int __libc_open64 (const char *file, int oflag, ...)
va_end (arg);
}
- return __libc_open(file, oflag | O_LARGEFILE, mode);
+ return open(file, oflag | O_LARGEFILE, mode);
}
-libc_hidden_def(__libc_open64)
+libc_hidden_def(open64)
-/* libc_hidden_proto(open64) */
-weak_alias(__libc_open64,open64)
-libc_hidden_weak(open64)
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c
index 5c75211a7..7f2ca57a5 100644
--- a/libc/sysdeps/linux/common/pause.c
+++ b/libc/sysdeps/linux/common/pause.c
@@ -11,18 +11,16 @@
#include <sys/syscall.h>
#include <unistd.h>
-extern __typeof(pause) __libc_pause;
#ifdef __NR_pause
-#define __NR___libc_pause __NR_pause
-_syscall0(int, __libc_pause)
+
+_syscall0(int, pause)
+
#else
-#include <signal.h>
-/* libc_hidden_proto(__sigpause) */
-/* libc_hidden_proto(sigblock) */
-int __libc_pause(void)
+#include <signal.h>
+int pause(void)
{
return (__sigpause(sigblock(0), 0));
}
+
#endif
-weak_alias(__libc_pause,pause)
diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
index cb1d83820..83d5fdfb0 100644
--- a/libc/sysdeps/linux/common/pread_write.c
+++ b/libc/sysdeps/linux/common/pread_write.c
@@ -42,8 +42,8 @@ weak_alias(__libc_pread,pread)
# ifdef __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
{
- uint32_t low = offset & 0xffffffff;
- uint32_t high = offset >> 32;
+ uint32_t low = offset & 0xffffffff;
+ uint32_t high = offset >> 32;
return __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
}
weak_alias(__libc_pread64,pread64)
@@ -66,8 +66,8 @@ weak_alias(__libc_pwrite,pwrite)
# ifdef __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
{
- uint32_t low = offset & 0xffffffff;
- uint32_t high = offset >> 32;
+ uint32_t low = offset & 0xffffffff;
+ uint32_t high = offset >> 32;
return __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
}
weak_alias(__libc_pwrite64,pwrite64)
diff --git a/libc/sysdeps/linux/common/read.c b/libc/sysdeps/linux/common/read.c
index cfa857319..b380812e6 100644
--- a/libc/sysdeps/linux/common/read.c
+++ b/libc/sysdeps/linux/common/read.c
@@ -10,9 +10,5 @@
#include <sys/syscall.h>
#include <unistd.h>
-extern __typeof(read) __libc_read;
-#define __NR___libc_read __NR_read
-_syscall3(ssize_t, __libc_read, int, fd, __ptr_t, buf, size_t, count)
-/* libc_hidden_proto(read) */
-weak_alias(__libc_read,read)
-libc_hidden_weak(read)
+_syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
+libc_hidden_def(read)
diff --git a/libc/sysdeps/linux/common/readv.c b/libc/sysdeps/linux/common/readv.c
index 86e94d8a1..3c40a0d8d 100644
--- a/libc/sysdeps/linux/common/readv.c
+++ b/libc/sysdeps/linux/common/readv.c
@@ -10,9 +10,5 @@
#include <sys/syscall.h>
#include <sys/uio.h>
-extern __typeof(readv) __libc_readv;
-
-#define __NR___libc_readv __NR_readv
-_syscall3(ssize_t, __libc_readv, int, filedes, const struct iovec *, vector,
+_syscall3(ssize_t, readv, int, filedes, const struct iovec *, vector,
int, count)
-weak_alias(__libc_readv,readv)
diff --git a/libc/sysdeps/linux/common/truncate64.c b/libc/sysdeps/linux/common/truncate64.c
index 40989334f..d542679ce 100644
--- a/libc/sysdeps/linux/common/truncate64.c
+++ b/libc/sysdeps/linux/common/truncate64.c
@@ -30,7 +30,7 @@ _syscall2(int, truncate64, const char *, path, __off64_t, length)
#elif __WORDSIZE == 32
#ifndef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) __syscall_truncate64 (args)
+#define INLINE_SYSCALL(name, nr, args...) __syscall_truncate64(args)
#define __NR___syscall_truncate64 __NR_truncate64
#if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
static __inline__ _syscall4(int, __syscall_truncate64, const char *, path,
@@ -41,18 +41,17 @@ static __inline__ _syscall3(int, __syscall_truncate64, const char *, path,
#endif
#endif
-
/* The exported truncate64 function. */
-int truncate64 (const char * path, __off64_t length)
+int truncate64(const char * path, __off64_t length)
{
- uint32_t low = length & 0xffffffff;
- uint32_t high = length >> 32;
+ uint32_t low = length & 0xffffffff;
+ uint32_t high = length >> 32;
#if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
- return INLINE_SYSCALL(truncate64, 4, path, 0,
- __LONG_LONG_PAIR (high, low));
+ return INLINE_SYSCALL(truncate64, 4, path, 0,
+ __LONG_LONG_PAIR(high, low));
#else
- return INLINE_SYSCALL(truncate64, 3, path,
- __LONG_LONG_PAIR (high, low));
+ return INLINE_SYSCALL(truncate64, 3, path,
+ __LONG_LONG_PAIR(high, low));
#endif
}
@@ -64,7 +63,7 @@ int truncate64 (const char * path, __off64_t length)
/* libc_hidden_proto(truncate) */
-int truncate64 (const char * path, __off64_t length)
+int truncate64(const char * path, __off64_t length)
{
__off_t x = (__off_t) length;
diff --git a/libc/sysdeps/linux/common/wait.c b/libc/sysdeps/linux/common/wait.c
index e1b41112d..32602e80f 100644
--- a/libc/sysdeps/linux/common/wait.c
+++ b/libc/sysdeps/linux/common/wait.c
@@ -12,12 +12,9 @@
/* libc_hidden_proto(wait4) */
-extern __typeof(wait) __libc_wait;
-
/* 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 __libc_wait (__WAIT_STATUS_DEFN stat_loc)
+__pid_t wait (__WAIT_STATUS_DEFN stat_loc)
{
return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
}
-weak_alias(__libc_wait,wait)
diff --git a/libc/sysdeps/linux/common/waitpid.c b/libc/sysdeps/linux/common/waitpid.c
index d5afd8262..16075cad9 100644
--- a/libc/sysdeps/linux/common/waitpid.c
+++ b/libc/sysdeps/linux/common/waitpid.c
@@ -12,11 +12,8 @@
/* libc_hidden_proto(wait4) */
-extern __typeof(waitpid) __libc_waitpid;
-__pid_t __libc_waitpid(__pid_t pid, int *wait_stat, int options)
+__pid_t waitpid(__pid_t pid, int *wait_stat, int options)
{
return wait4(pid, wait_stat, options, NULL);
}
-/* libc_hidden_proto(waitpid) */
-weak_alias(__libc_waitpid,waitpid)
-libc_hidden_weak(waitpid)
+libc_hidden_def(waitpid)
diff --git a/libc/sysdeps/linux/common/write.c b/libc/sysdeps/linux/common/write.c
index 7776ec955..b6d71f033 100644
--- a/libc/sysdeps/linux/common/write.c
+++ b/libc/sysdeps/linux/common/write.c
@@ -10,14 +10,10 @@
#include <sys/syscall.h>
#include <unistd.h>
-extern __typeof(write) __libc_write;
-#define __NR___libc_write __NR_write
-_syscall3(ssize_t, __libc_write, int, fd, const __ptr_t, buf, size_t, count)
-/* libc_hidden_proto(write) */
-weak_alias(__libc_write,write)
-libc_hidden_weak(write)
+_syscall3(ssize_t, write, int, fd, const __ptr_t, buf, size_t, count)
+libc_hidden_def(write)
#if 0
/* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o
- * which is a blatent GNU libc-ism... */
-strong_alias(__libc_write,__write)
+ * which is a blatant GNU libc-ism... */
+strong_alias(write,__write)
#endif
diff --git a/libc/sysdeps/linux/common/writev.c b/libc/sysdeps/linux/common/writev.c
index c393beec1..99de7e43d 100644
--- a/libc/sysdeps/linux/common/writev.c
+++ b/libc/sysdeps/linux/common/writev.c
@@ -10,9 +10,5 @@
#include <sys/syscall.h>
#include <sys/uio.h>
-extern __typeof(writev) __libc_writev;
-
-#define __NR___libc_writev __NR_writev
-_syscall3(ssize_t, __libc_writev, int, filedes, const struct iovec *, vector,
+_syscall3(ssize_t, writev, int, filedes, const struct iovec *, vector,
int, count)
-weak_alias(__libc_writev,writev)