From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/sysdeps/linux/common/__rt_sigtimedwait.c | 15 ++++---- libc/sysdeps/linux/common/__syscall_fcntl.c | 25 ++++++++------ libc/sysdeps/linux/common/__syscall_fcntl64.c | 11 +++--- libc/sysdeps/linux/common/_exit.c | 7 ++-- libc/sysdeps/linux/common/adjtimex.c | 9 +++-- libc/sysdeps/linux/common/alarm.c | 12 ++++--- libc/sysdeps/linux/common/chdir.c | 5 +-- libc/sysdeps/linux/common/chmod.c | 5 +-- libc/sysdeps/linux/common/clock_getres.c | 4 +-- libc/sysdeps/linux/common/clock_gettime.c | 4 +-- libc/sysdeps/linux/common/clock_settime.c | 4 +-- libc/sysdeps/linux/common/close.c | 9 ++--- libc/sysdeps/linux/common/cmsg_nxthdr.c | 7 ++-- libc/sysdeps/linux/common/creat64.c | 4 +-- libc/sysdeps/linux/common/dl-osinfo.h | 13 ++++--- libc/sysdeps/linux/common/dup2.c | 6 ++-- libc/sysdeps/linux/common/execve.c | 5 +-- libc/sysdeps/linux/common/fchdir.c | 6 ++-- libc/sysdeps/linux/common/fork.c | 9 ++--- libc/sysdeps/linux/common/fstat.c | 13 ++++--- libc/sysdeps/linux/common/fstat64.c | 6 ++-- libc/sysdeps/linux/common/fstatfs.c | 6 ++-- libc/sysdeps/linux/common/fsync.c | 2 +- libc/sysdeps/linux/common/ftruncate.c | 3 +- libc/sysdeps/linux/common/ftruncate64.c | 4 +-- libc/sysdeps/linux/common/getcwd.c | 50 +++++++++++++++++---------- libc/sysdeps/linux/common/getdents.c | 7 ++-- libc/sysdeps/linux/common/getdents64.c | 7 ++-- libc/sysdeps/linux/common/getdirname.c | 20 ++++++----- libc/sysdeps/linux/common/getdnnm.c | 20 +++++++---- libc/sysdeps/linux/common/getdtablesize.c | 9 ++--- libc/sysdeps/linux/common/getegid.c | 11 +++--- libc/sysdeps/linux/common/geteuid.c | 11 +++--- libc/sysdeps/linux/common/getgid.c | 5 +-- libc/sysdeps/linux/common/getgroups.c | 9 ++--- libc/sysdeps/linux/common/gethstnm.c | 21 +++++++---- libc/sysdeps/linux/common/getpagesize.c | 16 +++++---- libc/sysdeps/linux/common/getpgid.c | 3 +- libc/sysdeps/linux/common/getpid.c | 12 +++---- libc/sysdeps/linux/common/getpriority.c | 5 +-- libc/sysdeps/linux/common/getrlimit.c | 7 ++-- libc/sysdeps/linux/common/getrlimit64.c | 4 +-- libc/sysdeps/linux/common/getsid.c | 5 +-- libc/sysdeps/linux/common/gettimeofday.c | 6 ++-- libc/sysdeps/linux/common/getuid.c | 5 +-- libc/sysdeps/linux/common/ioctl.c | 6 ++-- libc/sysdeps/linux/common/kill.c | 5 +-- libc/sysdeps/linux/common/llseek.c | 18 +++++----- libc/sysdeps/linux/common/longjmp.c | 13 +++---- libc/sysdeps/linux/common/lseek.c | 14 ++++---- libc/sysdeps/linux/common/lstat.c | 13 ++++--- libc/sysdeps/linux/common/lstat64.c | 6 ++-- libc/sysdeps/linux/common/mkdir.c | 5 +-- libc/sysdeps/linux/common/mkfifo.c | 4 +-- libc/sysdeps/linux/common/mknod.c | 5 +-- libc/sysdeps/linux/common/mmap.c | 5 +-- libc/sysdeps/linux/common/mmap64.c | 5 ++- libc/sysdeps/linux/common/modify_ldt.c | 2 +- libc/sysdeps/linux/common/mremap.c | 6 ++-- libc/sysdeps/linux/common/msync.c | 2 +- libc/sysdeps/linux/common/munmap.c | 6 ++-- libc/sysdeps/linux/common/nanosleep.c | 5 +-- libc/sysdeps/linux/common/nice.c | 7 ++-- libc/sysdeps/linux/common/ntp_gettime.c | 6 ++-- libc/sysdeps/linux/common/open.c | 14 ++++---- libc/sysdeps/linux/common/open64.c | 14 +++++--- libc/sysdeps/linux/common/pause.c | 8 ++--- libc/sysdeps/linux/common/pipe.c | 6 ++-- libc/sysdeps/linux/common/poll.c | 46 ++++++++++++------------ libc/sysdeps/linux/common/posix_fadvise.c | 6 +--- libc/sysdeps/linux/common/posix_fadvise64.c | 2 +- libc/sysdeps/linux/common/pread_write.c | 35 +++++++++++-------- libc/sysdeps/linux/common/read.c | 9 ++--- libc/sysdeps/linux/common/readlink.c | 6 ++-- libc/sysdeps/linux/common/rmdir.c | 6 ++-- libc/sysdeps/linux/common/sbrk.c | 12 ++++--- libc/sysdeps/linux/common/select.c | 10 +++--- libc/sysdeps/linux/common/setegid.c | 10 ++++-- libc/sysdeps/linux/common/seteuid.c | 14 +++++--- libc/sysdeps/linux/common/setgroups.c | 9 ++--- libc/sysdeps/linux/common/setitimer.c | 6 ++-- libc/sysdeps/linux/common/setpgid.c | 5 +-- libc/sysdeps/linux/common/setpgrp.c | 8 ++++- libc/sysdeps/linux/common/setpriority.c | 6 ++-- libc/sysdeps/linux/common/setregid.c | 4 +-- libc/sysdeps/linux/common/setresgid.c | 5 +-- libc/sysdeps/linux/common/setresuid.c | 5 +-- libc/sysdeps/linux/common/setreuid.c | 5 +-- libc/sysdeps/linux/common/setrlimit.c | 8 ++--- libc/sysdeps/linux/common/setrlimit64.c | 4 +-- libc/sysdeps/linux/common/setsid.c | 6 ++-- libc/sysdeps/linux/common/settimeofday.c | 6 ++-- libc/sysdeps/linux/common/sigprocmask.c | 7 ++-- libc/sysdeps/linux/common/sigsuspend.c | 7 ++-- libc/sysdeps/linux/common/ssp.c | 38 +++++++++++--------- libc/sysdeps/linux/common/stat.c | 13 ++++--- libc/sysdeps/linux/common/stat64.c | 6 ++-- libc/sysdeps/linux/common/statfs.c | 5 +-- libc/sysdeps/linux/common/time.c | 12 +++---- libc/sysdeps/linux/common/times.c | 6 ++-- libc/sysdeps/linux/common/truncate.c | 3 +- libc/sysdeps/linux/common/truncate64.c | 5 ++- libc/sysdeps/linux/common/ulimit.c | 8 ++--- libc/sysdeps/linux/common/uname.c | 6 ++-- libc/sysdeps/linux/common/unlink.c | 6 ++-- libc/sysdeps/linux/common/utime.c | 15 ++++---- libc/sysdeps/linux/common/utimes.c | 13 +++---- libc/sysdeps/linux/common/vfork.c | 9 ++--- libc/sysdeps/linux/common/wait.c | 14 +++++--- libc/sysdeps/linux/common/wait3.c | 7 +++- libc/sysdeps/linux/common/wait4.c | 5 +-- libc/sysdeps/linux/common/waitpid.c | 17 ++++++--- libc/sysdeps/linux/common/write.c | 11 +++--- 113 files changed, 593 insertions(+), 455 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/libc/sysdeps/linux/common/__rt_sigtimedwait.c index 09409fe81..43c6b6517 100644 --- a/libc/sysdeps/linux/common/__rt_sigtimedwait.c +++ b/libc/sysdeps/linux/common/__rt_sigtimedwait.c @@ -16,18 +16,18 @@ static _syscall4(int, __rt_sigtimedwait, const sigset_t *, set, siginfo_t *, info, const struct timespec *, timeout, size_t, setsize); -int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) +int sigwaitinfo(const sigset_t * set, siginfo_t * info) { return __rt_sigtimedwait(set, info, NULL, _NSIG / 8); } -int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, +int sigtimedwait(const sigset_t * set, siginfo_t * info, const struct timespec *timeout) { return __rt_sigtimedwait(set, info, timeout, _NSIG / 8); } #else -int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) +int sigwaitinfo(const sigset_t * set, siginfo_t * info) { if (set == NULL) __set_errno(EINVAL); @@ -36,7 +36,7 @@ int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) return -1; } -int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, +int sigtimedwait(const sigset_t * set, siginfo_t * info, const struct timespec *timeout) { if (set == NULL) @@ -46,6 +46,7 @@ int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, return -1; } #endif -/* keep these weak so that libpthread can overwrite them */ -weak_alias(__sigtimedwait,sigtimedwait) -weak_alias(__sigwaitinfo,sigwaitinfo) +libc_hidden_proto(sigwaitinfo) +libc_hidden_def(sigwaitinfo) +libc_hidden_proto(sigtimedwait) +libc_hidden_def(sigtimedwait) diff --git a/libc/sysdeps/linux/common/__syscall_fcntl.c b/libc/sysdeps/linux/common/__syscall_fcntl.c index ca9aff5e7..f8652def6 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl.c @@ -11,18 +11,16 @@ #include #include -#undef __fcntl - #if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64 -extern int __fcntl64(int fd, int cmd, ...) attribute_hidden; +extern int __libc_fcntl64(int fd, int cmd, ...); +libc_hidden_proto(__libc_fcntl64) #endif -#undef fcntl #define __NR___syscall_fcntl __NR_fcntl static inline _syscall3(int, __syscall_fcntl, int, fd, int, cmd, long, arg); -int attribute_hidden __fcntl(int fd, int cmd, ...) +int __libc_fcntl(int fd, int cmd, ...) { long arg; va_list list; @@ -33,7 +31,7 @@ int attribute_hidden __fcntl(int fd, int cmd, ...) if (cmd == F_GETLK64 || cmd == F_SETLK64 || cmd == F_SETLKW64) { #if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64 - return __fcntl64(fd, cmd, arg); + return __libc_fcntl64(fd, cmd, arg); #else __set_errno(ENOSYS); return -1; @@ -41,10 +39,15 @@ int attribute_hidden __fcntl(int fd, int cmd, ...) } return (__syscall_fcntl(fd, cmd, arg)); } -strong_alias(__fcntl,fcntl) -weak_alias(__fcntl,__libc_fcntl) +libc_hidden_proto(__libc_fcntl) +libc_hidden_def(__libc_fcntl) + +strong_alias(__libc_fcntl,fcntl) +libc_hidden_proto(fcntl) +libc_hidden_def(fcntl) #if ! defined __NR_fcntl64 && defined __UCLIBC_HAS_LFS__ -hidden_strong_alias(__fcntl,__fcntl64) -weak_alias(__fcntl,fcntl64) -weak_alias(__fcntl,__libc_fcntl64) +strong_alias(__libc_fcntl,__libc_fcntl64) +strong_alias(__libc_fcntl,fcntl64) +libc_hidden_proto(fcntl64) +libc_hidden_def(fcntl64) #endif diff --git a/libc/sysdeps/linux/common/__syscall_fcntl64.c b/libc/sysdeps/linux/common/__syscall_fcntl64.c index 9231808e3..759ba949f 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl64.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl64.c @@ -12,10 +12,9 @@ #include #if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64 -#undef fcntl64 #define __NR___syscall_fcntl64 __NR_fcntl64 static inline _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg); -int attribute_hidden __fcntl64(int fd, int cmd, ...) +int __libc_fcntl64(int fd, int cmd, ...) { long arg; va_list list; @@ -26,6 +25,10 @@ int attribute_hidden __fcntl64(int fd, int cmd, ...) va_end(list); return (__syscall_fcntl64(fd, cmd, arg)); } -strong_alias(__fcntl64,fcntl64) -weak_alias(__fcntl64,__libc_fcntl64) +libc_hidden_proto(__libc_fcntl64) +libc_hidden_def(__libc_fcntl64) + +strong_alias(__libc_fcntl64,fcntl64) +libc_hidden_proto(fcntl64) +libc_hidden_def(fcntl64) #endif diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c index 4e450bbc5..a708fad90 100644 --- a/libc/sysdeps/linux/common/_exit.c +++ b/libc/sysdeps/linux/common/_exit.c @@ -32,12 +32,11 @@ static inline _syscall1(void, __syscall_exit, int, status); #endif -#undef _exit -#undef _exit_internal -void attribute_noreturn attribute_hidden _exit_internal(int status) +void attribute_noreturn _exit(int status) { /* The loop is added only to keep gcc happy. */ while(1) INLINE_SYSCALL(exit, 1, status); } -strong_alias(_exit_internal,_exit) +libc_hidden_proto(_exit) +libc_hidden_def(_exit) diff --git a/libc/sysdeps/linux/common/adjtimex.c b/libc/sysdeps/linux/common/adjtimex.c index ef33051e8..a6c9be2b8 100644 --- a/libc/sysdeps/linux/common/adjtimex.c +++ b/libc/sysdeps/linux/common/adjtimex.c @@ -10,8 +10,7 @@ #include "syscalls.h" #include -#define __NR___adjtimex __NR_adjtimex -attribute_hidden _syscall1(int, __adjtimex, struct timex *, buf); - -strong_alias(__adjtimex, adjtimex) -weak_alias(__adjtimex, ntp_adjtime) +_syscall1(int, adjtimex, struct timex *, buf); +libc_hidden_proto(adjtimex) +libc_hidden_def(adjtimex) +strong_alias(adjtimex,ntp_adjtime) diff --git a/libc/sysdeps/linux/common/alarm.c b/libc/sysdeps/linux/common/alarm.c index 8239cec5b..6089a50cf 100644 --- a/libc/sysdeps/linux/common/alarm.c +++ b/libc/sysdeps/linux/common/alarm.c @@ -7,16 +7,17 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define setitimer __setitimer - #include "syscalls.h" #include #ifdef __NR_alarm #define __NR___alarm __NR_alarm -attribute_hidden _syscall1(unsigned int, __alarm, unsigned int, seconds); +_syscall1(unsigned int, alarm, unsigned int, seconds); #else #include -unsigned int attribute_hidden __alarm(unsigned int seconds) + +libc_hidden_proto(setitimer) + +unsigned int alarm(unsigned int seconds) { struct itimerval old, new; unsigned int retval; @@ -35,4 +36,5 @@ unsigned int attribute_hidden __alarm(unsigned int seconds) return retval; } #endif -strong_alias(__alarm,alarm) +libc_hidden_proto(alarm) +libc_hidden_def(alarm) diff --git a/libc/sysdeps/linux/common/chdir.c b/libc/sysdeps/linux/common/chdir.c index ff4ba527b..230f86eb9 100644 --- a/libc/sysdeps/linux/common/chdir.c +++ b/libc/sysdeps/linux/common/chdir.c @@ -13,8 +13,9 @@ #define __NR___syscall_chdir __NR_chdir static inline _syscall1(int, __syscall_chdir, const char *, path); -int attribute_hidden __chdir(const char *path) +int chdir(const char *path) { return __syscall_chdir(path); } -strong_alias(__chdir,chdir) +libc_hidden_proto(chdir) +libc_hidden_def(chdir) diff --git a/libc/sysdeps/linux/common/chmod.c b/libc/sysdeps/linux/common/chmod.c index bf368cf5e..d6be1e130 100644 --- a/libc/sysdeps/linux/common/chmod.c +++ b/libc/sysdeps/linux/common/chmod.c @@ -13,8 +13,9 @@ #define __NR___syscall_chmod __NR_chmod static inline _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode); -int attribute_hidden __chmod(const char *path, mode_t mode) +int chmod(const char *path, mode_t mode) { return __syscall_chmod(path, mode); } -strong_alias(__chmod,chmod) +libc_hidden_proto(chmod) +libc_hidden_def(chmod) diff --git a/libc/sysdeps/linux/common/clock_getres.c b/libc/sysdeps/linux/common/clock_getres.c index 7aff495d0..985426444 100644 --- a/libc/sysdeps/linux/common/clock_getres.c +++ b/libc/sysdeps/linux/common/clock_getres.c @@ -19,8 +19,6 @@ * */ -#define sysconf __sysconf - #define _GNU_SOURCE #include "syscalls.h" #include @@ -29,6 +27,8 @@ #ifdef __NR_clock_getres _syscall2(int, clock_getres, clockid_t, clock_id, struct timespec*, res); #else +libc_hidden_proto(sysconf) + int clock_getres(clockid_t clock_id, struct timespec* res) { long clk_tck; diff --git a/libc/sysdeps/linux/common/clock_gettime.c b/libc/sysdeps/linux/common/clock_gettime.c index 33863a828..e72432b3c 100644 --- a/libc/sysdeps/linux/common/clock_gettime.c +++ b/libc/sysdeps/linux/common/clock_gettime.c @@ -20,8 +20,6 @@ * */ -#define gettimeofday __gettimeofday - #define _GNU_SOURCE #include "syscalls.h" #include @@ -30,6 +28,8 @@ #ifdef __NR_clock_gettime _syscall2(int, clock_gettime, clockid_t, clock_id, struct timespec*, tp); #else +libc_hidden_proto(gettimeofday) + int clock_gettime(clockid_t clock_id, struct timespec* tp) { struct timeval tv; diff --git a/libc/sysdeps/linux/common/clock_settime.c b/libc/sysdeps/linux/common/clock_settime.c index e2ec03f78..88d5df93e 100644 --- a/libc/sysdeps/linux/common/clock_settime.c +++ b/libc/sysdeps/linux/common/clock_settime.c @@ -19,8 +19,6 @@ * */ -#define settimeofday __settimeofday - #define _GNU_SOURCE #include "syscalls.h" #include @@ -29,6 +27,8 @@ #ifdef __NR_clock_settime _syscall2(int, clock_settime, clockid_t, clock_id, const struct timespec*, tp); #else +libc_hidden_proto(settimeofday) + int clock_settime(clockid_t clock_id, const struct timespec* tp) { struct timeval tv; diff --git a/libc/sysdeps/linux/common/close.c b/libc/sysdeps/linux/common/close.c index 2e9c2073d..38381a223 100644 --- a/libc/sysdeps/linux/common/close.c +++ b/libc/sysdeps/linux/common/close.c @@ -10,7 +10,8 @@ #include "syscalls.h" #include -#define __NR___close __NR_close -attribute_hidden _syscall1(int, __close, int, fd); -strong_alias(__close,close) -weak_alias(__close,__libc_close) +#define __NR___libc_close __NR_close +_syscall1(int, __libc_close, int, fd); +strong_alias(__libc_close,close) +libc_hidden_proto(close) +libc_hidden_def(close) diff --git a/libc/sysdeps/linux/common/cmsg_nxthdr.c b/libc/sysdeps/linux/common/cmsg_nxthdr.c index 771f5172b..a2352efe4 100644 --- a/libc/sysdeps/linux/common/cmsg_nxthdr.c +++ b/libc/sysdeps/linux/common/cmsg_nxthdr.c @@ -21,8 +21,8 @@ #include #include -struct cmsghdr attribute_hidden * -__cmsg_nxthdr_internal (struct msghdr *mhdr, struct cmsghdr *cmsg) +struct cmsghdr * +__cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg) { if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr)) /* The kernel header does this so there may be a reason. */ @@ -38,4 +38,5 @@ __cmsg_nxthdr_internal (struct msghdr *mhdr, struct cmsghdr *cmsg) return NULL; return cmsg; } -strong_alias(__cmsg_nxthdr_internal,__cmsg_nxthdr) +libc_hidden_proto(__cmsg_nxthdr) +libc_hidden_def(__cmsg_nxthdr) diff --git a/libc/sysdeps/linux/common/creat64.c b/libc/sysdeps/linux/common/creat64.c index 759f5bed8..0bf20f175 100644 --- a/libc/sysdeps/linux/common/creat64.c +++ b/libc/sysdeps/linux/common/creat64.c @@ -16,8 +16,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define open64 __open64 - #include #include #include @@ -37,7 +35,7 @@ # undef __USE_FILE_OFFSET64 #endif -#undef creat +libc_hidden_proto(open64) /* Create FILE with protections MODE. */ int creat64 (const char *file, mode_t mode) diff --git a/libc/sysdeps/linux/common/dl-osinfo.h b/libc/sysdeps/linux/common/dl-osinfo.h index b4108cc53..cd791306e 100644 --- a/libc/sysdeps/linux/common/dl-osinfo.h +++ b/libc/sysdeps/linux/common/dl-osinfo.h @@ -7,8 +7,6 @@ #ifndef _DL_OSINFO_H #define _DL_OSINFO_H 1 -#define gettimeofday __gettimeofday - #include #ifdef __UCLIBC_HAS_SSP__ @@ -22,9 +20,14 @@ # include # ifdef IS_IN_libc -# define OPEN __open -# define READ __read -# define CLOSE __close +#include +libc_hidden_proto(open) +libc_hidden_proto(read) +libc_hidden_proto(close) +libc_hidden_proto(gettimeofday) +# define OPEN open +# define READ read +# define CLOSE close # define GETTIMEOFDAY gettimeofday # else # define OPEN _dl_open diff --git a/libc/sysdeps/linux/common/dup2.c b/libc/sysdeps/linux/common/dup2.c index 71164aa0b..c7bd115aa 100644 --- a/libc/sysdeps/linux/common/dup2.c +++ b/libc/sysdeps/linux/common/dup2.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___dup2 __NR_dup2 -attribute_hidden _syscall2(int, __dup2, int, oldfd, int, newfd); -strong_alias(__dup2,dup2) +_syscall2(int, dup2, int, oldfd, int, newfd); +libc_hidden_proto(dup2) +libc_hidden_def(dup2) diff --git a/libc/sysdeps/linux/common/execve.c b/libc/sysdeps/linux/common/execve.c index 8a95746ee..bbc7b1dec 100644 --- a/libc/sysdeps/linux/common/execve.c +++ b/libc/sysdeps/linux/common/execve.c @@ -16,8 +16,9 @@ static inline _syscall3(int, __syscall_execve, const char *, filename, char *const *, argv, char *const *, envp); -int attribute_hidden __execve(const char * filename, char *const * argv, char *const * envp) +int execve(const char * filename, char *const * argv, char *const * envp) { return __syscall_execve(filename, argv, envp); } -strong_alias(__execve,execve) +libc_hidden_proto(execve) +libc_hidden_def(execve) diff --git a/libc/sysdeps/linux/common/fchdir.c b/libc/sysdeps/linux/common/fchdir.c index f4692cc2c..3da6e1d58 100644 --- a/libc/sysdeps/linux/common/fchdir.c +++ b/libc/sysdeps/linux/common/fchdir.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___fchdir __NR_fchdir -attribute_hidden _syscall1(int, __fchdir, int, fd); -strong_alias(__fchdir,fchdir) +_syscall1(int, fchdir, int, fd); +libc_hidden_proto(fchdir) +libc_hidden_def(fchdir) diff --git a/libc/sysdeps/linux/common/fork.c b/libc/sysdeps/linux/common/fork.c index 899cbaf63..23c6fedff 100644 --- a/libc/sysdeps/linux/common/fork.c +++ b/libc/sysdeps/linux/common/fork.c @@ -12,9 +12,10 @@ #ifdef __ARCH_HAS_MMU__ #ifdef __NR_fork -#define __NR___fork __NR_fork -attribute_hidden _syscall0(pid_t, __fork); -strong_alias(__fork,fork) -weak_alias(__fork,__libc_fork) +#define __NR___libc_fork __NR_fork +_syscall0(pid_t, __libc_fork); +strong_alias(__libc_fork,fork) +libc_hidden_proto(fork) +libc_hidden_def(fork) #endif #endif diff --git a/libc/sysdeps/linux/common/fstat.c b/libc/sysdeps/linux/common/fstat.c index af3f9a13b..0a8c81df6 100644 --- a/libc/sysdeps/linux/common/fstat.c +++ b/libc/sysdeps/linux/common/fstat.c @@ -10,7 +10,6 @@ /* need to hide the 64bit prototype or the weak_alias() * will fail when __NR_fstat64 doesnt exist */ #define fstat64 __hidefstat64 -#define __fstat64 __hide__fstat64 #include "syscalls.h" #include @@ -18,14 +17,12 @@ #include "xstatconv.h" #undef fstat64 -#undef __fstat64 #define __NR___syscall_fstat __NR_fstat -#undef __fstat #undef fstat static inline _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf); -int attribute_hidden __fstat(int fd, struct stat *buf) +int fstat(int fd, struct stat *buf) { int result; struct kernel_stat kbuf; @@ -36,9 +33,11 @@ int attribute_hidden __fstat(int fd, struct stat *buf) } return result; } -strong_alias(__fstat,fstat) +libc_hidden_proto(fstat) +libc_hidden_def(fstat) #if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__ -hidden_strong_alias(__fstat,__fstat64) -weak_alias(__fstat,fstat64) +strong_alias(fstat,fstat64) +libc_hidden_proto(fstat64) +libc_hidden_def(fstat64) #endif diff --git a/libc/sysdeps/linux/common/fstat64.c b/libc/sysdeps/linux/common/fstat64.c index 0d8bbdb43..fc91cbaf9 100644 --- a/libc/sysdeps/linux/common/fstat64.c +++ b/libc/sysdeps/linux/common/fstat64.c @@ -18,8 +18,7 @@ static inline _syscall2(int, __syscall_fstat64, int, filedes, struct kernel_stat64 *, buf); -#undef fstat64 -int attribute_hidden __fstat64(int fd, struct stat64 *buf) +int fstat64(int fd, struct stat64 *buf) { int result; struct kernel_stat64 kbuf; @@ -30,6 +29,7 @@ int attribute_hidden __fstat64(int fd, struct stat64 *buf) } return result; } -strong_alias(__fstat64,fstat64) +libc_hidden_proto(fstat64) +libc_hidden_def(fstat64) #endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/fstatfs.c b/libc/sysdeps/linux/common/fstatfs.c index 9a7cf303b..c88162e6d 100644 --- a/libc/sysdeps/linux/common/fstatfs.c +++ b/libc/sysdeps/linux/common/fstatfs.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___fstatfs __NR_fstatfs -attribute_hidden _syscall2(int, __fstatfs, int, fd, struct statfs *, buf); -strong_alias(__fstatfs,fstatfs) +_syscall2(int, fstatfs, int, fd, struct statfs *, buf); +libc_hidden_proto(fstatfs) +libc_hidden_def(fstatfs) diff --git a/libc/sysdeps/linux/common/fsync.c b/libc/sysdeps/linux/common/fsync.c index e6f610751..ab382bd87 100644 --- a/libc/sysdeps/linux/common/fsync.c +++ b/libc/sysdeps/linux/common/fsync.c @@ -12,4 +12,4 @@ #define __NR___libc_fsync __NR_fsync _syscall1(int, __libc_fsync, int, fd); -weak_alias(__libc_fsync, fsync) +strong_alias(__libc_fsync, fsync) diff --git a/libc/sysdeps/linux/common/ftruncate.c b/libc/sysdeps/linux/common/ftruncate.c index a25fd0285..1d4e62d26 100644 --- a/libc/sysdeps/linux/common/ftruncate.c +++ b/libc/sysdeps/linux/common/ftruncate.c @@ -10,4 +10,5 @@ #include "syscalls.h" #include _syscall2(int, ftruncate, int, fd, __off_t, length); -hidden_strong_alias(ftruncate, __ftruncate) +libc_hidden_proto(ftruncate) +libc_hidden_def(ftruncate) diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c index 51392a1aa..5516f3b6f 100644 --- a/libc/sysdeps/linux/common/ftruncate64.c +++ b/libc/sysdeps/linux/common/ftruncate64.c @@ -12,8 +12,6 @@ * the main directory of this archive for more details. */ -#define ftruncate __ftruncate - #include #include #include @@ -65,6 +63,8 @@ int ftruncate64 (int fd, __off64_t length) #else /* __NR_ftruncate64 */ +libc_hidden_proto(ftruncate) + int ftruncate64 (int fd, __off64_t length) { __off_t x = (__off_t) length; diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c index a44647d67..63b195ec2 100644 --- a/libc/sysdeps/linux/common/getcwd.c +++ b/libc/sysdeps/linux/common/getcwd.c @@ -1,8 +1,10 @@ -/* These functions find the absolute path to the current working directory. */ +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ -#define opendir __opendir -#define closedir __closedir -#define readdir __readdir +/* These functions find the absolute path to the current working directory. */ #include #include @@ -11,6 +13,15 @@ #include #include +libc_hidden_proto(strcat) +libc_hidden_proto(strcpy) +libc_hidden_proto(strncpy) +libc_hidden_proto(strlen) +libc_hidden_proto(opendir) +libc_hidden_proto(readdir) +libc_hidden_proto(closedir) +libc_hidden_proto(stat) + #ifdef __NR_getcwd #define __NR___syscall_getcwd __NR_getcwd @@ -43,7 +54,7 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path int slow_search = (sizeof(ino_t) != sizeof(d->d_ino)); #endif - if (__stat(path_buf, &st) < 0) { + if (stat(path_buf, &st) < 0) { goto oops; } #ifdef FAST_DIR_SEARCH_POSSIBLE @@ -51,13 +62,13 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path slow_search = 1; #endif - slen = __strlen(path_buf); + slen = strlen(path_buf); ptr = path_buf + slen - 1; if (*ptr != '/') { if (slen + 2 > path_size) { goto oops; } - __strcpy(++ptr, "/"); + strcpy(++ptr, "/"); slen++; } slen++; @@ -71,11 +82,11 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path #ifdef FAST_DIR_SEARCH_POSSIBLE if (slow_search || this_ino == d->d_ino) { #endif - if (slen + __strlen(d->d_name) > path_size) { + if (slen + strlen(d->d_name) > path_size) { goto oops; } - __strcpy(ptr + 1, d->d_name); - if (__stat(path_buf, &st) < 0) + strcpy(ptr + 1, d->d_name); + if (stat(path_buf, &st) < 0) continue; if (st.st_ino == this_ino && st.st_dev == this_dev) { closedir(dp); @@ -101,7 +112,7 @@ static char *recurser(char *path_buf, int path_size, dev_t root_dev, ino_t root_ dev_t this_dev; ino_t this_ino; - if (__stat(path_buf, &st) < 0) { + if (stat(path_buf, &st) < 0) { if (errno != EFAULT) goto oops; return 0; @@ -112,13 +123,13 @@ static char *recurser(char *path_buf, int path_size, dev_t root_dev, ino_t root_ if (path_size < 2) { goto oops; } - __strcpy(path_buf, "/"); + strcpy(path_buf, "/"); return path_buf; } - if (__strlen(path_buf) + 4 > path_size) { + if (strlen(path_buf) + 4 > path_size) { goto oops; } - __strcat(path_buf, "/.."); + strcat(path_buf, "/.."); if (recurser(path_buf, path_size, root_dev, root_ino) == 0) return 0; @@ -140,16 +151,16 @@ int __syscall_getcwd(char * buf, unsigned long size) len = -1; /* get stat for root to have a valid parameters for the terminating condition */ - if (__stat("/", &st) < 0) { + if (stat("/", &st) < 0) { /* root dir not found! */ return -1; } /* start with actual dir */ - if (buf) __strncpy(buf, ".", size); + if (buf) strncpy(buf, ".", size); cwd = recurser(buf, size, st.st_dev, st.st_ino); if (cwd) { - len = __strlen(buf); + len = strlen(buf); __set_errno(olderrno); } return len; @@ -157,7 +168,7 @@ int __syscall_getcwd(char * buf, unsigned long size) #endif -char attribute_hidden *__getcwd(char *buf, size_t size) +char *getcwd(char *buf, size_t size) { int ret; char *path; @@ -189,4 +200,5 @@ char attribute_hidden *__getcwd(char *buf, size_t size) free (path); return NULL; } -strong_alias(__getcwd,getcwd) +libc_hidden_proto(getcwd) +libc_hidden_def(getcwd) diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index 4db513a62..4b85d2c62 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -28,6 +28,9 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(lseek) + #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif @@ -75,7 +78,7 @@ ssize_t attribute_hidden __getdents (int fd, char *buf, size_t nbytes) /* Our heuristic failed. We read too many entries. Reset the stream. */ assert (last_offset != -1); - __lseek(fd, last_offset, SEEK_SET); + lseek(fd, last_offset, SEEK_SET); if ((char *) dp == buf) { /* The buffer the user passed in is too small to hold even @@ -91,7 +94,7 @@ ssize_t attribute_hidden __getdents (int fd, char *buf, size_t nbytes) dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; - __memcpy (dp->d_name, kdp->d_name, + memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent, d_name)); dp = (struct dirent *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen); diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index f65e9e70b..c734fbbb6 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -29,6 +29,9 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(lseek64) + #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 #ifndef offsetof @@ -80,7 +83,7 @@ ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes) /* Our heuristic failed. We read too many entries. Reset the stream. */ assert (last_offset != -1); - __lseek64(fd, last_offset, SEEK_SET); + lseek64(fd, last_offset, SEEK_SET); if ((char *) dp == buf) { /* The buffer the user passed in is too small to hold even @@ -96,7 +99,7 @@ ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes) dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; - __memcpy (dp->d_name, kdp->d_name, + memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent64, d_name)); dp = (struct dirent64 *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen); diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c index a4285322b..3b470db05 100644 --- a/libc/sysdeps/linux/common/getdirname.c +++ b/libc/sysdeps/linux/common/getdirname.c @@ -17,14 +17,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define getcwd __getcwd - #include #include #include #include #include +libc_hidden_proto(strdup) +libc_hidden_proto(getcwd) +libc_hidden_proto(getenv) +libc_hidden_proto(stat) +libc_hidden_proto(stat64) + /* Return a malloc'd string containing the current directory name. If the environment variable `PWD' is set, and its value is correct, that value is used. */ @@ -39,19 +43,19 @@ get_current_dir_name (void) struct stat dotstat, pwdstat; #endif - pwd = __getenv ("PWD"); + pwd = getenv ("PWD"); if (pwd != NULL #if defined __UCLIBC_HAS_LFS__ - && __stat64 (".", &dotstat) == 0 - && __stat64 (pwd, &pwdstat) == 0 + && stat64 (".", &dotstat) == 0 + && stat64 (pwd, &pwdstat) == 0 #else - && __stat (".", &dotstat) == 0 - && __stat (pwd, &pwdstat) == 0 + && stat (".", &dotstat) == 0 + && stat (pwd, &pwdstat) == 0 #endif && pwdstat.st_dev == dotstat.st_dev && pwdstat.st_ino == dotstat.st_ino) /* The PWD value is correct. Use it. */ - return __strdup (pwd); + return strdup (pwd); return getcwd ((char *) NULL, 0); } diff --git a/libc/sysdeps/linux/common/getdnnm.c b/libc/sysdeps/linux/common/getdnnm.c index aa4215f84..04077b197 100644 --- a/libc/sysdeps/linux/common/getdnnm.c +++ b/libc/sysdeps/linux/common/getdnnm.c @@ -1,4 +1,8 @@ -#define uname __uname +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include #include @@ -7,9 +11,12 @@ #define __USE_GNU #include +libc_hidden_proto(strlen) +libc_hidden_proto(strcpy) +libc_hidden_proto(uname) -int attribute_hidden -__getdomainname(char *name, size_t len) +int +getdomainname(char *name, size_t len) { struct utsname uts; @@ -20,11 +27,12 @@ __getdomainname(char *name, size_t len) if (uname(&uts) == -1) return -1; - if (__strlen(uts.domainname)+1 > len) { + if (strlen(uts.domainname)+1 > len) { __set_errno(EINVAL); return -1; } - __strcpy(name, uts.domainname); + strcpy(name, uts.domainname); return 0; } -strong_alias(__getdomainname,getdomainname) +libc_hidden_proto(getdomainname) +libc_hidden_def(getdomainname) diff --git a/libc/sysdeps/linux/common/getdtablesize.c b/libc/sysdeps/linux/common/getdtablesize.c index de3af63d7..4408273b7 100644 --- a/libc/sysdeps/linux/common/getdtablesize.c +++ b/libc/sysdeps/linux/common/getdtablesize.c @@ -16,18 +16,18 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define getrlimit __getrlimit - #include #include #include #include +libc_hidden_proto(getrlimit) + #define __LOCAL_OPEN_MAX 256 /* Return the maximum number of file descriptors the current process could possibly have. */ -int attribute_hidden __getdtablesize (void) +int getdtablesize (void) { struct rlimit ru; @@ -36,4 +36,5 @@ int attribute_hidden __getdtablesize (void) returns -1. */ return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? __LOCAL_OPEN_MAX : ru.rlim_cur; } -strong_alias(__getdtablesize,getdtablesize) +libc_hidden_proto(getdtablesize) +libc_hidden_def(getdtablesize) diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c index bed60f052..4379ddd0b 100644 --- a/libc/sysdeps/linux/common/getegid.c +++ b/libc/sysdeps/linux/common/getegid.c @@ -7,22 +7,23 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define getgid __getgid - #include "syscalls.h" #include #ifdef __NR_getegid #define __NR___syscall_getegid __NR_getegid static inline _syscall0(int, __syscall_getegid); -gid_t attribute_hidden __getegid(void) +gid_t getegid(void) { return (__syscall_getegid()); } #else -gid_t attribute_hidden __getegid(void) +libc_hidden_proto(getgid) + +gid_t getegid(void) { return (getgid()); } #endif -strong_alias(__getegid,getegid) +libc_hidden_proto(getegid) +libc_hidden_def(getegid) diff --git a/libc/sysdeps/linux/common/geteuid.c b/libc/sysdeps/linux/common/geteuid.c index 3936739b3..c267d1483 100644 --- a/libc/sysdeps/linux/common/geteuid.c +++ b/libc/sysdeps/linux/common/geteuid.c @@ -7,22 +7,23 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define getuid __getuid - #include "syscalls.h" #include #ifdef __NR_geteuid #define __NR___syscall_geteuid __NR_geteuid static inline _syscall0(int, __syscall_geteuid); -uid_t attribute_hidden __geteuid(void) +uid_t geteuid(void) { return (__syscall_geteuid()); } #else -uid_t attribute_hidden __geteuid(void) +libc_hidden_proto(getuid) + +uid_t geteuid(void) { return (getuid()); } #endif -strong_alias(__geteuid,geteuid) +libc_hidden_proto(geteuid) +libc_hidden_def(geteuid) diff --git a/libc/sysdeps/linux/common/getgid.c b/libc/sysdeps/linux/common/getgid.c index eba29afa2..48c9af17c 100644 --- a/libc/sysdeps/linux/common/getgid.c +++ b/libc/sysdeps/linux/common/getgid.c @@ -16,8 +16,9 @@ #endif static inline _syscall0(int, __syscall_getgid); -gid_t attribute_hidden __getgid(void) +gid_t getgid(void) { return (__syscall_getgid()); } -strong_alias(__getgid,getgid) +libc_hidden_proto(getgid) +libc_hidden_def(getgid) diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c index 83d92627e..081f001f1 100644 --- a/libc/sysdeps/linux/common/getgroups.c +++ b/libc/sysdeps/linux/common/getgroups.c @@ -7,20 +7,20 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define sysconf __sysconf - #include "syscalls.h" #include #include #include +libc_hidden_proto(sysconf) + #define MIN(a,b) (((a)<(b))?(a):(b)) #define __NR___syscall_getgroups __NR_getgroups static inline _syscall2(int, __syscall_getgroups, int, size, __kernel_gid_t *, list); -int attribute_hidden __getgroups(int size, gid_t groups[]) +int getgroups(int size, gid_t groups[]) { if (unlikely(size < 0)) { ret_error: @@ -47,4 +47,5 @@ ret_error: return ngids; } } -strong_alias(__getgroups,getgroups) +libc_hidden_proto(getgroups) +libc_hidden_def(getgroups) diff --git a/libc/sysdeps/linux/common/gethstnm.c b/libc/sysdeps/linux/common/gethstnm.c index cb6e5efce..c932d239c 100644 --- a/libc/sysdeps/linux/common/gethstnm.c +++ b/libc/sysdeps/linux/common/gethstnm.c @@ -1,12 +1,20 @@ -#define uname __uname +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include #include #include #include -int attribute_hidden -__gethostname(char *name, size_t len) +libc_hidden_proto(strlen) +libc_hidden_proto(strcpy) +libc_hidden_proto(uname) + +int +gethostname(char *name, size_t len) { struct utsname uts; @@ -17,11 +25,12 @@ __gethostname(char *name, size_t len) if (uname(&uts) == -1) return -1; - if (__strlen(uts.nodename)+1 > len) { + if (strlen(uts.nodename)+1 > len) { __set_errno(EINVAL); return -1; } - __strcpy(name, uts.nodename); + strcpy(name, uts.nodename); return 0; } -strong_alias(__gethostname,gethostname) +libc_hidden_proto(gethostname) +libc_hidden_def(gethostname) diff --git a/libc/sysdeps/linux/common/getpagesize.c b/libc/sysdeps/linux/common/getpagesize.c index 517040d46..44456c0e7 100644 --- a/libc/sysdeps/linux/common/getpagesize.c +++ b/libc/sysdeps/linux/common/getpagesize.c @@ -19,14 +19,16 @@ #include #include #include -extern size_t __pagesize_internal attribute_hidden; + +extern size_t __pagesize; +libc_hidden_proto(__pagesize) /* Return the system page size. */ /* couldn't make __getpagesize hidden, because shm.h uses it in a macro */ -int attribute_hidden __getpagesize_internal(void) +int __getpagesize(void) { - if (__pagesize_internal != 0) - return __pagesize_internal; + if (__pagesize != 0) + return __pagesize; #ifdef EXEC_PAGESIZE return EXEC_PAGESIZE; @@ -41,6 +43,6 @@ int attribute_hidden __getpagesize_internal(void) #endif /* NBPG. */ #endif /* EXEC_PAGESIZE. */ } -strong_alias(__getpagesize_internal, __getpagesize) -weak_alias(__getpagesize_internal, getpagesize) - +strong_alias(__getpagesize,getpagesize) +libc_hidden_proto(getpagesize) +libc_hidden_def(getpagesize) diff --git a/libc/sysdeps/linux/common/getpgid.c b/libc/sysdeps/linux/common/getpgid.c index 8de8516dc..adb8beb06 100644 --- a/libc/sysdeps/linux/common/getpgid.c +++ b/libc/sysdeps/linux/common/getpgid.c @@ -12,8 +12,7 @@ #define __NR___syscall_getpgid __NR_getpgid static inline _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid); -pid_t __getpgid(pid_t pid) +pid_t getpgid(pid_t pid) { return (__syscall_getpgid(pid)); } -weak_alias(__getpgid, getpgid) diff --git a/libc/sysdeps/linux/common/getpid.c b/libc/sysdeps/linux/common/getpid.c index 6a6a9e129..ecb29851e 100644 --- a/libc/sysdeps/linux/common/getpid.c +++ b/libc/sysdeps/linux/common/getpid.c @@ -11,10 +11,10 @@ #include #if defined (__alpha__) -#define __NR___getpid __NR_getxpid +#define __NR_getpid __NR_getxpid #endif -#define __NR___getpid __NR_getpid -attribute_hidden _syscall0(pid_t, __getpid); -strong_alias(__getpid, getpid) -/* not used in libpthread */ -/* weak_alias(__getpid, __libc_getpid) */ +#define __NR___libc_getpid __NR_getpid +_syscall0(pid_t, __libc_getpid); +strong_alias(__libc_getpid, getpid) +libc_hidden_proto(getpid) +libc_hidden_def(getpid) diff --git a/libc/sysdeps/linux/common/getpriority.c b/libc/sysdeps/linux/common/getpriority.c index 3f695402d..bde7a3d85 100644 --- a/libc/sysdeps/linux/common/getpriority.c +++ b/libc/sysdeps/linux/common/getpriority.c @@ -17,7 +17,7 @@ static inline _syscall2(int, __syscall_getpriority, /* The return value of __syscall_getpriority is biased by this value * to avoid returning negative values. */ #define PZERO 20 -int attribute_hidden __getpriority(enum __priority_which which, id_t who) +int getpriority(enum __priority_which which, id_t who) { int res; @@ -26,4 +26,5 @@ int attribute_hidden __getpriority(enum __priority_which which, id_t who) res = PZERO - res; return res; } -strong_alias(__getpriority,getpriority) +libc_hidden_proto(getpriority) +libc_hidden_def(getpriority) diff --git a/libc/sysdeps/linux/common/getrlimit.c b/libc/sysdeps/linux/common/getrlimit.c index fef907a03..804410b34 100644 --- a/libc/sysdeps/linux/common/getrlimit.c +++ b/libc/sysdeps/linux/common/getrlimit.c @@ -16,7 +16,7 @@ static inline _syscall2(int, __ugetrlimit, enum __rlimit_resource, resource, struct rlimit *, rlim); -int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) +int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { return (__ugetrlimit(resource, rlimits)); } @@ -28,7 +28,7 @@ int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rl static inline _syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim); -int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) +int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { int result; @@ -47,4 +47,5 @@ int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rl } #endif -strong_alias(__getrlimit,getrlimit) +libc_hidden_proto(getrlimit) +libc_hidden_def(getrlimit) diff --git a/libc/sysdeps/linux/common/getrlimit64.c b/libc/sysdeps/linux/common/getrlimit64.c index 76c3196ad..6f670c001 100644 --- a/libc/sysdeps/linux/common/getrlimit64.c +++ b/libc/sysdeps/linux/common/getrlimit64.c @@ -16,8 +16,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define getrlimit __getrlimit - #include #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 @@ -36,6 +34,8 @@ #include #include +libc_hidden_proto(getrlimit) + #if defined __UCLIBC_HAS_LFS__ /* Put the soft and hard limits for RESOURCE in *RLIMITS. diff --git a/libc/sysdeps/linux/common/getsid.c b/libc/sysdeps/linux/common/getsid.c index 3e9c2d8ba..91d327098 100644 --- a/libc/sysdeps/linux/common/getsid.c +++ b/libc/sysdeps/linux/common/getsid.c @@ -13,8 +13,9 @@ #define __NR___syscall_getsid __NR_getsid static inline _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid); -pid_t attribute_hidden __getsid(pid_t pid) +pid_t getsid(pid_t pid) { return (__syscall_getsid(pid)); } -strong_alias(__getsid,getsid) +libc_hidden_proto(getsid) +libc_hidden_def(getsid) diff --git a/libc/sysdeps/linux/common/gettimeofday.c b/libc/sysdeps/linux/common/gettimeofday.c index 6c2613f01..175691f89 100644 --- a/libc/sysdeps/linux/common/gettimeofday.c +++ b/libc/sysdeps/linux/common/gettimeofday.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___gettimeofday __NR_gettimeofday -attribute_hidden _syscall2(int, __gettimeofday, struct timeval *, tv, struct timezone *, tz); -strong_alias(__gettimeofday,gettimeofday) +_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz); +libc_hidden_proto(gettimeofday) +libc_hidden_def(gettimeofday) diff --git a/libc/sysdeps/linux/common/getuid.c b/libc/sysdeps/linux/common/getuid.c index 7c81ccf48..610c34edc 100644 --- a/libc/sysdeps/linux/common/getuid.c +++ b/libc/sysdeps/linux/common/getuid.c @@ -17,8 +17,9 @@ static inline _syscall0(int, __syscall_getuid); -uid_t attribute_hidden __getuid(void) +uid_t getuid(void) { return (__syscall_getuid()); } -strong_alias(__getuid,getuid) +libc_hidden_proto(getuid) +libc_hidden_def(getuid) diff --git a/libc/sysdeps/linux/common/ioctl.c b/libc/sysdeps/linux/common/ioctl.c index 29293f359..e9ea707ab 100644 --- a/libc/sysdeps/linux/common/ioctl.c +++ b/libc/sysdeps/linux/common/ioctl.c @@ -11,11 +11,13 @@ #include #include +libc_hidden_proto(ioctl) + #define __NR___syscall_ioctl __NR_ioctl static inline _syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg); -int attribute_hidden __ioctl(int fd, unsigned long int request, ...) +int ioctl(int fd, unsigned long int request, ...) { void *arg; va_list list; @@ -26,4 +28,4 @@ int attribute_hidden __ioctl(int fd, unsigned long int request, ...) va_end(list); return __syscall_ioctl(fd, request, arg); } -strong_alias(__ioctl,ioctl) +libc_hidden_def(ioctl) diff --git a/libc/sysdeps/linux/common/kill.c b/libc/sysdeps/linux/common/kill.c index 2d1d9ae8a..2a6bfce8e 100644 --- a/libc/sysdeps/linux/common/kill.c +++ b/libc/sysdeps/linux/common/kill.c @@ -14,8 +14,9 @@ #define __NR___syscall_kill __NR_kill static inline _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig); -int attribute_hidden __kill(pid_t pid, int sig) +int kill(pid_t pid, int sig) { return (__syscall_kill(pid, sig)); } -strong_alias(__kill,kill) +libc_hidden_proto(kill) +libc_hidden_def(kill) diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c index a2ffd6196..b48641a1a 100644 --- a/libc/sysdeps/linux/common/llseek.c +++ b/libc/sysdeps/linux/common/llseek.c @@ -33,7 +33,6 @@ #include #include -#undef lseek64 #if defined __NR__llseek && defined __UCLIBC_HAS_LFS__ #ifndef INLINE_SYSCALL @@ -43,20 +42,21 @@ static inline _syscall5(int, __syscall_llseek, int, fd, off_t, offset_hi, off_t, offset_lo, loff_t *, result, int, whence); #endif -loff_t attribute_hidden __lseek64(int fd, loff_t offset, int whence) +loff_t __libc_lseek64(int fd, loff_t offset, int whence) { loff_t result; return(loff_t)(INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32), (off_t) (offset & 0xffffffff), &result, whence) ?: result); } #else -extern __off_t __lseek(int fildes, off_t offset, int whence) attribute_hidden; -loff_t __lseek64(int fd, loff_t offset, int whence) +extern __off_t __libc_lseek(int fildes, off_t offset, int whence); +libc_hidden_proto(__libc_lseek) +loff_t __libc_lseek64(int fd, loff_t offset, int whence) { - return(loff_t)(__lseek(fd, (off_t) (offset), whence)); + return(loff_t)(__libc_lseek(fd, (off_t) (offset), whence)); } #endif -strong_alias(__lseek64,lseek64) -//strong_alias(__lseek64,_llseek) -//strong_alias(__lseek64,llseek) -weak_alias(__lseek64,__libc_lseek64) +strong_alias(__libc_lseek64,lseek64) +libc_hidden_proto(lseek64) +libc_hidden_def(lseek64) +//strong_alias(__libc_lseek64,_llseek) diff --git a/libc/sysdeps/linux/common/longjmp.c b/libc/sysdeps/linux/common/longjmp.c index 5b4eff5f5..b2fdde9c9 100644 --- a/libc/sysdeps/linux/common/longjmp.c +++ b/libc/sysdeps/linux/common/longjmp.c @@ -20,9 +20,10 @@ #include #include +libc_hidden_proto(sigprocmask) extern void __longjmp (__jmp_buf __env, int val); - +libc_hidden_proto(__longjmp) /* Set the signal mask to the one specified in ENV, and jump to the position specified in ENV, causing the setjmp @@ -36,14 +37,14 @@ void __libc_longjmp (sigjmp_buf env, int val) if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ - (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, + (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, (sigset_t *) NULL); /* Call the machine-dependent function to restore machine state. */ __longjmp (env[0].__jmpbuf, val ?: 1); } -weak_alias (__libc_longjmp, longjmp) -weak_alias (__libc_longjmp, _longjmp) -weak_alias (__libc_longjmp, siglongjmp) -weak_alias (__libc_longjmp, __libc_siglongjmp) +strong_alias(__libc_longjmp,longjmp) +strong_alias(__libc_longjmp,siglongjmp) +strong_alias(__libc_longjmp,__libc_siglongjmp) +/* weak_alias (__libc_longjmp, _longjmp) */ diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c index 4eb51d322..2ed5e4a14 100644 --- a/libc/sysdeps/linux/common/lseek.c +++ b/libc/sysdeps/linux/common/lseek.c @@ -10,9 +10,11 @@ #include "syscalls.h" #include -#define __NR___lseek __NR_lseek -#undef __lseek -#undef lseek -attribute_hidden _syscall3(__off_t, __lseek, int, fildes, __off_t, offset, int, whence); -strong_alias(__lseek,lseek) -weak_alias(__lseek,__libc_lseek) +#define __NR___libc_lseek __NR_lseek +_syscall3(__off_t, __libc_lseek, int, fildes, __off_t, offset, int, whence); +libc_hidden_proto(__libc_lseek) +libc_hidden_def(__libc_lseek) + +strong_alias(__libc_lseek,lseek) +libc_hidden_proto(lseek) +libc_hidden_def(lseek) diff --git a/libc/sysdeps/linux/common/lstat.c b/libc/sysdeps/linux/common/lstat.c index d7feac273..9509c489d 100644 --- a/libc/sysdeps/linux/common/lstat.c +++ b/libc/sysdeps/linux/common/lstat.c @@ -10,7 +10,6 @@ /* need to hide the 64bit prototype or the weak_alias() * will fail when __NR_lstat64 doesnt exist */ #define lstat64 __hidelstat64 -#define __lstat64 __hide__lstat64 #include "syscalls.h" #include @@ -18,15 +17,13 @@ #include "xstatconv.h" #undef lstat64 -#undef __lstat64 #define __NR___syscall_lstat __NR_lstat -#undef __lstat #undef lstat static inline _syscall2(int, __syscall_lstat, const char *, file_name, struct kernel_stat *, buf); -int attribute_hidden __lstat(const char *file_name, struct stat *buf) +int lstat(const char *file_name, struct stat *buf) { int result; struct kernel_stat kbuf; @@ -37,9 +34,11 @@ int attribute_hidden __lstat(const char *file_name, struct stat *buf) } return result; } -strong_alias(__lstat,lstat) +libc_hidden_proto(lstat) +libc_hidden_def(lstat) #if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__ -hidden_strong_alias(__lstat,__lstat64) -weak_alias(lstat,lstat64) +strong_alias(lstat,lstat64) +libc_hidden_proto(lstat64) +libc_hidden_def(lstat64) #endif diff --git a/libc/sysdeps/linux/common/lstat64.c b/libc/sysdeps/linux/common/lstat64.c index 99b655a0c..b56184f82 100644 --- a/libc/sysdeps/linux/common/lstat64.c +++ b/libc/sysdeps/linux/common/lstat64.c @@ -15,11 +15,10 @@ #include "xstatconv.h" #define __NR___syscall_lstat64 __NR_lstat64 -#undef lstat64 static inline _syscall2(int, __syscall_lstat64, const char *, file_name, struct kernel_stat64 *, buf); -int attribute_hidden __lstat64(const char *file_name, struct stat64 *buf) +int lstat64(const char *file_name, struct stat64 *buf) { int result; struct kernel_stat64 kbuf; @@ -30,6 +29,7 @@ int attribute_hidden __lstat64(const char *file_name, struct stat64 *buf) } return result; } -strong_alias(__lstat64,lstat64) +libc_hidden_proto(lstat64) +libc_hidden_def(lstat64) #endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/mkdir.c b/libc/sysdeps/linux/common/mkdir.c index 5e96cf599..819793f87 100644 --- a/libc/sysdeps/linux/common/mkdir.c +++ b/libc/sysdeps/linux/common/mkdir.c @@ -14,8 +14,9 @@ static inline _syscall2(int, __syscall_mkdir, const char *, pathname, __kernel_mode_t, mode); -int attribute_hidden __mkdir(const char *pathname, mode_t mode) +int mkdir(const char *pathname, mode_t mode) { return (__syscall_mkdir(pathname, mode)); } -strong_alias(__mkdir,mkdir) +libc_hidden_proto(mkdir) +libc_hidden_def(mkdir) diff --git a/libc/sysdeps/linux/common/mkfifo.c b/libc/sysdeps/linux/common/mkfifo.c index db7f8fc42..dddfe8c7b 100644 --- a/libc/sysdeps/linux/common/mkfifo.c +++ b/libc/sysdeps/linux/common/mkfifo.c @@ -20,13 +20,13 @@ by Erik Andersen */ -#define mknod __mknod - #include #include #include #include +libc_hidden_proto(mknod) + /* Create a named pipe (FIFO) named PATH with protections MODE. */ int mkfifo (const char *path, mode_t mode) diff --git a/libc/sysdeps/linux/common/mknod.c b/libc/sysdeps/linux/common/mknod.c index d66747178..f914af5d7 100644 --- a/libc/sysdeps/linux/common/mknod.c +++ b/libc/sysdeps/linux/common/mknod.c @@ -15,7 +15,7 @@ static inline _syscall3(int, __syscall_mknod, const char *, path, __kernel_mode_t, mode, __kernel_dev_t, dev); -int attribute_hidden __mknod(const char *path, mode_t mode, dev_t dev) +int mknod(const char *path, mode_t mode, dev_t dev) { /* We must convert the dev_t value to a __kernel_dev_t */ __kernel_dev_t k_dev; @@ -23,4 +23,5 @@ int attribute_hidden __mknod(const char *path, mode_t mode, dev_t dev) k_dev = ((major(dev) & 0xff) << 8) | (minor(dev) & 0xff); return __syscall_mknod(path, mode, k_dev); } -strong_alias(__mknod,mknod) +libc_hidden_proto(mknod) +libc_hidden_def(mknod) diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c index 3cd3eee4d..eadecfeee 100644 --- a/libc/sysdeps/linux/common/mmap.c +++ b/libc/sysdeps/linux/common/mmap.c @@ -14,7 +14,7 @@ #ifdef __NR_mmap #define __NR__mmap __NR_mmap static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer); -attribute_hidden __ptr_t __mmap(__ptr_t addr, size_t len, int prot, +__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) { unsigned long buffer[6]; @@ -27,5 +27,6 @@ attribute_hidden __ptr_t __mmap(__ptr_t addr, size_t len, int prot, buffer[5] = (unsigned long) offset; return (__ptr_t) _mmap(buffer); } -strong_alias(__mmap,mmap) +libc_hidden_proto(mmap) +libc_hidden_def(mmap) #endif diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c index f0380b1ad..c0bc2b53a 100644 --- a/libc/sysdeps/linux/common/mmap64.c +++ b/libc/sysdeps/linux/common/mmap64.c @@ -19,14 +19,11 @@ /* Massivly hacked up for uClibc by Erik Andersen */ -#define mmap __mmap - #include #include #include #include - #if defined __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 @@ -45,6 +42,8 @@ #if ! defined __NR_mmap2 || ! defined _syscall6 +libc_hidden_proto(mmap) + /* * This version is a stub that just chops off everything at the mmap 32 bit * mmap() address space... You will probably need to add in an arch specific diff --git a/libc/sysdeps/linux/common/modify_ldt.c b/libc/sysdeps/linux/common/modify_ldt.c index 618681ad3..47ed7e350 100644 --- a/libc/sysdeps/linux/common/modify_ldt.c +++ b/libc/sysdeps/linux/common/modify_ldt.c @@ -11,5 +11,5 @@ #ifdef __NR_modify_ldt _syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount); -weak_alias(modify_ldt, __modify_ldt) +/*weak_alias(modify_ldt, __modify_ldt)*/ #endif diff --git a/libc/sysdeps/linux/common/mremap.c b/libc/sysdeps/linux/common/mremap.c index f4a4670d2..16359193b 100644 --- a/libc/sysdeps/linux/common/mremap.c +++ b/libc/sysdeps/linux/common/mremap.c @@ -10,7 +10,7 @@ #include "syscalls.h" #include #include -#define __NR___mremap __NR_mremap -attribute_hidden _syscall4(__ptr_t, __mremap, __ptr_t, old_address, size_t, old_size, size_t, +_syscall4(__ptr_t, mremap, __ptr_t, old_address, size_t, old_size, size_t, new_size, int, may_move); -strong_alias(__mremap,mremap) +libc_hidden_proto(mremap) +libc_hidden_def(mremap) diff --git a/libc/sysdeps/linux/common/msync.c b/libc/sysdeps/linux/common/msync.c index 8de9f346e..044652720 100644 --- a/libc/sysdeps/linux/common/msync.c +++ b/libc/sysdeps/linux/common/msync.c @@ -13,4 +13,4 @@ #define __NR___libc_msync __NR_msync _syscall3(int, __libc_msync, void *, addr, size_t, length, int, flags); -weak_alias(__libc_msync, msync) +strong_alias(__libc_msync,msync) diff --git a/libc/sysdeps/linux/common/munmap.c b/libc/sysdeps/linux/common/munmap.c index be631060a..cd76eb297 100644 --- a/libc/sysdeps/linux/common/munmap.c +++ b/libc/sysdeps/linux/common/munmap.c @@ -10,6 +10,6 @@ #include "syscalls.h" #include #include -#define __NR___munmap __NR_munmap -attribute_hidden _syscall2(int, __munmap, void *, start, size_t, length); -strong_alias(__munmap,munmap) +_syscall2(int, munmap, void *, start, size_t, length); +libc_hidden_proto(munmap) +libc_hidden_def(munmap) diff --git a/libc/sysdeps/linux/common/nanosleep.c b/libc/sysdeps/linux/common/nanosleep.c index 3f5ffbaa3..0032f6623 100644 --- a/libc/sysdeps/linux/common/nanosleep.c +++ b/libc/sysdeps/linux/common/nanosleep.c @@ -13,5 +13,6 @@ #define __NR___libc_nanosleep __NR_nanosleep _syscall2(int, __libc_nanosleep, const struct timespec *, req, struct timespec *, rem); -hidden_weak_alias(__libc_nanosleep,__nanosleep) -weak_alias(__libc_nanosleep,nanosleep) +strong_alias(__libc_nanosleep,nanosleep) +libc_hidden_proto(nanosleep) +libc_hidden_def(nanosleep) diff --git a/libc/sysdeps/linux/common/nice.c b/libc/sysdeps/linux/common/nice.c index 20f7996a7..75e065e65 100644 --- a/libc/sysdeps/linux/common/nice.c +++ b/libc/sysdeps/linux/common/nice.c @@ -8,13 +8,12 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define getpriority __getpriority -#define setpriority __setpriority - #include "syscalls.h" #include #include +libc_hidden_proto(getpriority) + #ifdef __NR_nice #define __NR___syscall_nice __NR_nice @@ -24,6 +23,8 @@ static inline _syscall1(int, __syscall_nice, int, incr); #include +libc_hidden_proto(setpriority) + static inline int int_add_no_wrap(int a, int b) { int s = a + b; diff --git a/libc/sysdeps/linux/common/ntp_gettime.c b/libc/sysdeps/linux/common/ntp_gettime.c index 0c4d1549f..f32e05444 100644 --- a/libc/sysdeps/linux/common/ntp_gettime.c +++ b/libc/sysdeps/linux/common/ntp_gettime.c @@ -16,17 +16,17 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define adjtimex __adjtimex - #include +libc_hidden_proto(adjtimex) + int ntp_gettime(struct ntptimeval *ntv) { struct timex tntx; int result; tntx.modes = 0; - result = __adjtimex(&tntx); + result = adjtimex(&tntx); ntv->time = tntx.time; ntv->maxerror = tntx.maxerror; ntv->esterror = tntx.esterror; diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c index 648f7d053..14cf65750 100644 --- a/libc/sysdeps/linux/common/open.c +++ b/libc/sysdeps/linux/common/open.c @@ -14,13 +14,11 @@ #include #include -#undef __open -#undef open #define __NR___syscall_open __NR_open static inline _syscall3(int, __syscall_open, const char *, file, int, flags, __kernel_mode_t, mode); -int attribute_hidden __open(const char *file, int flags, ...) +int __libc_open(const char *file, int flags, ...) { /* gcc may warn about mode being uninitialized. * Just ignore that, since gcc is wrong. */ @@ -35,10 +33,14 @@ int attribute_hidden __open(const char *file, int flags, ...) } return __syscall_open(file, flags, mode); } -strong_alias(__open,open) -weak_alias(__open,__libc_open) +libc_hidden_proto(__libc_open) +libc_hidden_def(__libc_open) + +strong_alias(__libc_open,open) +libc_hidden_proto(open) +libc_hidden_def(open) int creat(const char *file, mode_t mode) { - return __open(file, O_WRONLY | O_CREAT | O_TRUNC, mode); + return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode); } diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index f577d9507..fbe99b0d9 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -26,10 +26,12 @@ #endif #ifdef __UCLIBC_HAS_LFS__ +extern int __libc_open (__const char *__file, int __oflag, ...) __nonnull ((1)); +libc_hidden_proto(__libc_open) + /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ -#undef open64 -int attribute_hidden __open64 (const char *file, int oflag, ...) +int __libc_open64 (const char *file, int oflag, ...) { int mode = 0; @@ -41,8 +43,10 @@ int attribute_hidden __open64 (const char *file, int oflag, ...) va_end (arg); } - return __open(file, oflag | O_LARGEFILE, mode); + return __libc_open(file, oflag | O_LARGEFILE, mode); } -strong_alias(__open64,open64) -weak_alias(__open64,__libc_open64) + +strong_alias(__libc_open64,open64) +libc_hidden_proto(open64) +libc_hidden_def(open64) #endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c index a017ef611..1028a7a63 100644 --- a/libc/sysdeps/linux/common/pause.c +++ b/libc/sysdeps/linux/common/pause.c @@ -7,9 +7,6 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define __sigpause __sigpause_internal -#define sigblock __sigblock - #include "syscalls.h" #include @@ -18,9 +15,12 @@ _syscall0(int, __libc_pause); #else #include +libc_hidden_proto(__sigpause) +libc_hidden_proto(sigblock) + int __libc_pause(void) { return (__sigpause(sigblock(0), 0)); } #endif -weak_alias(__libc_pause, pause) +strong_alias(__libc_pause,pause) diff --git a/libc/sysdeps/linux/common/pipe.c b/libc/sysdeps/linux/common/pipe.c index 2045b8d64..93d52b88f 100644 --- a/libc/sysdeps/linux/common/pipe.c +++ b/libc/sysdeps/linux/common/pipe.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___pipe __NR_pipe -attribute_hidden _syscall1(int, __pipe, int *, filedes); -strong_alias(__pipe,pipe) +_syscall1(int, pipe, int *, filedes); +libc_hidden_proto(pipe) +libc_hidden_def(pipe) diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c index c957f1edf..c76df966f 100644 --- a/libc/sysdeps/linux/common/poll.c +++ b/libc/sysdeps/linux/common/poll.c @@ -17,15 +17,11 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define getdtablesize __getdtablesize -#define select __select - #include "syscalls.h" #include #ifdef __NR_poll -#define __NR___poll __NR_poll -attribute_hidden _syscall3(int, __poll, struct pollfd *, fds, +_syscall3(int, poll, struct pollfd *, fds, unsigned long int, nfds, int, timeout); #else @@ -37,6 +33,11 @@ attribute_hidden _syscall3(int, __poll, struct pollfd *, fds, #include #include +libc_hidden_proto(memcpy) +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 @@ -45,7 +46,7 @@ attribute_hidden _syscall3(int, __poll, struct pollfd *, fds, Returns the number of file descriptors with events, zero if timed out, or -1 for errors. */ -int attribute_hidden __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; @@ -65,9 +66,9 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout) /* We can't call FD_ZERO, since FD_ZERO only works with sets of exactly __FD_SETSIZE size. */ - __memset (rset, 0, bytes