diff options
Diffstat (limited to 'libc/sysdeps/linux/common')
197 files changed, 515 insertions, 415 deletions
diff --git a/libc/sysdeps/linux/common/__socketcall.c b/libc/sysdeps/linux/common/__socketcall.c index 5a959a63c..e49fb21bc 100644 --- a/libc/sysdeps/linux/common/__socketcall.c +++ b/libc/sysdeps/linux/common/__socketcall.c @@ -11,5 +11,5 @@ #ifdef __NR_socketcall #define __NR___socketcall __NR_socketcall int __socketcall(int __call, unsigned long *__args) attribute_hidden; -_syscall2(int, __socketcall, int, call, unsigned long *, args); +_syscall2(int, __socketcall, int, call, unsigned long *, args) #endif diff --git a/libc/sysdeps/linux/common/__syscall_fcntl64.c b/libc/sysdeps/linux/common/__syscall_fcntl64.c index 84c2ea2bf..cd5c59bd2 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl64.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl64.c @@ -16,7 +16,7 @@ extern __typeof(fcntl64) __libc_fcntl64; libc_hidden_proto(__libc_fcntl64) #define __NR___syscall_fcntl64 __NR_fcntl64 -static __inline__ _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg); +static __inline__ _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg) int __libc_fcntl64(int fd, int cmd, ...) { long arg; @@ -30,7 +30,7 @@ int __libc_fcntl64(int fd, int cmd, ...) } libc_hidden_def(__libc_fcntl64) -libc_hidden_proto(fcntl64) +/* libc_hidden_proto(fcntl64) */ strong_alias(__libc_fcntl64,fcntl64) libc_hidden_weak(fcntl64) #endif diff --git a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c b/libc/sysdeps/linux/common/__syscall_rt_sigaction.c index 981bb19b0..0f5329cfb 100644 --- a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c +++ b/libc/sysdeps/linux/common/__syscall_rt_sigaction.c @@ -16,5 +16,5 @@ #define __NR___syscall_rt_sigaction __NR_rt_sigaction _syscall4(int, __syscall_rt_sigaction, int, signum, const struct kernel_sigaction *, act, struct kernel_sigaction *, oldact, - size_t, size); + size_t, size) #endif diff --git a/libc/sysdeps/linux/common/__syscall_sigaction.c b/libc/sysdeps/linux/common/__syscall_sigaction.c index c39b49d00..ae0f01e9e 100644 --- a/libc/sysdeps/linux/common/__syscall_sigaction.c +++ b/libc/sysdeps/linux/common/__syscall_sigaction.c @@ -14,6 +14,6 @@ #include <signal.h> int __syscall_sigaction (int __signum, const struct sigaction *__act, struct sigaction *__oldact) attribute_hidden; _syscall3(int, __syscall_sigaction, int, signum, const struct sigaction *, - act, struct sigaction *, oldact); + act, struct sigaction *, oldact) #endif diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c index 7592e9b45..a0b891d25 100644 --- a/libc/sysdeps/linux/common/_exit.c +++ b/libc/sysdeps/linux/common/_exit.c @@ -2,8 +2,7 @@ /* * exit syscall for uClibc * - * Copyright (C) 2006 by Steven J. Hill <sjhill@realitydiluted.com> - * Copyright (C) 2002-2006 by Erik Andersen <andersen@codepoet.org> + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ @@ -17,12 +16,12 @@ #include <sysdep.h> #endif -libc_hidden_proto(_exit) +/* libc_hidden_proto(_exit) */ #ifndef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) __syscall_exit (args) #define __NR___syscall_exit __NR_exit -static __inline__ _syscall1(void, __syscall_exit, int, status); +static __inline__ _syscall1(void, __syscall_exit, int, status) #endif void attribute_noreturn _exit(int status) diff --git a/libc/sysdeps/linux/common/access.c b/libc/sysdeps/linux/common/access.c index 85533bde6..a075d421a 100644 --- a/libc/sysdeps/linux/common/access.c +++ b/libc/sysdeps/linux/common/access.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <unistd.h> -_syscall2(int, access, const char *, pathname, int, mode); +_syscall2(int, access, const char *, pathname, int, mode) diff --git a/libc/sysdeps/linux/common/acct.c b/libc/sysdeps/linux/common/acct.c index 74156d4de..e0a43200c 100644 --- a/libc/sysdeps/linux/common/acct.c +++ b/libc/sysdeps/linux/common/acct.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <unistd.h> #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98) -_syscall1(int, acct, const char *, filename); +_syscall1(int, acct, const char *, filename) #endif diff --git a/libc/sysdeps/linux/common/adjtimex.c b/libc/sysdeps/linux/common/adjtimex.c index 280f90e5a..725c82994 100644 --- a/libc/sysdeps/linux/common/adjtimex.c +++ b/libc/sysdeps/linux/common/adjtimex.c @@ -10,9 +10,9 @@ #include <sys/syscall.h> #include <sys/timex.h> -libc_hidden_proto(adjtimex) +/* libc_hidden_proto(adjtimex) */ -_syscall1(int, adjtimex, struct timex *, buf); +_syscall1(int, adjtimex, struct timex *, buf) libc_hidden_def(adjtimex) #if defined __UCLIBC_NTP_LEGACY__ strong_alias(adjtimex,ntp_adjtime) diff --git a/libc/sysdeps/linux/common/alarm.c b/libc/sysdeps/linux/common/alarm.c index 8b499861c..6042ad270 100644 --- a/libc/sysdeps/linux/common/alarm.c +++ b/libc/sysdeps/linux/common/alarm.c @@ -10,15 +10,15 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(alarm) +/* libc_hidden_proto(alarm) */ #ifdef __NR_alarm #define __NR___alarm __NR_alarm -_syscall1(unsigned int, alarm, unsigned int, seconds); +_syscall1(unsigned int, alarm, unsigned int, seconds) #else #include <sys/time.h> -libc_hidden_proto(setitimer) +/* libc_hidden_proto(setitimer) */ unsigned int alarm(unsigned int seconds) { diff --git a/libc/sysdeps/linux/common/arch_prctl.c b/libc/sysdeps/linux/common/arch_prctl.c index 6d9927a01..5816f5394 100644 --- a/libc/sysdeps/linux/common/arch_prctl.c +++ b/libc/sysdeps/linux/common/arch_prctl.c @@ -11,5 +11,5 @@ #ifdef __NR_arch_prctl extern int arch_prctl(int code, unsigned long addr); -_syscall2(int, arch_prctl, int, code, unsigned long, addr); +_syscall2(int, arch_prctl, int, code, unsigned long, addr) #endif diff --git a/libc/sysdeps/linux/common/bdflush.c b/libc/sysdeps/linux/common/bdflush.c index 6cf007759..687a8f9a7 100644 --- a/libc/sysdeps/linux/common/bdflush.c +++ b/libc/sysdeps/linux/common/bdflush.c @@ -11,7 +11,7 @@ #include <sys/kdaemon.h> #ifdef __NR_bdflush -_syscall2(int, bdflush, int, __func, long int, __data); +_syscall2(int, bdflush, int, __func, long int, __data) #else int bdflush(int __func, long int __data) { diff --git a/libc/sysdeps/linux/common/bits/errno.h b/libc/sysdeps/linux/common/bits/errno.h index a5ac1a47f..92227fe73 100644 --- a/libc/sysdeps/linux/common/bits/errno.h +++ b/libc/sysdeps/linux/common/bits/errno.h @@ -41,6 +41,7 @@ # ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); +libc_hidden_proto(__errno_location) # ifdef __UCLIBC_HAS_THREADS__ /* When using threads, errno is a per-thread value. */ diff --git a/libc/sysdeps/linux/common/bits/getopt.h b/libc/sysdeps/linux/common/bits/getopt.h index a28d0a40b..0307757a6 100644 --- a/libc/sysdeps/linux/common/bits/getopt.h +++ b/libc/sysdeps/linux/common/bits/getopt.h @@ -153,8 +153,10 @@ struct option errors, only prototype getopt for the GNU C library. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; +libc_hidden_proto(getopt) #else /* not __GNU_LIBRARY__ */ extern int getopt (); +libc_hidden_proto(getopt) #endif /* __GNU_LIBRARY__ */ #if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__ diff --git a/libc/sysdeps/linux/common/bits/sigset.h b/libc/sysdeps/linux/common/bits/sigset.h index 7ccadda45..9a16e5cb9 100644 --- a/libc/sysdeps/linux/common/bits/sigset.h +++ b/libc/sysdeps/linux/common/bits/sigset.h @@ -101,8 +101,11 @@ typedef struct checking is done in the non __ versions. */ extern int __sigismember (__const __sigset_t *, int); +libc_hidden_proto(__sigismember) extern int __sigaddset (__sigset_t *, int); +libc_hidden_proto(__sigaddset) extern int __sigdelset (__sigset_t *, int); +libc_hidden_proto(__sigdelset) # ifdef __USE_EXTERN_INLINES # define __SIGSETFN(NAME, BODY, CONST) \ diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h index 2f3dc797b..ac5a4336b 100644 --- a/libc/sysdeps/linux/common/bits/socket.h +++ b/libc/sysdeps/linux/common/bits/socket.h @@ -269,6 +269,7 @@ struct cmsghdr extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW; +libc_hidden_proto(__cmsg_nxthdr) #ifdef __USE_EXTERN_INLINES # ifndef _EXTERN_INLINE # define _EXTERN_INLINE extern __inline @@ -314,7 +315,13 @@ struct ucred }; /* Get socket manipulation related informations from kernel headers. */ +#ifndef __GLIBC__ +#define __GLIBC__ 2 #include <asm/socket.h> +#undef __GLIBC__ +#else +#include <asm/socket.h> +#endif /* Structure used to manipulate the SO_LINGER option. */ diff --git a/libc/sysdeps/linux/common/bits/uClibc_errno.h b/libc/sysdeps/linux/common/bits/uClibc_errno.h index 631e10c50..9c1561841 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_errno.h +++ b/libc/sysdeps/linux/common/bits/uClibc_errno.h @@ -9,7 +9,7 @@ #ifdef IS_IN_rtld # undef errno # define errno _dl_errno -extern int _dl_errno; // attribute_hidden; +extern int _dl_errno; /* attribute_hidden; */ #elif defined __UCLIBC_HAS_THREADS__ # include <tls.h> # if defined USE___THREAD && USE___THREAD diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h index 0af2d5db5..a8cf4eb56 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h +++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h @@ -390,7 +390,9 @@ extern void __stdio_init_mutex(__UCLIBC_MUTEX_TYPE *m) attribute_hidden; #endif extern int __fgetc_unlocked(FILE *__stream); +libc_hidden_proto(__fgetc_unlocked) extern int __fputc_unlocked(int __c, FILE *__stream); +libc_hidden_proto(__fputc_unlocked) /* First define the default definitions. They are overridden below as necessary. */ diff --git a/libc/sysdeps/linux/common/capget.c b/libc/sysdeps/linux/common/capget.c index c8c83249c..361de845d 100644 --- a/libc/sysdeps/linux/common/capget.c +++ b/libc/sysdeps/linux/common/capget.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> int capget(void *header, void *data); #ifdef __NR_capget -_syscall2(int, capget, void *, header, void *, data); +_syscall2(int, capget, void *, header, void *, data) #else int capget(void *header, void *data) { diff --git a/libc/sysdeps/linux/common/capset.c b/libc/sysdeps/linux/common/capset.c index 7a28b0e16..f8936285e 100644 --- a/libc/sysdeps/linux/common/capset.c +++ b/libc/sysdeps/linux/common/capset.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> int capset(void *header, const void *data); #ifdef __NR_capset -_syscall2(int, capset, void *, header, const void *, data); +_syscall2(int, capset, void *, header, const void *, data) #else int capset(void *header, const void *data) { diff --git a/libc/sysdeps/linux/common/chdir.c b/libc/sysdeps/linux/common/chdir.c index 95a825eb7..05441eb82 100644 --- a/libc/sysdeps/linux/common/chdir.c +++ b/libc/sysdeps/linux/common/chdir.c @@ -12,10 +12,10 @@ #include <unistd.h> #include <sys/param.h> -libc_hidden_proto(chdir) +/* libc_hidden_proto(chdir) */ #define __NR___syscall_chdir __NR_chdir -static __inline__ _syscall1(int, __syscall_chdir, const char *, path); +static __inline__ _syscall1(int, __syscall_chdir, const char *, path) int chdir(const char *path) { return __syscall_chdir(path); diff --git a/libc/sysdeps/linux/common/chmod.c b/libc/sysdeps/linux/common/chmod.c index 34a30a4b0..a4524ba1f 100644 --- a/libc/sysdeps/linux/common/chmod.c +++ b/libc/sysdeps/linux/common/chmod.c @@ -10,10 +10,10 @@ #include <sys/syscall.h> #include <sys/stat.h> -libc_hidden_proto(chmod) +/* libc_hidden_proto(chmod) */ #define __NR___syscall_chmod __NR_chmod -static __inline__ _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode); +static __inline__ _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode) int chmod(const char *path, mode_t mode) { diff --git a/libc/sysdeps/linux/common/chown.c b/libc/sysdeps/linux/common/chown.c index 27b89a3f4..2e7784a0c 100644 --- a/libc/sysdeps/linux/common/chown.c +++ b/libc/sysdeps/linux/common/chown.c @@ -11,7 +11,7 @@ #include <unistd.h> #include <bits/wordsize.h> -libc_hidden_proto(chown) +/* libc_hidden_proto(chown) */ #if (__WORDSIZE == 32 && defined(__NR_chown32)) || __WORDSIZE == 64 # ifdef __NR_chown32 @@ -19,13 +19,13 @@ libc_hidden_proto(chown) # define __NR_chown __NR_chown32 # endif -_syscall3(int, chown, const char *, path, uid_t, owner, gid_t, group); +_syscall3(int, chown, const char *, path, uid_t, owner, gid_t, group) #else # define __NR___syscall_chown __NR_chown static __inline__ _syscall3(int, __syscall_chown, const char *, path, - __kernel_uid_t, owner, __kernel_gid_t, group); + __kernel_uid_t, owner, __kernel_gid_t, group) int chown(const char *path, uid_t owner, gid_t group) { diff --git a/libc/sysdeps/linux/common/chroot.c b/libc/sysdeps/linux/common/chroot.c index 12d09bbbe..4c085f215 100644 --- a/libc/sysdeps/linux/common/chroot.c +++ b/libc/sysdeps/linux/common/chroot.c @@ -14,7 +14,7 @@ #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K) #define __NR___syscall_chroot __NR_chroot -static __inline__ _syscall1(int, __syscall_chroot, const char *, path); +static __inline__ _syscall1(int, __syscall_chroot, const char *, path) int chroot(const char *path) { diff --git a/libc/sysdeps/linux/common/clock_getres.c b/libc/sysdeps/linux/common/clock_getres.c index 0a3e1d16f..4964ec57c 100644 --- a/libc/sysdeps/linux/common/clock_getres.c +++ b/libc/sysdeps/linux/common/clock_getres.c @@ -12,9 +12,9 @@ #include <unistd.h> #ifdef __NR_clock_getres -_syscall2(int, clock_getres, clockid_t, clock_id, struct timespec*, res); +_syscall2(int, clock_getres, clockid_t, clock_id, struct timespec*, res) #else -libc_hidden_proto(sysconf) +/* libc_hidden_proto(sysconf) */ int clock_getres(clockid_t clock_id, struct timespec* res) { @@ -41,3 +41,4 @@ int clock_getres(clockid_t clock_id, struct timespec* res) return retval; } #endif +libc_hidden_def(clock_getres) diff --git a/libc/sysdeps/linux/common/clock_gettime.c b/libc/sysdeps/linux/common/clock_gettime.c index 38f7ab7ba..f1db8ad7c 100644 --- a/libc/sysdeps/linux/common/clock_gettime.c +++ b/libc/sysdeps/linux/common/clock_gettime.c @@ -13,9 +13,9 @@ #include <sys/time.h> #ifdef __NR_clock_gettime -_syscall2(int, clock_gettime, clockid_t, clock_id, struct timespec*, tp); +_syscall2(int, clock_gettime, clockid_t, clock_id, struct timespec*, tp) #else -libc_hidden_proto(gettimeofday) +/* libc_hidden_proto(gettimeofday) */ int clock_gettime(clockid_t clock_id, struct timespec* tp) { diff --git a/libc/sysdeps/linux/common/clock_settime.c b/libc/sysdeps/linux/common/clock_settime.c index 8ebec7381..f11088a37 100644 --- a/libc/sysdeps/linux/common/clock_settime.c +++ b/libc/sysdeps/linux/common/clock_settime.c @@ -12,9 +12,9 @@ #include <sys/time.h> #ifdef __NR_clock_settime -_syscall2(int, clock_settime, clockid_t, clock_id, const struct timespec*, tp); +_syscall2(int, clock_settime, clockid_t, clock_id, const struct timespec*, tp) #else -libc_hidden_proto(settimeofday) +/* libc_hidden_proto(settimeofday) */ int clock_settime(clockid_t clock_id, const struct timespec* tp) { diff --git a/libc/sysdeps/linux/common/cmsg_nxthdr.c b/libc/sysdeps/linux/common/cmsg_nxthdr.c index 8350c3a4d..7dbf7bec5 100644 --- a/libc/sysdeps/linux/common/cmsg_nxthdr.c +++ b/libc/sysdeps/linux/common/cmsg_nxthdr.c @@ -21,7 +21,7 @@ #include <features.h> #include <sys/socket.h> -libc_hidden_proto(__cmsg_nxthdr) +/* libc_hidden_proto(__cmsg_nxthdr) */ struct cmsghdr * __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg) diff --git a/libc/sysdeps/linux/common/creat64.c b/libc/sysdeps/linux/common/creat64.c index f5f00182c..6fa010545 100644 --- a/libc/sysdeps/linux/common/creat64.c +++ b/libc/sysdeps/linux/common/creat64.c @@ -24,6 +24,7 @@ extern __typeof(open64) __libc_open64; libc_hidden_proto(__libc_open64) + extern __typeof(creat64) __libc_creat64; /* Create FILE with protections MODE. */ diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c index 95ff900e0..d8f24466d 100644 --- a/libc/sysdeps/linux/common/create_module.c +++ b/libc/sysdeps/linux/common/create_module.c @@ -19,7 +19,7 @@ unsigned long create_module(const char *name, size_t size); #if defined(__UCLIBC_BROKEN_CREATE_MODULE__) # define __NR___create_module __NR_create_module -static __inline__ _syscall2(long, __create_module, const char *, name, size_t, size); +static __inline__ _syscall2(long, __create_module, const char *, name, size_t, size) /* By checking the value of errno, we know if we have been fooled * by the syscall2 macro making a very high address look like a * negative, so we we fix it up here. */ @@ -39,14 +39,14 @@ unsigned long create_module(const char *name, size_t size) /* Alpha doesn't have the same problem, exactly, but a bug in older kernels fails to clear the error flag. Clear it here explicitly. */ static __inline__ _syscall4(unsigned long, __create_module, const char *, name, - size_t, size, size_t, dummy, size_t, err); + size_t, size, size_t, dummy, size_t, err) unsigned long create_module(const char *name, size_t size) { return __create_module(name, size, 0, 0); } #else /* Sparc, MIPS, etc don't mistake return values for errors. */ -_syscall2(unsigned long, create_module, const char *, name, size_t, size); +_syscall2(unsigned long, create_module, const char *, name, size_t, size) #endif #else /* !__NR_create_module */ diff --git a/libc/sysdeps/linux/common/delete_module.c b/libc/sysdeps/linux/common/delete_module.c index a93921411..44f9b30ae 100644 --- a/libc/sysdeps/linux/common/delete_module.c +++ b/libc/sysdeps/linux/common/delete_module.c @@ -7,11 +7,11 @@ */ #include <sys/syscall.h> -int delete_module(const char *name); +int delete_module(const char *name, unsigned int flags); #ifdef __NR_delete_module -_syscall1(int, delete_module, const char *, name); -#else -int delete_module(const char *name) +_syscall2(int, delete_module, const char *, name, unsigned int, flags) +#elif defined __UCLIBC_HAS_STUBS__ +int delete_module(const char *name, unsigned int flags) { __set_errno(ENOSYS); return -1; diff --git a/libc/sysdeps/linux/common/dl-osinfo.h b/libc/sysdeps/linux/common/dl-osinfo.h index a038ea31e..195c64803 100644 --- a/libc/sysdeps/linux/common/dl-osinfo.h +++ b/libc/sysdeps/linux/common/dl-osinfo.h @@ -21,10 +21,10 @@ # ifdef IS_IN_libc #include <fcntl.h> -libc_hidden_proto(open) -libc_hidden_proto(read) +/* libc_hidden_proto(open) */ +/* libc_hidden_proto(read) */ /* libc_hidden_proto(close) */ -libc_hidden_proto(gettimeofday) +/* libc_hidden_proto(gettimeofday) */ # define OPEN open # define READ read # define CLOSE close diff --git a/libc/sysdeps/linux/common/dup.c b/libc/sysdeps/linux/common/dup.c index ea7f7d0b1..d35176673 100644 --- a/libc/sysdeps/linux/common/dup.c +++ b/libc/sysdeps/linux/common/dup.c @@ -8,4 +8,4 @@ #include <sys/syscall.h> #include <unistd.h> -_syscall1(int, dup, int, oldfd); +_syscall1(int, dup, int, oldfd) diff --git a/libc/sysdeps/linux/common/dup2.c b/libc/sysdeps/linux/common/dup2.c index 16bcc4221..2a315fed4 100644 --- a/libc/sysdeps/linux/common/dup2.c +++ b/libc/sysdeps/linux/common/dup2.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(dup2) +/* libc_hidden_proto(dup2) */ -_syscall2(int, dup2, int, oldfd, int, newfd); +_syscall2(int, dup2, int, oldfd, int, newfd) libc_hidden_def(dup2) diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c index 27f5a7d61..86272d9aa 100644 --- a/libc/sysdeps/linux/common/epoll.c +++ b/libc/sysdeps/linux/common/epoll.c @@ -14,7 +14,7 @@ * epoll_create() */ #ifdef __NR_epoll_create -_syscall1(int, epoll_create, int, size); +_syscall1(int, epoll_create, int, size) #else int epoll_create(int size) { @@ -27,7 +27,7 @@ int epoll_create(int size) * epoll_ctl() */ #ifdef __NR_epoll_ctl -_syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event); +_syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event) #else int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) { @@ -40,7 +40,7 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) * epoll_wait() */ #ifdef __NR_epoll_wait -_syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout); +_syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout) #else int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout) { diff --git a/libc/sysdeps/linux/common/execve.c b/libc/sysdeps/linux/common/execve.c index 6bc72dde9..53efd78fb 100644 --- a/libc/sysdeps/linux/common/execve.c +++ b/libc/sysdeps/linux/common/execve.c @@ -12,7 +12,7 @@ #include <string.h> #include <sys/param.h> -libc_hidden_proto(execve) +/* libc_hidden_proto(execve) */ _syscall3(int, execve, const char *, filename, - char *const *, argv, char *const *, envp); + char *const *, argv, char *const *, envp) libc_hidden_def(execve) diff --git a/libc/sysdeps/linux/common/fchdir.c b/libc/sysdeps/linux/common/fchdir.c index 15c7dbd73..45236f177 100644 --- a/libc/sysdeps/linux/common/fchdir.c +++ b/libc/sysdeps/linux/common/fchdir.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(fchdir) +/* libc_hidden_proto(fchdir) */ -_syscall1(int, fchdir, int, fd); +_syscall1(int, fchdir, int, fd) libc_hidden_def(fchdir) diff --git a/libc/sysdeps/linux/common/fchmod.c b/libc/sysdeps/linux/common/fchmod.c index cb0058133..791f530b6 100644 --- a/libc/sysdeps/linux/common/fchmod.c +++ b/libc/sysdeps/linux/common/fchmod.c @@ -12,7 +12,7 @@ #define __NR___syscall_fchmod __NR_fchmod static __inline__ _syscall2(int, __syscall_fchmod, - int, fildes, __kernel_mode_t, mode); + int, fildes, __kernel_mode_t, mode) int fchmod(int fildes, mode_t mode) { diff --git a/libc/sysdeps/linux/common/fchown.c b/libc/sysdeps/linux/common/fchown.c index 31111ca54..61618dcff 100644 --- a/libc/sysdeps/linux/common/fchown.c +++ b/libc/sysdeps/linux/common/fchown.c @@ -17,13 +17,13 @@ # define __NR_fchown __NR_fchown32 # endif -_syscall3(int, fchown, int, fd, uid_t, owner, gid_t, group); +_syscall3(int, fchown, int, fd, uid_t, owner, gid_t, group) #else # define __NR___syscall_fchown __NR_fchown static __inline__ _syscall3(int, __syscall_fchown, int, fd, - __kernel_uid_t, owner, __kernel_gid_t, group); + __kernel_uid_t, owner, __kernel_gid_t, group) int fchown(int fd, uid_t owner, gid_t group) { diff --git a/libc/sysdeps/linux/common/fdatasync.c b/libc/sysdeps/linux/common/fdatasync.c index 774433f17..07433bc77 100644 --- a/libc/sysdeps/linux/common/fdatasync.c +++ b/libc/sysdeps/linux/common/fdatasync.c @@ -14,4 +14,4 @@ # define __NR_fdatasync __NR_osf_fdatasync #endif -_syscall1(int, fdatasync, int, fd); +_syscall1(int, fdatasync, int, fd) diff --git a/libc/sysdeps/linux/common/flock.c b/libc/sysdeps/linux/common/flock.c index 9b275d031..3dcd1aee1 100644 --- a/libc/sysdeps/linux/common/flock.c +++ b/libc/sysdeps/linux/common/flock.c @@ -11,7 +11,7 @@ #include <sys/file.h> #define __NR___syscall_flock __NR_flock -static __inline__ _syscall2(int, __syscall_flock, int, fd, int, operation); +static __inline__ _syscall2(int, __syscall_flock, int, fd, int, operation) int flock(int fd, int operation) { diff --git a/libc/sysdeps/linux/common/fork.c b/libc/sysdeps/linux/common/fork.c index b4fa3686d..5993387f0 100644 --- a/libc/sysdeps/linux/common/fork.c +++ b/libc/sysdeps/linux/common/fork.c @@ -15,8 +15,8 @@ #ifdef __NR_fork extern __typeof(fork) __libc_fork; #define __NR___libc_fork __NR_fork -_syscall0(pid_t, __libc_fork); -libc_hidden_proto(fork) +_syscall0(pid_t, __libc_fork) +/* libc_hidden_proto(fork) */ weak_alias(__libc_fork,fork) libc_hidden_weak(fork) #endif @@ -28,7 +28,7 @@ pid_t __libc_fork(void) __set_errno(ENOSYS); return -1; } -libc_hidden_proto(fork) +/* libc_hidden_proto(fork) */ weak_alias(__libc_fork,fork) libc_hidden_weak(fork) link_warning(fork, "fork: this function is not implemented on no-mmu systems") diff --git a/libc/sysdeps/linux/common/fstat.c b/libc/sysdeps/linux/common/fstat.c index fee750aa4..6d5cf8b9f 100644 --- a/libc/sysdeps/linux/common/fstat.c +++ b/libc/sysdeps/linux/common/fstat.c @@ -18,10 +18,10 @@ #undef fstat64 -libc_hidden_proto(fstat) +/* libc_hidden_proto(fstat) */ #define __NR___syscall_fstat __NR_fstat -static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf); +static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf) int fstat(int fd, struct stat *buf) { @@ -38,7 +38,7 @@ libc_hidden_def(fstat) #if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__ extern __typeof(fstat) fstat64; -libc_hidden_proto(fstat64) +/* libc_hidden_proto(fstat64) */ strong_alias(fstat,fstat64) libc_hidden_def(fstat64) #endif diff --git a/libc/sysdeps/linux/common/fstat64.c b/libc/sysdeps/linux/common/fstat64.c index 67c519a8b..a57b4f6f5 100644 --- a/libc/sysdeps/linux/common/fstat64.c +++ b/libc/sysdeps/linux/common/fstat64.c @@ -14,11 +14,11 @@ #include <sys/stat.h> #include "xstatconv.h" -libc_hidden_proto(fstat64) +/* libc_hidden_proto(fstat64) */ #define __NR___syscall_fstat64 __NR_fstat64 static __inline__ _syscall2(int, __syscall_fstat64, - int, filedes, struct kernel_stat64 *, buf); + int, filedes, struct kernel_stat64 *, buf) int fstat64(int fd, struct stat64 *buf) { diff --git a/libc/sysdeps/linux/common/fstatfs.c b/libc/sysdeps/linux/common/fstatfs.c index 8a471d36f..fa0024ad8 100644 --- a/libc/sysdeps/linux/common/fstatfs.c +++ b/libc/sysdeps/linux/common/fstatfs.c @@ -22,14 +22,10 @@ extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf), # endif #endif -extern __typeof(fstatfs) __libc_fstatfs; -libc_hidden_proto(__libc_fstatfs) +extern __typeof(fstatfs) __libc_fstatfs attribute_hidden; #define __NR___libc_fstatfs __NR_fstatfs -_syscall2(int, __libc_fstatfs, int, fd, struct statfs *, buf); -libc_hidden_def(__libc_fstatfs) +_syscall2(int, __libc_fstatfs, int, fd, struct statfs *, buf) #if defined __UCLIBC_LINUX_SPECIFIC__ -libc_hidden_proto(fstatfs) weak_alias(__libc_fstatfs,fstatfs) -libc_hidden_weak(fstatfs) #endif diff --git a/libc/sysdeps/linux/common/fsync.c b/libc/sysdeps/linux/common/fsync.c index be76b2d0d..711811f23 100644 --- a/libc/sysdeps/linux/common/fsync.c +++ b/libc/sysdeps/linux/common/fsync.c @@ -17,7 +17,7 @@ #endif #define __NR___syscall_fsync __NR_fsync -static inline _syscall1(int, __syscall_fsync, int, fd); +static inline _syscall1(int, __syscall_fsync, int, fd) extern __typeof(fsync) __libc_fsync; diff --git a/libc/sysdeps/linux/common/ftruncate.c b/libc/sysdeps/linux/common/ftruncate.c index 951720ba8..a7a6ea69d 100644 --- a/libc/sysdeps/linux/common/ftruncate.c +++ b/libc/sysdeps/linux/common/ftruncate.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(ftruncate) +/* libc_hidden_proto(ftruncate) */ -_syscall2(int, ftruncate, int, fd, __off_t, length); +_syscall2(int, ftruncate, int, fd, __off_t, length) libc_hidden_def(ftruncate) diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c index 04cdc0a99..132789144 100644 --- a/libc/sysdeps/linux/common/ftruncate64.c +++ b/libc/sysdeps/linux/common/ftruncate64.c @@ -21,14 +21,14 @@ # include <sys/types.h> # include <sys/syscall.h> -libc_hidden_proto(ftruncate64) +/* libc_hidden_proto(ftruncate64) */ # ifdef __NR_ftruncate64 # if __WORDSIZE == 64 /* For a 64 bit machine, life is simple... */ -_syscall2(int, ftruncate64, int, fd, __off64_t, length); +_syscall2(int, ftruncate64, int, fd, __off64_t, length) # elif __WORDSIZE == 32 @@ -37,10 +37,10 @@ _syscall2(int, ftruncate64, int, fd, __off64_t, length); # define __NR___syscall_ftruncate64 __NR_ftruncate64 # if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__) static __inline__ _syscall4(int, __syscall_ftruncate64, int, fd, uint32_t, pad, - unsigned long, high_length, unsigned long, low_length); + unsigned long, high_length, unsigned long, low_length) # else static __inline__ _syscall3(int, __syscall_ftruncate64, int, fd, - unsigned long, high_length, unsigned long, low_length); + unsigned long, high_length, unsigned long, low_length) # endif # endif @@ -64,7 +64,7 @@ int ftruncate64 (int fd, __off64_t length) # else /* __NR_ftruncate64 */ -libc_hidden_proto(ftruncate) +/* libc_hidden_proto(ftruncate) */ int ftruncate64 (int fd, __off64_t length) { diff --git a/libc/sysdeps/linux/common/get_kernel_syms.c b/libc/sysdeps/linux/common/get_kernel_syms.c index 4f4ee5167..d6595eaf5 100644 --- a/libc/sysdeps/linux/common/get_kernel_syms.c +++ b/libc/sysdeps/linux/common/get_kernel_syms.c @@ -12,7 +12,7 @@ struct kernel_sym; int get_kernel_syms(struct kernel_sym *table attribute_unused); #ifdef __NR_get_kernel_syms -_syscall1(int, get_kernel_syms, struct kernel_sym *, table); +_syscall1(int, get_kernel_syms, struct kernel_sym *, table) #else int get_kernel_syms(struct kernel_sym *table attribute_unused) { diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c index 512a9e1ee..13619159d 100644 --- a/libc/sysdeps/linux/common/getcwd.c +++ b/libc/sysdeps/linux/common/getcwd.c @@ -15,23 +15,23 @@ #include <sys/param.h> #include <sys/syscall.h> -libc_hidden_proto(getcwd) -libc_hidden_proto(getpagesize) +/* libc_hidden_proto(getcwd) */ +/* libc_hidden_proto(getpagesize) */ /* Experimentally off - libc_hidden_proto(strcat) */ /* Experimentally off - libc_hidden_proto(strcpy) */ /* Experimentally off - libc_hidden_proto(strncpy) */ /* Experimentally off - libc_hidden_proto(strlen) */ -libc_hidden_proto(opendir) -libc_hidden_proto(readdir) -libc_hidden_proto(closedir) -libc_hidden_proto(stat) +/* 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 -static inline -_syscall2(int, __syscall_getcwd, char *, buf, unsigned long, size); +static __always_inline +_syscall2(int, __syscall_getcwd, char *, buf, unsigned long, size) #else @@ -144,7 +144,7 @@ oops: return 0; } -static inline +static __always_inline int __syscall_getcwd(char * buf, unsigned long size) { int len; diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index 97c6d8b06..0baf47eb4 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -39,7 +39,7 @@ struct kernel_dirent ssize_t __getdents (int fd, char *buf, size_t nbytes) attribute_hidden; #define __NR___syscall_getdents __NR_getdents -static inline _syscall3(int, __syscall_getdents, int, fd, unsigned char *, kdirp, size_t, count); +static __always_inline _syscall3(int, __syscall_getdents, int, fd, unsigned char *, kdirp, size_t, count) #ifdef __ASSUME_GETDENTS32_D_TYPE ssize_t __getdents (int fd, char *buf, size_t nbytes) @@ -72,7 +72,7 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes) #elif ! defined __UCLIBC_HAS_LFS__ || ! defined __NR_getdents64 /* Experimentally off - libc_hidden_proto(memcpy) */ -libc_hidden_proto(lseek) +/* libc_hidden_proto(lseek) */ ssize_t __getdents (int fd, char *buf, size_t nbytes) { diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index e695b969c..1864ff4fc 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -21,7 +21,7 @@ #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 /* Experimentally off - libc_hidden_proto(memcpy) */ -libc_hidden_proto(lseek64) +/* libc_hidden_proto(lseek64) */ # ifndef offsetof # define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) @@ -38,7 +38,7 @@ struct kernel_dirent64 # define __NR___syscall_getdents64 __NR_getdents64 -static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count); +static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count) ssize_t __getdents64 (int fd, char *buf, size_t nbytes) attribute_hidden; ssize_t __getdents64 (int fd, char *buf, size_t nbytes) diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c index 5938d7257..4b793faf0 100644 --- a/libc/sysdeps/linux/common/getdirname.c +++ b/libc/sysdeps/linux/common/getdirname.c @@ -26,12 +26,12 @@ #include <string.h> /* Experimentally off - libc_hidden_proto(strdup) */ -libc_hidden_proto(getcwd) -libc_hidden_proto(getenv) +/* libc_hidden_proto(getcwd) */ +/* libc_hidden_proto(getenv) */ #ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(stat64) +/* libc_hidden_proto(stat64) */ #else -libc_hidden_proto(stat) +/* libc_hidden_proto(stat) */ #endif /* Return a malloc'd string containing the current directory name. diff --git a/libc/sysdeps/linux/common/getdomainname.c b/libc/sysdeps/linux/common/getdomainname.c index 86f6dfd32..c561aa305 100644 --- a/libc/sysdeps/linux/common/getdomainname.c +++ b/libc/sysdeps/linux/common/getdomainname.c @@ -14,7 +14,7 @@ #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98) /* Experimentally off - libc_hidden_proto(strlen) */ /* Experimentally off - libc_hidden_proto(strcpy) */ -libc_hidden_proto(uname) +/* libc_hidden_proto(uname) */ #if !defined __UCLIBC_BSD_SPECIFIC__ extern int getdomainname (char *__name, size_t __len) @@ -50,7 +50,7 @@ int __libc_getdomainname(char *name, size_t len) } libc_hidden_def(__libc_getdomainname) #if defined __UCLIBC_BSD_SPECIFIC__ -libc_hidden_proto(getdomainname) +/* libc_hidden_proto(getdomainname) */ weak_alias(__libc_getdomainname,getdomainname) libc_hidden_weak(getdomainname) #endif /* __UCLIBC_BSD_SPECIFIC__ */ diff --git a/libc/sysdeps/linux/common/getdtablesize.c b/libc/sysdeps/linux/common/getdtablesize.c index 44d21862f..183c09e1f 100644 --- a/libc/sysdeps/linux/common/getdtablesize.c +++ b/libc/sysdeps/linux/common/getdtablesize.c @@ -11,9 +11,9 @@ /* XXX: _BSD || _XOPEN_SOURCE >= 500 */ #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED -libc_hidden_proto(getdtablesize) +/* libc_hidden_proto(getdtablesize) */ -libc_hidden_proto(getrlimit) +/* libc_hidden_proto(getrlimit) */ #define __LOCAL_OPEN_MAX 256 diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c index eaa708f15..20a679156 100644 --- a/libc/sysdeps/linux/common/getegid.c +++ b/libc/sysdeps/linux/common/getegid.c @@ -10,22 +10,22 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(getegid) +/* libc_hidden_proto(getegid) */ #if defined(__NR_getegid32) # undef __NR_getegid # define __NR_getegid __NR_getegid32 -_syscall0(gid_t, getegid); +_syscall0(gid_t, getegid) #elif defined(__NR_getegid) # define __NR___syscall_getegid __NR_getegid -static __inline__ _syscall0(int, __syscall_getegid); +static __inline__ _syscall0(int, __syscall_getegid) gid_t getegid(void) { return (__syscall_getegid()); } #else -libc_hidden_proto(getgid) +/* libc_hidden_proto(getgid) */ gid_t getegid(void) { diff --git a/libc/sysdeps/linux/common/geteuid.c b/libc/sysdeps/linux/common/geteuid.c index 60151214d..b9332a9f2 100644 --- a/libc/sysdeps/linux/common/geteuid.c +++ b/libc/sysdeps/linux/common/geteuid.c @@ -10,23 +10,23 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(geteuid) +/* libc_hidden_proto(geteuid) */ #if defined(__NR_geteuid32) # undef __NR_geteuid # define __NR_geteuid __NR_geteuid32 -_syscall0(uid_t, geteuid); +_syscall0(uid_t, geteuid) #elif defined(__NR_geteuid) # define __NR___syscall_geteuid __NR_geteuid -static __inline__ _syscall0(int, __syscall_geteuid); +static __inline__ _syscall0(int, __syscall_geteuid) uid_t geteuid(void) { return (__syscall_geteuid()); } #else -libc_hidden_proto(getuid) +/* libc_hidden_proto(getuid) */ uid_t geteuid(void) { return (getuid()); diff --git a/libc/sysdeps/linux/common/getgid.c b/libc/sysdeps/linux/common/getgid.c index 820ebf0e2..f42a1731c 100644 --- a/libc/sysdeps/linux/common/getgid.c +++ b/libc/sysdeps/linux/common/getgid.c @@ -19,6 +19,6 @@ # define __NR_getgid __NR_getgid32 #endif -libc_hidden_proto(getgid) -_syscall0(gid_t, getgid); +/* libc_hidden_proto(getgid) */ +_syscall0(gid_t, getgid) libc_hidden_def(getgid) diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c index 7e1604294..67d2f4faa 100644 --- a/libc/sysdeps/linux/common/getgroups.c +++ b/libc/sysdeps/linux/common/getgroups.c @@ -12,24 +12,24 @@ #include <unistd.h> #include <grp.h> -libc_hidden_proto(getgroups) +/* libc_hidden_proto(getgroups) */ #if defined(__NR_getgroups32) # undef __NR_getgroups # define __NR_getgroups __NR_getgroups32 -_syscall2(int, getgroups, int, size, gid_t *, list); +_syscall2(int, getgroups, int, size, gid_t *, list) #elif __WORDSIZE == 64 -_syscall2(int, getgroups, int, size, gid_t *, list); +_syscall2(int, getgroups, int, size, gid_t *, list) #else -libc_hidden_proto(sysconf) +/* 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, size, __kernel_gid_t *, list) int getgroups(int size, gid_t groups[]) { diff --git a/libc/sysdeps/linux/common/gethostname.c b/libc/sysdeps/linux/common/gethostname.c index 8fc14ff32..e06fee98d 100644 --- a/libc/sysdeps/linux/common/gethostname.c +++ b/libc/sysdeps/linux/common/gethostname.c @@ -9,11 +9,11 @@ #include <sys/utsname.h> #include <errno.h> -libc_hidden_proto(gethostname) +/* libc_hidden_proto(gethostname) */ /* Experimentally off - libc_hidden_proto(strlen) */ /* Experimentally off - libc_hidden_proto(strcpy) */ -libc_hidden_proto(uname) +/* libc_hidden_proto(uname) */ int gethostname(char *name, size_t len) diff --git a/libc/sysdeps/linux/common/getitimer.c b/libc/sysdeps/linux/common/getitimer.c index b240f1c6e..b324233a4 100644 --- a/libc/sysdeps/linux/common/getitimer.c +++ b/libc/sysdeps/linux/common/getitimer.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <sys/time.h> -_syscall2(int, getitimer, __itimer_which_t, which, struct itimerval *, value); +_syscall2(int, getitimer, __itimer_which_t, which, struct itimerval *, value) diff --git a/libc/sysdeps/linux/common/getpagesize.c b/libc/sysdeps/linux/common/getpagesize.c index efb5fcb7f..96ed17b04 100644 --- a/libc/sysdeps/linux/common/getpagesize.c +++ b/libc/sysdeps/linux/common/getpagesize.c @@ -43,6 +43,6 @@ int __getpagesize(void) #endif /* NBPG. */ #endif /* EXEC_PAGESIZE. */ } -libc_hidden_proto(getpagesize) +/* libc_hidden_proto(getpagesize) */ strong_alias(__getpagesize,getpagesize) libc_hidden_def(getpagesize) diff --git a/libc/sysdeps/linux/common/getpgid.c b/libc/sysdeps/linux/common/getpgid.c index 25ff12907..cf1c0fc6e 100644 --- a/libc/sysdeps/linux/common/getpgid.c +++ b/libc/sysdeps/linux/common/getpgid.c @@ -13,7 +13,7 @@ #include <unistd.h> #define __NR___syscall_getpgid __NR_getpgid -static __inline__ _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid); +static __inline__ _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid) pid_t getpgid(pid_t pid) { diff --git a/libc/sysdeps/linux/common/getpgrp.c b/libc/sysdeps/linux/common/getpgrp.c index a2fe44560..c9de68cd3 100644 --- a/libc/sysdeps/linux/common/getpgrp.c +++ b/libc/sysdeps/linux/common/getpgrp.c @@ -12,5 +12,5 @@ #ifdef __NR_getpgrp /* According to the manpage the POSIX.1 version is favoured */ -_syscall0(pid_t, getpgrp); +_syscall0(pid_t, getpgrp) #endif diff --git a/libc/sysdeps/linux/common/getpid.c b/libc/sysdeps/linux/common/getpid.c index 56f1ddd66..d78c6e906 100644 --- a/libc/sysdeps/linux/common/getpid.c +++ b/libc/sysdeps/linux/common/getpid.c @@ -15,7 +15,7 @@ extern __typeof(getpid) __libc_getpid; # define __NR_getpid __NR_getxpid #endif #define __NR___libc_getpid __NR_getpid -_syscall0(pid_t, __libc_getpid); -libc_hidden_proto(getpid) +_syscall0(pid_t, __libc_getpid) +/* libc_hidden_proto(getpid) */ weak_alias(__libc_getpid, getpid) libc_hidden_weak(getpid) diff --git a/libc/sysdeps/linux/common/getppid.c b/libc/sysdeps/linux/common/getppid.c index 1630234cc..7adeb2f8b 100644 --- a/libc/sysdeps/linux/common/getppid.c +++ b/libc/sysdeps/linux/common/getppid.c @@ -10,9 +10,9 @@ #include <sys/syscall.h> #include <unistd.h> #ifdef __NR_getppid -_syscall0(pid_t, getppid); +_syscall0(pid_t, getppid) #else -libc_hidden_proto(getpid) +/* libc_hidden_proto(getpid) */ pid_t getppid(void) { return getpid(); diff --git a/libc/sysdeps/linux/common/getpriority.c b/libc/sysdeps/linux/common/getpriority.c index bdfc723e6..58fb2b31f 100644 --- a/libc/sysdeps/linux/common/getpriority.c +++ b/libc/sysdeps/linux/common/getpriority.c @@ -10,11 +10,11 @@ #include <sys/syscall.h> #include <sys/resource.h> -libc_hidden_proto(getpriority) +/* libc_hidden_proto(getpriority) */ #define __NR___syscall_getpriority __NR_getpriority static __inline__ _syscall2(int, __syscall_getpriority, - __priority_which_t, which, id_t, who); + __priority_which_t, which, id_t, who) /* The return value of __syscall_getpriority is biased by this value * to avoid returning negative values. */ diff --git a/libc/sysdeps/linux/common/getresgid.c b/libc/sysdeps/linux/common/getresgid.c index 922874a3d..425263e7e 100644 --- a/libc/sysdeps/linux/common/getresgid.c +++ b/libc/sysdeps/linux/common/getresgid.c @@ -19,7 +19,7 @@ _syscall3(int, getresgid, gid_t *, rgid, gid_t *, egid, gid_t *, sgid) #elif defined(__NR_getresgid) # define __NR___syscall_getresgid __NR_getresgid static __inline__ _syscall3(int, __syscall_getresgid, __kernel_gid_t *, rgid, - __kernel_gid_t *, egid, __kernel_gid_t *, sgid); + __kernel_gid_t *, egid, __kernel_gid_t *, sgid) int getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid) { diff --git a/libc/sysdeps/linux/common/getresuid.c b/libc/sysdeps/linux/common/getresuid.c index 5a070cc42..87cf6d6d8 100644 --- a/libc/sysdeps/linux/common/getresuid.c +++ b/libc/sysdeps/linux/common/getresuid.c @@ -19,7 +19,7 @@ _syscall3(int, getresuid, uid_t *, ruid, uid_t *, euid, uid_t *, suid) #elif defined(__NR_getresuid) # define __NR___syscall_getresuid __NR_getresuid static __inline__ _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid, - __kernel_uid_t *, euid, __kernel_uid_t *, suid); + __kernel_uid_t *, euid, __kernel_uid_t *, suid) int getresuid(uid_t * ruid, uid_t * euid, uid_t * suid) { diff --git a/libc/sysdeps/linux/common/getrlimit.c b/libc/sysdeps/linux/common/getrlimit.c index ecb09d1e2..6297516f0 100644 --- a/libc/sysdeps/linux/common/getrlimit.c +++ b/libc/sysdeps/linux/common/getrlimit.c @@ -13,7 +13,7 @@ #include <sys/resource.h> #undef getrlimit64 -libc_hidden_proto(getrlimit) +/* libc_hidden_proto(getrlimit) */ /* Only wrap getrlimit if the new ugetrlimit is not present and getrlimit sucks */ @@ -21,9 +21,9 @@ libc_hidden_proto(getrlimit) /* just call ugetrlimit() */ # define __NR___syscall_ugetrlimit __NR_ugetrlimit -static inline +static __always_inline _syscall2(int, __syscall_ugetrlimit, enum __rlimit_resource, resource, - struct rlimit *, rlim); + struct rlimit *, rlim) int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { return (__syscall_ugetrlimit(resource, rlimits)); @@ -33,14 +33,14 @@ int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) /* We don't need to wrap getrlimit() */ _syscall2(int, getrlimit, __rlimit_resource_t, resource, - struct rlimit *, rlim); + struct rlimit *, rlim) #else /* we have to handle old style getrlimit() */ # define __NR___syscall_getrlimit __NR_getrlimit -static inline -_syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim); +static __always_inline +_syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim) int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { diff --git a/libc/sysdeps/linux/common/getrlimit64.c b/libc/sysdeps/linux/common/getrlimit64.c index ca7aa7310..14335778c 100644 --- a/libc/sysdeps/linux/common/getrlimit64.c +++ b/libc/sysdeps/linux/common/getrlimit64.c @@ -26,7 +26,7 @@ #if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32 -libc_hidden_proto(getrlimit) +/* libc_hidden_proto(getrlimit) */ /* Put the soft and hard limits for RESOURCE in *RLIMITS. Returns 0 if successful, -1 if not (and sets errno). */ diff --git a/libc/sysdeps/linux/common/getrusage.c b/libc/sysdeps/linux/common/getrusage.c index 03f524dff..3e719f294 100644 --- a/libc/sysdeps/linux/common/getrusage.c +++ b/libc/sysdeps/linux/common/getrusage.c @@ -10,4 +10,4 @@ #include <sys/syscall.h> #include <unistd.h> #include <wait.h> -_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage); +_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage) diff --git a/libc/sysdeps/linux/common/getsid.c b/libc/sysdeps/linux/common/getsid.c index 9743a976f..1b22451f8 100644 --- a/libc/sysdeps/linux/common/getsid.c +++ b/libc/sysdeps/linux/common/getsid.c @@ -11,10 +11,10 @@ #include <unistd.h> #ifdef __USE_XOPEN_EXTENDED -libc_hidden_proto(getsid) +/* libc_hidden_proto(getsid) */ #define __NR___syscall_getsid __NR_getsid -static __inline__ _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid); +static __inline__ _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid) pid_t getsid(pid_t pid) { diff --git a/libc/sysdeps/linux/common/gettimeofday.c b/libc/sysdeps/linux/common/gettimeofday.c index 697b2dd6c..663cc3b50 100644 --- a/libc/sysdeps/linux/common/gettimeofday.c +++ b/libc/sysdeps/linux/common/gettimeofday.c @@ -10,10 +10,10 @@ #include <sys/syscall.h> #include <sys/time.h> -libc_hidden_proto(gettimeofday) +/* libc_hidden_proto(gettimeofday) */ #ifdef __USE_BSD -_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz); +_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz) #else -_syscall2(int, gettimeofday, struct timeval *, tv, void *, tz); +_syscall2(int, gettimeofday, struct timeval *, tv, void *, tz) #endif libc_hidden_def(gettimeofday) diff --git a/libc/sysdeps/linux/common/getuid.c b/libc/sysdeps/linux/common/getuid.c index 7d5a02bc6..ab0ea150b 100644 --- a/libc/sysdeps/linux/common/getuid.c +++ b/libc/sysdeps/linux/common/getuid.c @@ -19,6 +19,6 @@ # define __NR_getuid __NR_getuid32 #endif -libc_hidden_proto(getuid) -_syscall0(uid_t, getuid); +/* libc_hidden_proto(getuid) */ +_syscall0(uid_t, getuid) libc_hidden_def(getuid) diff --git a/libc/sysdeps/linux/common/init_module.c b/libc/sysdeps/linux/common/init_module.c index 45f1fff23..8a6e94199 100644 --- a/libc/sysdeps/linux/common/init_module.c +++ b/libc/sysdeps/linux/common/init_module.c @@ -14,7 +14,7 @@ int init_module(void *first, void *second, void *third, void *fourth, void *fift * (for 2.2 and 2.4 kernels). Use the greatest common denominator, * and let the kernel cope with whatever it gets. It's good at that. */ _syscall5(int, init_module, void *, first, void *, second, void *, third, - void *, fourth, void *, fifth); + void *, fourth, void *, fifth) #else int init_module(void *first, void *second, void *third, void *fourth, void *fifth) { diff --git a/libc/sysdeps/linux/common/inotify.c b/libc/sysdeps/linux/common/inotify.c index 31bfb0c3b..e5a612076 100644 --- a/libc/sysdeps/linux/common/inotify.c +++ b/libc/sysdeps/linux/common/inotify.c @@ -12,13 +12,13 @@ #include <sys/inotify.h> #ifdef __NR_inotify_init -_syscall0(int, inotify_init); +_syscall0(int, inotify_init) #endif #ifdef __NR_inotify_add_watch -_syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask); +_syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask) #endif #ifdef __NR_inotify_rm_watch -_syscall2(int, inotify_rm_watch, int, fd, uint32_t, wd); +_syscall2(int, inotify_rm_watch, int, fd, uint32_t, wd) #endif diff --git a/libc/sysdeps/linux/common/ioperm.c b/libc/sysdeps/linux/common/ioperm.c index 880842d97..64fc6470f 100644 --- a/libc/sysdeps/linux/common/ioperm.c +++ b/libc/sysdeps/linux/common/ioperm.c @@ -8,8 +8,13 @@ */ #include <sys/syscall.h> + #if defined __ARCH_USE_MMU__ && defined __NR_ioperm + /* psm: can't #include <sys/io.h>, some archs miss it */ extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on) __THROW; -_syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on); +libc_hidden_proto(ioperm) + +_syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on) + #endif diff --git a/libc/sysdeps/linux/common/iopl.c b/libc/sysdeps/linux/common/iopl.c index 510e1a4f6..4d9c4587f 100644 --- a/libc/sysdeps/linux/common/iopl.c +++ b/libc/sysdeps/linux/common/iopl.c @@ -11,5 +11,5 @@ #if defined __ARCH_USE_MMU__ && defined __NR_iopl /* psm: can't #include <sys/io.h>, some archs miss it */ extern int iopl(int __level) __THROW; -_syscall1(int, iopl, int, level); +_syscall1(int, iopl, int, level) #endif diff --git a/libc/sysdeps/linux/common/kill.c b/libc/sysdeps/linux/common/kill.c index c7729113b..3578673b8 100644 --- a/libc/sysdeps/linux/common/kill.c +++ b/libc/sysdeps/linux/common/kill.c @@ -10,10 +10,10 @@ #include <sys/syscall.h> #include <signal.h> -libc_hidden_proto(kill) +/* libc_hidden_proto(kill) */ #define __NR___syscall_kill __NR_kill -static __inline__ _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig); +static __inline__ _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig) int kill(pid_t pid, int sig) { diff --git a/libc/sysdeps/linux/common/klogctl.c b/libc/sysdeps/linux/common/klogctl.c index e378e3e67..58467dfa3 100644 --- a/libc/sysdeps/linux/common/klogctl.c +++ b/libc/sysdeps/linux/common/klogctl.c @@ -11,7 +11,7 @@ #include <unistd.h> #include <sys/klog.h> #define __NR__syslog __NR_syslog -static __inline__ _syscall3(int, _syslog, int, type, char *, buf, int, len); +static __inline__ _syscall3(int, _syslog, int, type, char *, buf, int, len) int klogctl(int type, char *buf, int len) { return (_syslog(type, buf, len)); diff --git a/libc/sysdeps/linux/common/lchown.c b/libc/sysdeps/linux/common/lchown.c index 08c686fd6..c0f8ce763 100644 --- a/libc/sysdeps/linux/common/lchown.c +++ b/libc/sysdeps/linux/common/lchown.c @@ -17,13 +17,13 @@ # define __NR_lchown __NR_lchown32 # endif -_syscall3(int, lchown, const char *, path, uid_t, owner, gid_t, group); +_syscall3(int, lchown, const char *, path, uid_t, owner, gid_t, group) #else # define __NR___syscall_lchown __NR_lchown static __inline__ _syscall3(int, __syscall_lchown, const char *, path, - __kernel_uid_t, owner, __kernel_gid_t, group); + __kernel_uid_t, owner, __kernel_gid_t, group) int lchown(const char *path, uid_t owner, gid_t group) { diff --git a/libc/sysdeps/linux/common/link.c b/libc/sysdeps/linux/common/link.c index a012cc2c3..b5e5536d5 100644 --- a/libc/sysdeps/linux/common/link.c +++ b/libc/sysdeps/linux/common/link.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <unistd.h> -_syscall2(int, link, const char *, oldpath, const char *, newpath); +_syscall2(int, link, const char *, oldpath, const char *, newpath) diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c index 35365d8ae..1879464f7 100644 --- a/libc/sysdeps/linux/common/llseek.c +++ b/libc/sysdeps/linux/common/llseek.c @@ -19,7 +19,7 @@ extern __typeof(lseek64) __libc_lseek64; # define INLINE_SYSCALL(name, nr, args...) __syscall_llseek (args) # define __NR___syscall_llseek __NR__llseek static __inline__ _syscall5(int, __syscall_llseek, int, fd, off_t, offset_hi, - off_t, offset_lo, loff_t *, result, int, whence); + off_t, offset_lo, loff_t *, result, int, whence) # endif loff_t __libc_lseek64(int fd, loff_t offset, int whence) @@ -30,14 +30,14 @@ loff_t __libc_lseek64(int fd, loff_t offset, int whence) } #else extern __typeof(lseek) __libc_lseek; -libc_hidden_proto(__libc_lseek) +/* libc_hidden_proto(__libc_lseek) */ loff_t __libc_lseek64(int fd, loff_t offset, int whence) { return(loff_t)(__libc_lseek(fd, (off_t) (offset), whence)); } #endif -libc_hidden_proto(lseek64) +/* libc_hidden_proto(lseek64) */ weak_alias(__libc_lseek64,lseek64) libc_hidden_weak(lseek64) -//strong_alias(__libc_lseek64,_llseek) +/*strong_alias(__libc_lseek64,_llseek) */ diff --git a/libc/sysdeps/linux/common/longjmp.c b/libc/sysdeps/linux/common/longjmp.c index a54f01f48..672754a73 100644 --- a/libc/sysdeps/linux/common/longjmp.c +++ b/libc/sysdeps/linux/common/longjmp.c @@ -20,7 +20,7 @@ #include <setjmp.h> #include <signal.h> -libc_hidden_proto(sigprocmask) +/* libc_hidden_proto(sigprocmask) */ extern void __longjmp (__jmp_buf __env, int __val) attribute_noreturn; libc_hidden_proto(__longjmp) diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c index 5ba5ad9c8..ee49c9f25 100644 --- a/libc/sysdeps/linux/common/lseek.c +++ b/libc/sysdeps/linux/common/lseek.c @@ -15,10 +15,11 @@ 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, __libc_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) { return __libc_lseek64(fildes, offset, whence); @@ -26,6 +27,6 @@ __off_t __libc_lseek(int fildes, __off_t offset, int whence) #endif libc_hidden_def(__libc_lseek) -libc_hidden_proto(lseek) +/* libc_hidden_proto(lseek) */ weak_alias(__libc_lseek,lseek) libc_hidden_weak(lseek) diff --git a/libc/sysdeps/linux/common/lstat.c b/libc/sysdeps/linux/common/lstat.c index 4707dfc7c..1adbdcf87 100644 --- a/libc/sysdeps/linux/common/lstat.c +++ b/libc/sysdeps/linux/common/lstat.c @@ -18,11 +18,11 @@ #undef lstat64 -libc_hidden_proto(lstat) +/* libc_hidden_proto(lstat) */ #define __NR___syscall_lstat __NR_lstat static __inline__ _syscall2(int, __syscall_lstat, - const char *, file_name, struct kernel_stat *, buf); + const char *, file_name, struct kernel_stat *, buf) int lstat(const char *file_name, struct stat *buf) { @@ -39,7 +39,7 @@ libc_hidden_def(lstat) #if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__ extern __typeof(lstat) lstat64; -libc_hidden_proto(lstat64) +/* libc_hidden_proto(lstat64) */ strong_alias(lstat,lstat64) libc_hidden_def(lstat64) #endif diff --git a/libc/sysdeps/linux/common/lstat64.c b/libc/sysdeps/linux/common/lstat64.c index 6777dff6a..8d7ce1921 100644 --- a/libc/sysdeps/linux/common/lstat64.c +++ b/libc/sysdeps/linux/common/lstat64.c @@ -14,11 +14,11 @@ # include <sys/stat.h> # include "xstatconv.h" -libc_hidden_proto(lstat64) +/* libc_hidden_proto(lstat64) */ # define __NR___syscall_lstat64 __NR_lstat64 static __inline__ _syscall2(int, __syscall_lstat64, const char *, file_name, - struct kernel_stat64 *, buf); + struct kernel_stat64 *, buf) int lstat64(const char *file_name, struct stat64 *buf) { diff --git a/libc/sysdeps/linux/common/madvise.c b/libc/sysdeps/linux/common/madvise.c index 627bcdc59..e953d7b92 100644 --- a/libc/sysdeps/linux/common/madvise.c +++ b/libc/sysdeps/linux/common/madvise.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <sys/mman.h> #if defined __NR_madvise && defined __USE_BSD -_syscall3(int, madvise, void *, __addr, size_t, __len, int, __advice); +_syscall3(int, madvise, void *, __addr, size_t, __len, int, __advice) #endif diff --git a/libc/sysdeps/linux/common/mincore.c b/libc/sysdeps/linux/common/mincore.c index 1dc9a9a1a..f1f3557c6 100644 --- a/libc/sysdeps/linux/common/mincore.c +++ b/libc/sysdeps/linux/common/mincore.c @@ -11,5 +11,5 @@ #if defined __NR_mincore && (defined __USE_BSD || defined __USE_SVID) #include <unistd.h> #include <sys/mman.h> -_syscall3(int, mincore, void *, start, size_t, length, unsigned char *, vec); +_syscall3(int, mincore, void *, start, size_t, length, unsigned char *, vec) #endif diff --git a/libc/sysdeps/linux/common/mkdir.c b/libc/sysdeps/linux/common/mkdir.c index ab3cbfee5..73234f287 100644 --- a/libc/sysdeps/linux/common/mkdir.c +++ b/libc/sysdeps/linux/common/mkdir.c @@ -10,11 +10,11 @@ #include <sys/syscall.h> #include <sys/stat.h> -libc_hidden_proto(mkdir) +/* libc_hidden_proto(mkdir) */ #define __NR___syscall_mkdir __NR_mkdir static __inline__ _syscall2(int, __syscall_mkdir, const char *, pathname, - __kernel_mode_t, mode); + __kernel_mode_t, mode) int mkdir(const char *pathname, mode_t mode) { diff --git a/libc/sysdeps/linux/common/mkfifo.c b/libc/sysdeps/linux/common/mkfifo.c index cbde71e04..f6f03a746 100644 --- a/libc/sysdeps/linux/common/mkfifo.c +++ b/libc/sysdeps/linux/common/mkfifo.c @@ -21,7 +21,7 @@ #include <sys/stat.h> #include <sys/types.h> -libc_hidden_proto(mknod) +/* libc_hidden_proto(mknod) */ /* Create a named pipe (FIFO) named PATH with protections MODE. */ int diff --git a/libc/sysdeps/linux/common/mlock.c b/libc/sysdeps/linux/common/mlock.c index 55b77a5d5..12120d8e5 100644 --- a/libc/sysdeps/linux/common/mlock.c +++ b/libc/sysdeps/linux/common/mlock.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <sys/mman.h> #if defined __ARCH_USE_MMU__ && defined __NR_mlock -_syscall2(int, mlock, const void *, addr, size_t, len); +_syscall2(int, mlock, const void *, addr, size_t, len) #endif diff --git a/libc/sysdeps/linux/common/mlockall.c b/libc/sysdeps/linux/common/mlockall.c index d75e30fe7..99f72018a 100644 --- a/libc/sysdeps/linux/common/mlockall.c +++ b/libc/sysdeps/linux/common/mlockall.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <sys/mman.h> #if defined __ARCH_USE_MMU__ && defined __NR_mlockall -_syscall1(int, mlockall, int, flags); +_syscall1(int, mlockall, int, flags) #endif diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c index 7645565a2..d5b0b85df 100644 --- a/libc/sysdeps/linux/common/mmap.c +++ b/libc/sysdeps/linux/common/mmap.c @@ -14,17 +14,17 @@ #ifdef __NR_mmap -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ #ifdef __UCLIBC_MMAP_HAS_6_ARGS__ _syscall6(void *, mmap, void *, start, size_t, length, - int, prot, int, flags, int, fd, off_t, offset); + int, prot, int, flags, int, fd, off_t, offset) #else # define __NR__mmap __NR_mmap -static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer); +static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer) __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) { @@ -45,11 +45,11 @@ libc_hidden_def(mmap) #elif defined(__NR_mmap2) -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ #define __NR___syscall_mmap2 __NR_mmap2 static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, - size_t, len, int, prot, int, flags, int, fd, off_t, offset); + size_t, len, int, prot, int, flags, int, fd, off_t, offset) /* Some architectures always use 12 as page shift for mmap2() eventhough the * real PAGE_SHIFT != 12. Other architectures use the same value as diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c index a1aa19fb8..2b10e5710 100644 --- a/libc/sysdeps/linux/common/mmap64.c +++ b/libc/sysdeps/linux/common/mmap64.c @@ -15,7 +15,7 @@ #include <sys/syscall.h> #include <bits/uClibc_page.h> -libc_hidden_proto(mmap) +/* libc_hidden_proto(mmap) */ # if !defined __NR_mmap2 || !defined _syscall6 @@ -41,8 +41,9 @@ __ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t # else # define __NR___syscall_mmap2 __NR_mmap2 -static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len, - int, prot, int, flags, int, fd, off_t, offset); +static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, + size_t, len, int, prot, int, flags, int, fd, + off_t, offset) /* Some architectures always use 12 as page shift for mmap2() eventhough the * real PAGE_SHIFT != 12. Other architectures use the same value as diff --git a/libc/sysdeps/linux/common/modify_ldt.c b/libc/sysdeps/linux/common/modify_ldt.c index d5f0105dd..d70bd40b0 100644 --- a/libc/sysdeps/linux/common/modify_ldt.c +++ b/libc/sysdeps/linux/common/modify_ldt.c @@ -11,5 +11,5 @@ int modify_ldt (int func, void *ptr, unsigned long bytecount); #ifdef __NR_modify_ldt -_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount); +_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount) #endif diff --git a/libc/sysdeps/linux/common/mount.c b/libc/sysdeps/linux/common/mount.c index a5a2c7fec..39e5db1c2 100644 --- a/libc/sysdeps/linux/common/mount.c +++ b/libc/sysdeps/linux/common/mount.c @@ -11,4 +11,4 @@ #include <sys/mount.h> _syscall5(int, mount, const char *, specialfile, const char *, dir, const char *, filesystemtype, unsigned long, rwflag, - const void *, data); + const void *, data) diff --git a/libc/sysdeps/linux/common/mprotect.c b/libc/sysdeps/linux/common/mprotect.c index 7122f0f2f..a0e7610fd 100644 --- a/libc/sysdeps/linux/common/mprotect.c +++ b/libc/sysdeps/linux/common/mprotect.c @@ -11,5 +11,5 @@ #include <sys/mman.h> #if defined __ARCH_USE_MMU__ && defined __NR_mprotect -_syscall3(int, mprotect, void *, addr, size_t, len, int, prot); +_syscall3(int, mprotect, void *, addr, size_t, len, int, prot) #endif diff --git a/libc/sysdeps/linux/common/mremap.c b/libc/sysdeps/linux/common/mremap.c index 04548d5ec..0295a25da 100644 --- a/libc/sysdeps/linux/common/mremap.c +++ b/libc/sysdeps/linux/common/mremap.c @@ -12,15 +12,17 @@ #ifdef __NR_mremap +/* Why do we do this?! */ + #define mremap _hidemremap #include <sys/mman.h> #undef mremap void *mremap(void *, size_t, size_t, int, void *); - libc_hidden_proto(mremap) + _syscall5(void *, mremap, void *, old_address, size_t, old_size, size_t, - new_size, int, may_move, void *, new_address); + new_size, int, may_move, void *, new_address) libc_hidden_def(mremap) #endif diff --git a/libc/sysdeps/linux/common/munlock.c b/libc/sysdeps/linux/common/munlock.c index e901cc00a..07f93760f 100644 --- a/libc/sysdeps/linux/common/munlock.c +++ b/libc/sysdeps/linux/common/munlock.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <sys/mman.h> #if defined __ARCH_USE_MMU__ && defined __NR_munlock -_syscall2(int, munlock, const void *, addr, size_t, len); +_syscall2(int, munlock, const void *, addr, size_t, len) #endif diff --git a/libc/sysdeps/linux/common/munlockall.c b/libc/sysdeps/linux/common/munlockall.c index 39507715a..cc1526451 100644 --- a/libc/sysdeps/linux/common/munlockall.c +++ b/libc/sysdeps/linux/common/munlockall.c @@ -12,5 +12,5 @@ #if defined __NR_munlockall && defined __ARCH_USE_MMU__ #include <sys/mman.h> -_syscall0(int, munlockall); +_syscall0(int, munlockall) #endif diff --git a/libc/sysdeps/linux/common/munmap.c b/libc/sysdeps/linux/common/munmap.c index 5c948abfd..37b939993 100644 --- a/libc/sysdeps/linux/common/munmap.c +++ b/libc/sysdeps/linux/common/munmap.c @@ -11,7 +11,7 @@ #include <unistd.h> #include <sys/mman.h> -libc_hidden_proto(munmap) +/* libc_hidden_proto(munmap) */ -_syscall2(int, munmap, void *, start, size_t, length); +_syscall2(int, munmap, void *, start, size_t, length) libc_hidden_def(munmap) diff --git a/libc/sysdeps/linux/common/nice.c b/libc/sysdeps/linux/common/nice.c index 8ced60915..51997ca13 100644 --- a/libc/sysdeps/linux/common/nice.c +++ b/libc/sysdeps/linux/common/nice.c @@ -12,18 +12,18 @@ #include <unistd.h> #include <sys/resource.h> -libc_hidden_proto(getpriority) +/* libc_hidden_proto(getpriority) */ #ifdef __NR_nice # define __NR___syscall_nice __NR_nice -static __inline__ _syscall1(int, __syscall_nice, int, incr); +static __inline__ _syscall1(int, __syscall_nice, int, incr) #else # include <limits.h> -libc_hidden_proto(setpriority) +/* libc_hidden_proto(setpriority) */ static __inline__ int int_add_no_wrap(int a, int b) { diff --git a/libc/sysdeps/linux/common/ntp_gettime.c b/libc/sysdeps/linux/common/ntp_gettime.c index f32e05444..ff933fed4 100644 --- a/libc/sysdeps/linux/common/ntp_gettime.c +++ b/libc/sysdeps/linux/common/ntp_gettime.c @@ -18,7 +18,7 @@ #include <sys/timex.h> -libc_hidden_proto(adjtimex) +/* libc_hidden_proto(adjtimex) */ int ntp_gettime(struct ntptimeval *ntv) { diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c index 7c0566b46..a39093bd1 100644 --- a/libc/sysdeps/linux/common/open.c +++ b/libc/sysdeps/linux/common/open.c @@ -19,7 +19,7 @@ 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); + int, flags, __kernel_mode_t, mode) libc_hidden_proto(__libc_open) int __libc_open(const char *file, int oflag, ...) @@ -37,7 +37,7 @@ int __libc_open(const char *file, int oflag, ...) } libc_hidden_def(__libc_open) -libc_hidden_proto(open) +/* libc_hidden_proto(open) */ weak_alias(__libc_open,open) libc_hidden_weak(open) diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index 3f2ea344e..2d8a3c692 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -54,7 +54,7 @@ int __libc_open64 (const char *file, int oflag, ...) } libc_hidden_def(__libc_open64) -libc_hidden_proto(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/personality.c b/libc/sysdeps/linux/common/personality.c index 149fb5f08..fa304de09 100644 --- a/libc/sysdeps/linux/common/personality.c +++ b/libc/sysdeps/linux/common/personality.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <sys/personality.h> -_syscall1(int, personality, unsigned long int, __persona); +_syscall1(int, personality, unsigned long int, __persona) diff --git a/libc/sysdeps/linux/common/pipe.c b/libc/sysdeps/linux/common/pipe.c index 789b23c40..02b173853 100644 --- a/libc/sysdeps/linux/common/pipe.c +++ b/libc/sysdeps/linux/common/pipe.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(pipe) +/* libc_hidden_proto(pipe) */ -_syscall1(int, pipe, int *, filedes); +_syscall1(int, pipe, int *, filedes) libc_hidden_def(pipe) diff --git a/libc/sysdeps/linux/common/pivot_root.c b/libc/sysdeps/linux/common/pivot_root.c index 154a37e2d..3e9705903 100644 --- a/libc/sysdeps/linux/common/pivot_root.c +++ b/libc/sysdeps/linux/common/pivot_root.c @@ -11,7 +11,7 @@ int pivot_root(const char *new_root, const char *put_old); #ifdef __NR_pivot_root -_syscall2(int, pivot_root, const char *, new_root, const char *, put_old); +_syscall2(int, pivot_root, const char *, new_root, const char *, put_old) #else int pivot_root(const char *new_root, const char *put_old) { diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c index 95aa4d27b..a3f9c7653 100644 --- a/libc/sysdeps/linux/common/posix_fadvise.c +++ b/libc/sysdeps/linux/common/posix_fadvise.c @@ -36,7 +36,7 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice) static __inline__ int syscall_posix_fadvise(int fd, off_t offset1, off_t offset2, off_t len, int advice); #define __NR_syscall_posix_fadvise __NR_fadvise64 _syscall5(int, syscall_posix_fadvise, int, fd, off_t, offset1, - off_t, offset2, off_t, len, int, advice); + off_t, offset2, off_t, len, int, advice) int posix_fadvise(int fd, off_t offset, off_t len, int advice) { diff --git a/libc/sysdeps/linux/common/posix_fadvise64.c b/libc/sysdeps/linux/common/posix_fadvise64.c index 03e25ed93..6b1325db3 100644 --- a/libc/sysdeps/linux/common/posix_fadvise64.c +++ b/libc/sysdeps/linux/common/posix_fadvise64.c @@ -25,7 +25,7 @@ #define __NR_posix_fadvise64 __NR_fadvise64_64 -#ifdef INTERNAL_SYSCALL +#if defined INTERNAL_SYSCALL && ! defined __TARGET_powerpc__ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) { if (len != (off_t) len) @@ -43,7 +43,7 @@ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) static __inline__ int syscall_posix_fadvise(int fd, off_t offset1, off_t offset2, off_t len, int advice); #define __NR_syscall_posix_fadvise64 __NR_posix_fadvise64 _syscall4(int, syscall_posix_fadvise64, int, fd, __off64_t, offset, - __off64_t, len, int, advice); + __off64_t, len, int, advice) int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) { int ret = syscall_posix_fadvise64(fd, offset, len, advice); @@ -56,7 +56,7 @@ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) /* 32 bit implementation is kind of a pita */ #elif __WORDSIZE == 32 -#ifdef INTERNAL_SYSCALL +#if defined INTERNAL_SYSCALL && ! defined __TARGET_powerpc__ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) { INTERNAL_SYSCALL_DECL (err); @@ -73,7 +73,7 @@ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) static __inline__ _syscall6(int, __syscall_fadvise64_64, int, fd, unsigned long, high_offset, unsigned long, low_offset, unsigned long, high_len, unsigned long, low_len, - int, advice); + int, advice) int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) { int ret = __syscall_fadvise64_64(fd, diff --git a/libc/sysdeps/linux/common/ppoll.c b/libc/sysdeps/linux/common/ppoll.c index 90b3517b2..edcb1dc66 100644 --- a/libc/sysdeps/linux/common/ppoll.c +++ b/libc/sysdeps/linux/common/ppoll.c @@ -22,13 +22,13 @@ #if defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__ -libc_hidden_proto(ppoll) +/* libc_hidden_proto(ppoll) */ # define __NR___libc_ppoll __NR_ppoll -static inline +static __always_inline _syscall4(int, __libc_ppoll, struct pollfd *, fds, nfds_t, nfds, const struct timespec *, timeout, - const __sigset_t *, sigmask); + const __sigset_t *, sigmask) int ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, diff --git a/libc/sysdeps/linux/common/prctl.c b/libc/sysdeps/linux/common/prctl.c index 485386727..a6764c532 100644 --- a/libc/sysdeps/linux/common/prctl.c +++ b/libc/sysdeps/linux/common/prctl.c @@ -13,5 +13,5 @@ #ifdef __NR_prctl extern int prctl (int, long, long, long, long); -_syscall5(int, prctl, int, option, long, arg2, long, arg3, long, arg4, long, arg5); +_syscall5(int, prctl, int, option, long, arg2, long, arg3, long, arg4, long, arg5) #endif diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c index b2aaa2a1d..cb1d83820 100644 --- a/libc/sysdeps/linux/common/pread_write.c +++ b/libc/sysdeps/linux/common/pread_write.c @@ -31,7 +31,7 @@ extern __typeof(pwrite64) __libc_pwrite64; # define __NR___syscall_pread __NR_pread static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf, - size_t, count, off_t, offset_hi, off_t, offset_lo); + size_t, count, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { @@ -55,7 +55,7 @@ weak_alias(__libc_pread64,pread64) # define __NR___syscall_pwrite __NR_pwrite static __inline__ _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf, - size_t, count, off_t, offset_hi, off_t, offset_lo); + size_t, count, off_t, offset_hi, off_t, offset_lo) ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { @@ -75,9 +75,9 @@ weak_alias(__libc_pwrite64,pwrite64) #endif /* __NR_pwrite */ #if ! defined __NR_pread || ! defined __NR_pwrite -libc_hidden_proto(read) -libc_hidden_proto(write) -libc_hidden_proto(lseek) +/* libc_hidden_proto(read) */ +/* libc_hidden_proto(write) */ +/* libc_hidden_proto(lseek) */ static ssize_t __fake_pread_write(int fd, void *buf, size_t count, off_t offset, int do_pwrite) @@ -117,7 +117,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, } # ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(lseek64) +/* libc_hidden_proto(lseek64) */ static ssize_t __fake_pread_write64(int fd, void *buf, size_t count, off64_t offset, int do_pwrite) diff --git a/libc/sysdeps/linux/common/ptrace.c b/libc/sysdeps/linux/common/ptrace.c index 4f11260b8..8b8ebf086 100644 --- a/libc/sysdeps/linux/common/ptrace.c +++ b/libc/sysdeps/linux/common/ptrace.c @@ -13,7 +13,7 @@ #define __NR___syscall_ptrace __NR_ptrace static __inline__ _syscall4(long, __syscall_ptrace, enum __ptrace_request, request, - __kernel_pid_t, pid, void*, addr, void*, data); + __kernel_pid_t, pid, void*, addr, void*, data) long int ptrace (enum __ptrace_request request, ...) diff --git a/libc/sysdeps/linux/common/query_module.c b/libc/sysdeps/linux/common/query_module.c index b0b72dea9..0f3d4700c 100644 --- a/libc/sysdeps/linux/common/query_module.c +++ b/libc/sysdeps/linux/common/query_module.c @@ -12,8 +12,8 @@ int query_module(const char *name attribute_unused, int which attribute_unused, void *buf attribute_unused, size_t bufsize attribute_unused, size_t * ret attribute_unused); #ifdef __NR_query_module _syscall5(int, query_module, const char *, name, int, which, - void *, buf, size_t, bufsize, size_t *, ret); -#else + void *, buf, size_t, bufsize, size_t *, ret) +#elif defined __UCLIBC_HAS_STUBS__ int query_module(const char *name attribute_unused, int which attribute_unused, void *buf attribute_unused, size_t bufsize attribute_unused, size_t * ret attribute_unused) { diff --git a/libc/sysdeps/linux/common/quotactl.c b/libc/sysdeps/linux/common/quotactl.c index cb044a4e8..edd509256 100644 --- a/libc/sysdeps/linux/common/quotactl.c +++ b/libc/sysdeps/linux/common/quotactl.c @@ -12,5 +12,5 @@ #if defined __USE_BSD #include <sys/quota.h> _syscall4(int, quotactl, int, cmd, const char *, special, - int, id, caddr_t, addr); + int, id, caddr_t, addr) #endif diff --git a/libc/sysdeps/linux/common/read.c b/libc/sysdeps/linux/common/read.c index f837e9f07..cfa857319 100644 --- a/libc/sysdeps/linux/common/read.c +++ b/libc/sysdeps/linux/common/read.c @@ -12,7 +12,7 @@ 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) +_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) diff --git a/libc/sysdeps/linux/common/readahead.c b/libc/sysdeps/linux/common/readahead.c index 94e2481cf..cd40352d5 100644 --- a/libc/sysdeps/linux/common/readahead.c +++ b/libc/sysdeps/linux/common/readahead.c @@ -34,7 +34,7 @@ # if __WORDSIZE == 64 static __inline__ _syscall3(ssize_t, __readahead, int, fd, - off_t, offset, size_t, count); + off_t, offset, size_t, count) ssize_t readahead(int fd, off_t offset, size_t count) { @@ -44,7 +44,7 @@ ssize_t readahead(int fd, off_t offset, size_t count) # else static __inline__ _syscall4(ssize_t, __readahead, int, fd, - off_t, high_offset, off_t, low_offset, size_t, count); + off_t, high_offset, off_t, low_offset, size_t, count) ssize_t readahead(int fd, off64_t offset, size_t count) { diff --git a/libc/sysdeps/linux/common/readlink.c b/libc/sysdeps/linux/common/readlink.c index d68391302..36e0f8942 100644 --- a/libc/sysdeps/linux/common/readlink.c +++ b/libc/sysdeps/linux/common/readlink.c @@ -10,6 +10,6 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(readlink) -_syscall3(ssize_t, readlink, const char *, path, char *, buf, size_t, bufsiz); +/* libc_hidden_proto(readlink) */ +_syscall3(ssize_t, readlink, const char *, path, char *, buf, size_t, bufsiz) libc_hidden_def(readlink) diff --git a/libc/sysdeps/linux/common/reboot.c b/libc/sysdeps/linux/common/reboot.c index 9ce57b1ec..ec271b179 100644 --- a/libc/sysdeps/linux/common/reboot.c +++ b/libc/sysdeps/linux/common/reboot.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <sys/reboot.h> #define __NR__reboot __NR_reboot -static __inline__ _syscall3(int, _reboot, int, magic, int, magic2, int, flag); +static __inline__ _syscall3(int, _reboot, int, magic, int, magic2, int, flag) int reboot(int flag) { return (_reboot((int) 0xfee1dead, 672274793, flag)); diff --git a/libc/sysdeps/linux/common/remap_file_pages.c b/libc/sysdeps/linux/common/remap_file_pages.c index 2af53a32e..0512b8837 100644 --- a/libc/sysdeps/linux/common/remap_file_pages.c +++ b/libc/sysdeps/linux/common/remap_file_pages.c @@ -11,6 +11,6 @@ #ifdef __NR_remap_file_pages _syscall5(int, remap_file_pages, void *, __start, size_t, __size, - int, __prot, size_t, __pgoff, int, __flags); + int, __prot, size_t, __pgoff, int, __flags) #endif diff --git a/libc/sysdeps/linux/common/rename.c b/libc/sysdeps/linux/common/rename.c index fd7318f02..9d8397a8f 100644 --- a/libc/sysdeps/linux/common/rename.c +++ b/libc/sysdeps/linux/common/rename.c @@ -15,7 +15,7 @@ #define __NR___syscall_rename __NR_rename static __inline__ _syscall2(int, __syscall_rename, const char *, oldpath, - const char *, newpath); + const char *, newpath) int rename(const char * oldpath, const char * newpath) { diff --git a/libc/sysdeps/linux/common/rmdir.c b/libc/sysdeps/linux/common/rmdir.c index 845b3e371..221c29f46 100644 --- a/libc/sysdeps/linux/common/rmdir.c +++ b/libc/sysdeps/linux/common/rmdir.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(rmdir) +/* libc_hidden_proto(rmdir) */ -_syscall1(int, rmdir, const char *, pathname); +_syscall1(int, rmdir, const char *, pathname) libc_hidden_def(rmdir) diff --git a/libc/sysdeps/linux/common/sbrk.c b/libc/sysdeps/linux/common/sbrk.c index 734a4ce01..9ec1db3db 100644 --- a/libc/sysdeps/linux/common/sbrk.c +++ b/libc/sysdeps/linux/common/sbrk.c @@ -7,7 +7,7 @@ #include <unistd.h> #include <errno.h> -libc_hidden_proto(brk) +/* libc_hidden_proto(brk) */ /* Defined in brk.c. */ extern void *__curbrk attribute_hidden; @@ -15,7 +15,7 @@ extern void *__curbrk attribute_hidden; /* Extend the process's data space by INCREMENT. If INCREMENT is negative, shrink data space by - INCREMENT. Return start of new space allocated, or -1 for errors. */ -libc_hidden_proto(sbrk) +/* libc_hidden_proto(sbrk) */ void * sbrk (intptr_t increment) { void *oldbrk; diff --git a/libc/sysdeps/linux/common/sched_get_priority_max.c b/libc/sysdeps/linux/common/sched_get_priority_max.c index a9ab24639..cf5447ca7 100644 --- a/libc/sysdeps/linux/common/sched_get_priority_max.c +++ b/libc/sysdeps/linux/common/sched_get_priority_max.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <sched.h> -_syscall1(int, sched_get_priority_max, int, policy); +_syscall1(int, sched_get_priority_max, int, policy) diff --git a/libc/sysdeps/linux/common/sched_get_priority_min.c b/libc/sysdeps/linux/common/sched_get_priority_min.c index 5a78f9393..884efed60 100644 --- a/libc/sysdeps/linux/common/sched_get_priority_min.c +++ b/libc/sysdeps/linux/common/sched_get_priority_min.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <sched.h> -_syscall1(int, sched_get_priority_min, int, policy); +_syscall1(int, sched_get_priority_min, int, policy) diff --git a/libc/sysdeps/linux/common/sched_getaffinity.c b/libc/sysdeps/linux/common/sched_getaffinity.c index 5c801c68f..5d5e5b2c4 100644 --- a/libc/sysdeps/linux/common/sched_getaffinity.c +++ b/libc/sysdeps/linux/common/sched_getaffinity.c @@ -25,13 +25,11 @@ #include <string.h> #include <sys/param.h> -#include <sys/types.h> - -/* Experimentally off - libc_hidden_proto(memset) */ +#if defined __NR_sched_getaffinity #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity static __inline__ _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid, - size_t, cpusetsize, cpu_set_t *, cpuset); + size_t, cpusetsize, cpu_set_t *, cpuset) int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) { @@ -46,5 +44,11 @@ int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) } return res; } - +#elif defined __UCLIBC_HAS_STUBS__ +int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) +{ + __set_errno(ENOSYS); + return -1; +} +#endif #endif diff --git a/libc/sysdeps/linux/common/sched_getparam.c b/libc/sysdeps/linux/common/sched_getparam.c index af5ba6071..eb17e255e 100644 --- a/libc/sysdeps/linux/common/sched_getparam.c +++ b/libc/sysdeps/linux/common/sched_getparam.c @@ -13,7 +13,7 @@ #define __NR___syscall_sched_getparam __NR_sched_getparam static __inline__ _syscall2(int, __syscall_sched_getparam, - __kernel_pid_t, pid, struct sched_param *, p); + __kernel_pid_t, pid, struct sched_param *, p) int sched_getparam(pid_t pid, struct sched_param *p) { diff --git a/libc/sysdeps/linux/common/sched_getscheduler.c b/libc/sysdeps/linux/common/sched_getscheduler.c index 9564da7fd..e657abd77 100644 --- a/libc/sysdeps/linux/common/sched_getscheduler.c +++ b/libc/sysdeps/linux/common/sched_getscheduler.c @@ -12,7 +12,7 @@ #include <sys/syscall.h> #define __NR___syscall_sched_getscheduler __NR_sched_getscheduler -static __inline__ _syscall1(int, __syscall_sched_getscheduler, __kernel_pid_t, pid); +static __inline__ _syscall1(int, __syscall_sched_getscheduler, __kernel_pid_t, pid) int sched_getscheduler(pid_t pid) { diff --git a/libc/sysdeps/linux/common/sched_rr_get_interval.c b/libc/sysdeps/linux/common/sched_rr_get_interval.c index c59812d94..31d620fd3 100644 --- a/libc/sysdeps/linux/common/sched_rr_get_interval.c +++ b/libc/sysdeps/linux/common/sched_rr_get_interval.c @@ -13,7 +13,7 @@ #define __NR___syscall_sched_rr_get_interval __NR_sched_rr_get_interval static __inline__ _syscall2(int, __syscall_sched_rr_get_interval, - __kernel_pid_t, pid, struct timespec *, tp); + __kernel_pid_t, pid, struct timespec *, tp) int sched_rr_get_interval(pid_t pid, struct timespec *tp) { diff --git a/libc/sysdeps/linux/common/sched_setaffinity.c b/libc/sysdeps/linux/common/sched_setaffinity.c index c687970f1..aec032eab 100644 --- a/libc/sysdeps/linux/common/sched_setaffinity.c +++ b/libc/sysdeps/linux/common/sched_setaffinity.c @@ -28,14 +28,14 @@ #include <string.h> #include <unistd.h> #include <sys/param.h> -#include <sys/types.h> #include <alloca.h> -libc_hidden_proto(getpid) +#if defined __NR_sched_setaffinity +/* libc_hidden_proto(getpid) */ #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity static __inline__ _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid, - size_t, cpusetsize, cpu_set_t *, cpuset); + size_t, cpusetsize, cpu_set_t *, cpuset) static size_t __kernel_cpumask_size; @@ -74,5 +74,19 @@ int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset) return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset); } +#else +#define ___HAVE_NO_sched_setaffinity #endif +#else +#define ___HAVE_NO_sched_setaffinity #endif + +#if defined ___HAVE_NO_sched_setaffinity && defined __UCLIBC_HAS_STUBS__ +int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset) +{ + __set_errno(ENOSYS); + return -1; +} +#endif + +#endif /* __USE_GNU */ diff --git a/libc/sysdeps/linux/common/sched_setparam.c b/libc/sysdeps/linux/common/sched_setparam.c index 1e1f8cf2d..0f5f74f0d 100644 --- a/libc/sysdeps/linux/common/sched_setparam.c +++ b/libc/sysdeps/linux/common/sched_setparam.c @@ -13,7 +13,7 @@ #define __NR___syscall_sched_setparam __NR_sched_setparam static __inline__ _syscall2(int, __syscall_sched_setparam, - __kernel_pid_t, pid, const struct sched_param *, p); + __kernel_pid_t, pid, const struct sched_param *, p) int sched_setparam(pid_t pid, const struct sched_param *p) { diff --git a/libc/sysdeps/linux/common/sched_setscheduler.c b/libc/sysdeps/linux/common/sched_setscheduler.c index fe2630871..0af498fc2 100644 --- a/libc/sysdeps/linux/common/sched_setscheduler.c +++ b/libc/sysdeps/linux/common/sched_setscheduler.c @@ -13,7 +13,7 @@ #define __NR___syscall_sched_setscheduler __NR_sched_setscheduler static __inline__ _syscall3(int, __syscall_sched_setscheduler, - __kernel_pid_t, pid, int, policy, const struct sched_param *, p); + __kernel_pid_t, pid, int, policy, const struct sched_param *, p) int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p) { diff --git a/libc/sysdeps/linux/common/sched_yield.c b/libc/sysdeps/linux/common/sched_yield.c index 2ae5396c9..2d584bdc7 100644 --- a/libc/sysdeps/linux/common/sched_yield.c +++ b/libc/sysdeps/linux/common/sched_yield.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <sched.h> -_syscall0(int, sched_yield); +_syscall0(int, sched_yield) diff --git a/libc/sysdeps/linux/common/sendfile.c b/libc/sysdeps/linux/common/sendfile.c index 18427e85b..0d2ebaaf6 100644 --- a/libc/sysdeps/linux/common/sendfile.c +++ b/libc/sysdeps/linux/common/sendfile.c @@ -20,7 +20,7 @@ #ifdef __NR_sendfile _syscall4(ssize_t, sendfile, int, out_fd, int, in_fd, __off_t *, offset, - size_t, count); + size_t, count) #if ! defined __NR_sendfile64 && defined __UCLIBC_HAS_LFS__ strong_alias(sendfile,sendfile64) diff --git a/libc/sysdeps/linux/common/sendfile64.c b/libc/sysdeps/linux/common/sendfile64.c index 29cff5ec5..fc5155fd2 100644 --- a/libc/sysdeps/linux/common/sendfile64.c +++ b/libc/sysdeps/linux/common/sendfile64.c @@ -20,5 +20,5 @@ #include <bits/wordsize.h> #if defined __UCLIBC_HAS_LFS__ && defined __NR_sendfile64 -_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count); +_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count) #endif diff --git a/libc/sysdeps/linux/common/setdomainname.c b/libc/sysdeps/linux/common/setdomainname.c index e134b0d45..6b768b7f7 100644 --- a/libc/sysdeps/linux/common/setdomainname.c +++ b/libc/sysdeps/linux/common/setdomainname.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <unistd.h> #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98) -_syscall2(int, setdomainname, const char *, name, size_t, len); +_syscall2(int, setdomainname, const char *, name, size_t, len) #endif diff --git a/libc/sysdeps/linux/common/setegid.c b/libc/sysdeps/linux/common/setegid.c index 33c627c51..30921a8b3 100644 --- a/libc/sysdeps/linux/common/setegid.c +++ b/libc/sysdeps/linux/common/setegid.c @@ -12,9 +12,9 @@ #include <sys/syscall.h> #if (defined __NR_setresgid || defined __NR_setresgid32) && defined __USE_GNU -libc_hidden_proto(setresgid) +/* libc_hidden_proto(setresgid) */ #endif -libc_hidden_proto(setregid) +/* libc_hidden_proto(setregid) */ int setegid(gid_t gid) { diff --git a/libc/sysdeps/linux/common/seteuid.c b/libc/sysdeps/linux/common/seteuid.c index 5a6e9a25a..6f2c5e92a 100644 --- a/libc/sysdeps/linux/common/seteuid.c +++ b/libc/sysdeps/linux/common/seteuid.c @@ -16,12 +16,12 @@ #undef __NR_setresuid32 #endif -libc_hidden_proto(seteuid) +/* libc_hidden_proto(seteuid) */ #if (defined __NR_setresuid || defined __NR_setresuid32) && defined __USE_GNU -libc_hidden_proto(setresuid) +/* libc_hidden_proto(setresuid) */ #endif -libc_hidden_proto(setreuid) +/* libc_hidden_proto(setreuid) */ int seteuid(uid_t uid) { diff --git a/libc/sysdeps/linux/common/setfsgid.c b/libc/sysdeps/linux/common/setfsgid.c index de005e28d..78d35dd5a 100644 --- a/libc/sysdeps/linux/common/setfsgid.c +++ b/libc/sysdeps/linux/common/setfsgid.c @@ -17,12 +17,12 @@ # define __NR_setfsgid __NR_setfsgid32 # endif -_syscall1(int, setfsgid, gid_t, gid); +_syscall1(int, setfsgid, gid_t, gid) #else # define __NR___syscall_setfsgid __NR_setfsgid -static __inline__ _syscall1(int, __syscall_setfsgid, __kernel_gid_t, gid); +static __inline__ _syscall1(int, __syscall_setfsgid, __kernel_gid_t, gid) int setfsgid(gid_t gid) { diff --git a/libc/sysdeps/linux/common/setfsuid.c b/libc/sysdeps/linux/common/setfsuid.c index 698117a1a..a7372bd29 100644 --- a/libc/sysdeps/linux/common/setfsuid.c +++ b/libc/sysdeps/linux/common/setfsuid.c @@ -17,12 +17,12 @@ # define __NR_setfsuid __NR_setfsuid32 # endif -_syscall1(int, setfsuid, uid_t, uid); +_syscall1(int, setfsuid, uid_t, uid) #else # define __NR___syscall_setfsuid __NR_setfsuid -static __inline__ _syscall1(int, __syscall_setfsuid, __kernel_uid_t, uid); +static __inline__ _syscall1(int, __syscall_setfsuid, __kernel_uid_t, uid) int setfsuid(uid_t uid) { diff --git a/libc/sysdeps/linux/common/setgid.c b/libc/sysdeps/linux/common/setgid.c index 37175cd7c..88341ba86 100644 --- a/libc/sysdeps/linux/common/setgid.c +++ b/libc/sysdeps/linux/common/setgid.c @@ -17,12 +17,12 @@ # define __NR_setgid __NR_setgid32 # endif -_syscall1(int, setgid, gid_t, gid); +_syscall1(int, setgid, gid_t, gid) #else # define __NR___syscall_setgid __NR_setgid -static __inline__ _syscall1(int, __syscall_setgid, __kernel_gid_t, gid); +static __inline__ _syscall1(int, __syscall_setgid, __kernel_gid_t, gid) int setgid(gid_t gid) { diff --git a/libc/sysdeps/linux/common/setgroups.c b/libc/sysdeps/linux/common/setgroups.c index 3c77250d0..d7a94944c 100644 --- a/libc/sysdeps/linux/common/setgroups.c +++ b/libc/sysdeps/linux/common/setgroups.c @@ -14,23 +14,23 @@ #ifdef __USE_BSD -libc_hidden_proto(setgroups) +/* libc_hidden_proto(setgroups) */ #if defined(__NR_setgroups32) # undef __NR_setgroups # define __NR_setgroups __NR_setgroups32 -_syscall2(int, setgroups, size_t, size, const gid_t *, list); +_syscall2(int, setgroups, size_t, size, const gid_t *, list) #elif __WORDSIZE == 64 -_syscall2(int, setgroups, size_t, size, const gid_t *, list); +_syscall2(int, setgroups, size_t, size, const gid_t *, list) #else -libc_hidden_proto(sysconf) +/* libc_hidden_proto(sysconf) */ #define __NR___syscall_setgroups __NR_setgroups static __inline__ _syscall2(int, __syscall_setgroups, - size_t, size, const __kernel_gid_t *, list); + size_t, size, const __kernel_gid_t *, list) int setgroups(size_t size, const gid_t *groups) { diff --git a/libc/sysdeps/linux/common/sethostname.c b/libc/sysdeps/linux/common/sethostname.c index 6bd4c2362..1ceb2a089 100644 --- a/libc/sysdeps/linux/common/sethostname.c +++ b/libc/sysdeps/linux/common/sethostname.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <unistd.h> #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98) -_syscall2(int, sethostname, const char *, name, size_t, len); +_syscall2(int, sethostname, const char *, name, size_t, len) #endif diff --git a/libc/sysdeps/linux/common/setitimer.c b/libc/sysdeps/linux/common/setitimer.c index ca9db82d2..df65808d2 100644 --- a/libc/sysdeps/linux/common/setitimer.c +++ b/libc/sysdeps/linux/common/setitimer.c @@ -10,8 +10,8 @@ #include <sys/syscall.h> #include <sys/time.h> -libc_hidden_proto(setitimer) +/* libc_hidden_proto(setitimer) */ _syscall3(int, setitimer, __itimer_which_t, which, - const struct itimerval *, new, struct itimerval *, old); + const struct itimerval *, new, struct itimerval *, old) libc_hidden_def(setitimer) diff --git a/libc/sysdeps/linux/common/setpgid.c b/libc/sysdeps/linux/common/setpgid.c index f91908ded..664da1ad2 100644 --- a/libc/sysdeps/linux/common/setpgid.c +++ b/libc/sysdeps/linux/common/setpgid.c @@ -12,11 +12,11 @@ #if defined __USE_UNIX98 || defined __USE_SVID #include <unistd.h> -libc_hidden_proto(setpgid) +/* libc_hidden_proto(setpgid) */ #define __NR___syscall_setpgid __NR_setpgid static __inline__ _syscall2(int, __syscall_setpgid, - __kernel_pid_t, pid, __kernel_pid_t, pgid); + __kernel_pid_t, pid, __kernel_pid_t, pgid) int setpgid(pid_t pid, pid_t pgid) { diff --git a/libc/sysdeps/linux/common/setpgrp.c b/libc/sysdeps/linux/common/setpgrp.c index 38300dc2e..9f71aa26f 100644 --- a/libc/sysdeps/linux/common/setpgrp.c +++ b/libc/sysdeps/linux/common/setpgrp.c @@ -7,7 +7,7 @@ #include <syscall.h> #include <unistd.h> -libc_hidden_proto(setpgid) +/* libc_hidden_proto(setpgid) */ int setpgrp(void) { diff --git a/libc/sysdeps/linux/common/setpriority.c b/libc/sysdeps/linux/common/setpriority.c index 6674494ab..3b98c3f58 100644 --- a/libc/sysdeps/linux/common/setpriority.c +++ b/libc/sysdeps/linux/common/setpriority.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <sys/resource.h> -libc_hidden_proto(setpriority) +/* libc_hidden_proto(setpriority) */ -_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio); +_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio) libc_hidden_def(setpriority) diff --git a/libc/sysdeps/linux/common/setregid.c b/libc/sysdeps/linux/common/setregid.c index 3fe95d9d0..332599431 100644 --- a/libc/sysdeps/linux/common/setregid.c +++ b/libc/sysdeps/linux/common/setregid.c @@ -11,7 +11,7 @@ #include <unistd.h> #include <bits/wordsize.h> -libc_hidden_proto(setregid) +/* libc_hidden_proto(setregid) */ #if (__WORDSIZE == 32 && defined(__NR_setregid32)) || __WORDSIZE == 64 # ifdef __NR_setregid32 @@ -19,13 +19,13 @@ libc_hidden_proto(setregid) # define __NR_setregid __NR_setregid32 # endif -_syscall2(int, setregid, gid_t, rgid, gid_t, egid); +_syscall2(int, setregid, gid_t, rgid, gid_t, egid) #else # define __NR___syscall_setregid __NR_setregid static __inline__ _syscall2(int, __syscall_setregid, - __kernel_gid_t, rgid, __kernel_gid_t, egid); + __kernel_gid_t, rgid, __kernel_gid_t, egid) int setregid(gid_t rgid, gid_t egid) { diff --git a/libc/sysdeps/linux/common/setresgid.c b/libc/sysdeps/linux/common/setresgid.c index 13e4b1d6d..e99708e0d 100644 --- a/libc/sysdeps/linux/common/setresgid.c +++ b/libc/sysdeps/linux/common/setresgid.c @@ -15,7 +15,7 @@ # undef __NR_setresgid # define __NR_setresgid __NR_setresgid32 -libc_hidden_proto(setresgid) +/* libc_hidden_proto(setresgid) */ _syscall3(int, setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) libc_hidden_def(setresgid) @@ -23,9 +23,9 @@ libc_hidden_def(setresgid) # define __NR___syscall_setresgid __NR_setresgid static __inline__ _syscall3(int, __syscall_setresgid, - __kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid); + __kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid) -libc_hidden_proto(setresgid) +/* libc_hidden_proto(setresgid) */ int setresgid(gid_t rgid, gid_t egid, gid_t sgid) { if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U)) diff --git a/libc/sysdeps/linux/common/setresuid.c b/libc/sysdeps/linux/common/setresuid.c index 764b90523..c1e395a40 100644 --- a/libc/sysdeps/linux/common/setresuid.c +++ b/libc/sysdeps/linux/common/setresuid.c @@ -15,7 +15,7 @@ # undef __NR_setresuid # define __NR_setresuid __NR_setresuid32 -libc_hidden_proto(setresuid) +/* libc_hidden_proto(setresuid) */ _syscall3(int, setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) libc_hidden_def(setresuid) @@ -23,9 +23,9 @@ libc_hidden_def(setresuid) # define __NR___syscall_setresuid __NR_setresuid static __inline__ _syscall3(int, __syscall_setresuid, - __kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid); + __kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid) -libc_hidden_proto(setresuid) +/* libc_hidden_proto(setresuid) */ int setresuid(uid_t ruid, uid_t euid, uid_t suid) { if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U)) diff --git a/libc/sysdeps/linux/common/setreuid.c b/libc/sysdeps/linux/common/setreuid.c index bca7f8f43..bb7b6a9c5 100644 --- a/libc/sysdeps/linux/common/setreuid.c +++ b/libc/sysdeps/linux/common/setreuid.c @@ -11,7 +11,7 @@ #include <unistd.h> #include <bits/wordsize.h> -libc_hidden_proto(setreuid) +/* libc_hidden_proto(setreuid) */ #if (__WORDSIZE == 32 && defined(__NR_setreuid32)) || __WORDSIZE == 64 # ifdef __NR_setreuid32 @@ -19,13 +19,13 @@ libc_hidden_proto(setreuid) # define __NR_setreuid __NR_setreuid32 # endif -_syscall2(int, setreuid, uid_t, ruid, uid_t, euid); +_syscall2(int, setreuid, uid_t, ruid, uid_t, euid) #else # define __NR___syscall_setreuid __NR_setreuid static __inline__ _syscall2(int, __syscall_setreuid, - __kernel_uid_t, ruid, __kernel_uid_t, euid); + __kernel_uid_t, ruid, __kernel_uid_t, euid) int setreuid(uid_t ruid, uid_t euid) { diff --git a/libc/sysdeps/linux/common/setrlimit.c b/libc/sysdeps/linux/common/setrlimit.c index ce9fe2275..87f96cb21 100644 --- a/libc/sysdeps/linux/common/setrlimit.c +++ b/libc/sysdeps/linux/common/setrlimit.c @@ -13,7 +13,7 @@ #include <sys/resource.h> #undef setrlimit64 -libc_hidden_proto(setrlimit) +/* libc_hidden_proto(setrlimit) */ /* Only wrap setrlimit if the new usetrlimit is not present and setrlimit sucks */ @@ -21,9 +21,9 @@ libc_hidden_proto(setrlimit) /* just call usetrlimit() */ # define __NR___syscall_usetrlimit __NR_usetrlimit -static inline +static __always_inline _syscall2(int, __syscall_usetrlimit, enum __rlimit_resource, resource, - const struct rlimit *, rlim); + const struct rlimit *, rlim) int setrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { return (__syscall_usetrlimit(resource, rlimits)); @@ -33,14 +33,14 @@ int setrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) /* We don't need to wrap setrlimit() */ _syscall2(int, setrlimit, __rlimit_resource_t, resource, - const struct rlimit *, rlim); + const struct rlimit *, rlim) #else /* we have to handle old style setrlimit() */ # define __NR___syscall_setrlimit __NR_setrlimit -static inline -_syscall2(int, __syscall_setrlimit, int, resource, const struct rlimit *, rlim); +static __always_inline +_syscall2(int, __syscall_setrlimit, int, resource, const struct rlimit *, rlim) int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits) { diff --git a/libc/sysdeps/linux/common/setrlimit64.c b/libc/sysdeps/linux/common/setrlimit64.c index 90b8eebd7..3233ed696 100644 --- a/libc/sysdeps/linux/common/setrlimit64.c +++ b/libc/sysdeps/linux/common/setrlimit64.c @@ -26,7 +26,7 @@ #if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32 -libc_hidden_proto(setrlimit) +/* libc_hidden_proto(setrlimit) */ /* Set the soft and hard limits for RESOURCE to *RLIMITS. Only the super-user can increase hard limits. diff --git a/libc/sysdeps/linux/common/setsid.c b/libc/sysdeps/linux/common/setsid.c index 7e5bd33a4..d0fc9b010 100644 --- a/libc/sysdeps/linux/common/setsid.c +++ b/libc/sysdeps/linux/common/setsid.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(setsid) +/* libc_hidden_proto(setsid) */ -_syscall0(pid_t, setsid); +_syscall0(pid_t, setsid) libc_hidden_def(setsid) diff --git a/libc/sysdeps/linux/common/settimeofday.c b/libc/sysdeps/linux/common/settimeofday.c index 7f7c24d26..361eb3532 100644 --- a/libc/sysdeps/linux/common/settimeofday.c +++ b/libc/sysdeps/linux/common/settimeofday.c @@ -12,9 +12,9 @@ #ifdef __USE_BSD -libc_hidden_proto(settimeofday) +/* libc_hidden_proto(settimeofday) */ _syscall2(int, settimeofday, const struct timeval *, tv, - const struct timezone *, tz); + const struct timezone *, tz) libc_hidden_def(settimeofday) #endif diff --git a/libc/sysdeps/linux/common/setuid.c b/libc/sysdeps/linux/common/setuid.c index 32a4cd79e..7fd8c65e6 100644 --- a/libc/sysdeps/linux/common/setuid.c +++ b/libc/sysdeps/linux/common/setuid.c @@ -17,12 +17,12 @@ # define __NR_setuid __NR_setuid32 # endif -_syscall1(int, setuid, uid_t, uid); +_syscall1(int, setuid, uid_t, uid) #else # define __NR___syscall_setuid __NR_setuid -static __inline__ _syscall1(int, __syscall_setuid, __kernel_uid_t, uid); +static __inline__ _syscall1(int, __syscall_setuid, __kernel_uid_t, uid) int setuid(uid_t uid) { diff --git a/libc/sysdeps/linux/common/sigaltstack.c b/libc/sysdeps/linux/common/sigaltstack.c index 0c9308408..964e16f99 100644 --- a/libc/sysdeps/linux/common/sigaltstack.c +++ b/libc/sysdeps/linux/common/sigaltstack.c @@ -13,5 +13,5 @@ #if defined __NR_sigaltstack && (defined __USE_BSD || defined __USE_UNIX98) _syscall2(int, sigaltstack, const struct sigaltstack *, ss, - struct sigaltstack *, oss); + struct sigaltstack *, oss) #endif diff --git a/libc/sysdeps/linux/common/signalfd.c b/libc/sysdeps/linux/common/signalfd.c new file mode 100644 index 000000000..3d76e04c4 --- /dev/null +++ b/libc/sysdeps/linux/common/signalfd.c @@ -0,0 +1,41 @@ +/* vi: set sw=4 ts=4: */ +/* + * signalfd() for uClibc + * + * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <sys/syscall.h> +#include <signal.h> +#include <sys/signalfd.h> + +#if defined __NR_signalfd4 +#define __NR___syscall_signalfd4 __NR_signalfd4 +static __inline__ _syscall4(int, __syscall_signalfd4, int, fd, + const sigset_t *, mask, size_t, sizemask, int, flags) +#elif defined __NR_signalfd +#define __NR___syscall_signalfd __NR_signalfd +static __inline__ _syscall3(int, __syscall_signalfd, int, fd, + const sigset_t *, mask, size_t, sizemask) +#endif + +#if defined __NR_signalfd4 || defined __NR_signalfd \ + || defined __UCLIBC_HAS_STUBS__ +int signalfd (int fd, const sigset_t *mask, int flags) +{ +#if defined __NR___syscall_signalfd4 + return __syscall_signalfd4(fd, mask, _NSIG / 8, flags); +#elif defined __NR___syscall_signalfd + if (flags != 0) { + __set_errno(EINVAL); + return -1; + } + return __syscall_signalfd(fd, mask, _NSIG / 8); +#elif defined __UCLIBC_HAS_STUBS__ + __set_errno(ENOSYS); + return -1; +#endif +} +#endif diff --git a/libc/sysdeps/linux/common/sigpending.c b/libc/sysdeps/linux/common/sigpending.c index 0a74afaa4..8fa2a5125 100644 --- a/libc/sysdeps/linux/common/sigpending.c +++ b/libc/sysdeps/linux/common/sigpending.c @@ -15,13 +15,13 @@ #ifdef __NR_rt_sigpending # define __NR___rt_sigpending __NR_rt_sigpending -static __inline__ _syscall2(int, __rt_sigpending, sigset_t *, set, size_t, size); +static __inline__ _syscall2(int, __rt_sigpending, sigset_t *, set, size_t, size) int sigpending(sigset_t * set) { return __rt_sigpending(set, _NSIG / 8); } #else -_syscall1(int, sigpending, sigset_t *, set); +_syscall1(int, sigpending, sigset_t *, set) #endif #endif diff --git a/libc/sysdeps/linux/common/sigqueue.c b/libc/sysdeps/linux/common/sigqueue.c index 2bff597c1..d610e8f6a 100644 --- a/libc/sysdeps/linux/common/sigqueue.c +++ b/libc/sysdeps/linux/common/sigqueue.c @@ -24,14 +24,14 @@ #include <sys/syscall.h> #if defined __USE_POSIX199309 -libc_hidden_proto(getpid) -libc_hidden_proto(getuid) +/* libc_hidden_proto(getpid) */ +/* libc_hidden_proto(getuid) */ /* Experimentally off - libc_hidden_proto(memset) */ #ifdef __NR_rt_sigqueueinfo # define __NR___libc_rt_sigqueueinfo __NR_rt_sigqueueinfo -static __inline__ _syscall3(int, __libc_rt_sigqueueinfo, pid_t, pid, int, sig, void*, value); +static __inline__ _syscall3(int, __libc_rt_sigqueueinfo, pid_t, pid, int, sig, void*, value) /* Return any pending signal or wait for one for the given time. */ int sigqueue (pid_t pid, int sig, const union sigval val) diff --git a/libc/sysdeps/linux/common/splice.c b/libc/sysdeps/linux/common/splice.c index 7e8f4e3e0..b21d10336 100644 --- a/libc/sysdeps/linux/common/splice.c +++ b/libc/sysdeps/linux/common/splice.c @@ -10,11 +10,9 @@ #include <sys/syscall.h> #include <fcntl.h> -libc_hidden_proto(splice) - #ifdef __NR_splice _syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout, - __off64_t *, __offout, size_t, __len, unsigned int, __flags); + __off64_t *, __offout, size_t, __len, unsigned int, __flags) #else ssize_t splice(int __fdin, __off64_t *__offin, int __fdout, __off64_t *__offout, size_t __len, unsigned int __flags) @@ -23,6 +21,3 @@ ssize_t splice(int __fdin, __off64_t *__offin, int __fdout, return -1; } #endif - -libc_hidden_def(splice) - diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c index d8088ef60..73d7113b8 100644 --- a/libc/sysdeps/linux/common/ssp.c +++ b/libc/sysdeps/linux/common/ssp.c @@ -29,21 +29,22 @@ #include <string.h> #include <unistd.h> #include <signal.h> +#if defined __UCLIBC_HAS_SYSLOG__ #include <sys/syslog.h> -/* Experimentally off - libc_hidden_proto(memset) */ -/* Experimentally off - libc_hidden_proto(strlen) */ -libc_hidden_proto(sigaction) -libc_hidden_proto(sigfillset) -libc_hidden_proto(sigdelset) -libc_hidden_proto(sigprocmask) -libc_hidden_proto(write) -libc_hidden_proto(openlog) -libc_hidden_proto(syslog) -libc_hidden_proto(closelog) -libc_hidden_proto(kill) -libc_hidden_proto(getpid) -libc_hidden_proto(_exit) +/* libc_hidden_proto(openlog) */ +/* libc_hidden_proto(syslog) */ +/* libc_hidden_proto(closelog) */ +#endif + +/* libc_hidden_proto(sigaction) */ +/* libc_hidden_proto(sigfillset) */ +/* libc_hidden_proto(sigdelset) */ +/* libc_hidden_proto(sigprocmask) */ +/* libc_hidden_proto(write) */ +/* libc_hidden_proto(kill) */ +/* libc_hidden_proto(getpid) */ +/* libc_hidden_proto(_exit) */ static void block_signals(void) { @@ -63,15 +64,17 @@ static void block_signals(void) sigaction(SSP_SIGTYPE, &sa, NULL); } -static void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3) +static void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3) __cold { write(fd, msg1, strlen(msg1)); write(fd, msg2, strlen(msg2)); write(fd, msg3, strlen(msg3)); write(fd, "()\n", 3); +#if defined __UCLIBC_HAS_SYSLOG__ openlog("ssp", LOG_CONS | LOG_PID, LOG_USER); syslog(LOG_INFO, "%s%s%s()", msg1, msg2, msg3); closelog(); +#endif } static attribute_noreturn void terminate(void) @@ -80,7 +83,7 @@ static attribute_noreturn void terminate(void) _exit(127); } -void __stack_smash_handler(char func[], int damaged __attribute__ ((unused))) attribute_noreturn; +void __stack_smash_handler(char func[], int damaged __attribute__ ((unused))) attribute_noreturn __cold; void __stack_smash_handler(char func[], int damaged) { static const char message[] = ": stack smashing attack in function "; @@ -94,7 +97,7 @@ void __stack_smash_handler(char func[], int damaged) terminate(); } -void __stack_chk_fail(void) attribute_noreturn; +void __stack_chk_fail(void) attribute_noreturn __cold; void __stack_chk_fail(void) { static const char msg1[] = "stack smashing detected: "; diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c index 78211334e..d563bcd88 100644 --- a/libc/sysdeps/linux/common/stat.c +++ b/libc/sysdeps/linux/common/stat.c @@ -18,12 +18,12 @@ #undef stat64 -libc_hidden_proto(stat) +/* libc_hidden_proto(stat) */ #define __NR___syscall_stat __NR_stat #undef stat static __inline__ _syscall2(int, __syscall_stat, - const char *, file_name, struct kernel_stat *, buf); + const char *, file_name, struct kernel_stat *, buf) int stat(const char *file_name, struct stat *buf) { @@ -40,7 +40,7 @@ libc_hidden_def(stat) #if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__ extern __typeof(stat) stat64; -libc_hidden_proto(stat64) +/* libc_hidden_proto(stat64) */ strong_alias(stat,stat64) libc_hidden_def(stat64) #endif diff --git a/libc/sysdeps/linux/common/stat64.c b/libc/sysdeps/linux/common/stat64.c index 1a0865686..11f836bac 100644 --- a/libc/sysdeps/linux/common/stat64.c +++ b/libc/sysdeps/linux/common/stat64.c @@ -11,15 +11,14 @@ #include <sys/stat.h> #if defined __UCLIBC_HAS_LFS__ && defined __NR_stat64 -libc_hidden_proto(stat64) +/* libc_hidden_proto(stat64) */ # define __NR___syscall_stat64 __NR_stat64 # include <unistd.h> -# include <sys/stat.h> # include "xstatconv.h" static __inline__ _syscall2(int, __syscall_stat64, - const char *, file_name, struct kernel_stat64 *, buf); + const char *, file_name, struct kernel_stat64 *, buf) int stat64(const char *file_name, struct stat64 *buf) { diff --git a/libc/sysdeps/linux/common/statfs.c b/libc/sysdeps/linux/common/statfs.c index 38c277fad..2f8548d0d 100644 --- a/libc/sysdeps/linux/common/statfs.c +++ b/libc/sysdeps/linux/common/statfs.c @@ -12,14 +12,10 @@ #include <sys/param.h> #include <sys/vfs.h> -extern __typeof(statfs) __libc_statfs; -libc_hidden_proto(__libc_statfs) +extern __typeof(statfs) __libc_statfs attribute_hidden; #define __NR___libc_statfs __NR_statfs -_syscall2(int, __libc_statfs, const char *, path, struct statfs *, buf); -libc_hidden_def(__libc_statfs) +_syscall2(int, __libc_statfs, const char *, path, struct statfs *, buf) #if defined __UCLIBC_LINUX_SPECIFIC__ -libc_hidden_proto(statfs) weak_alias(__libc_statfs,statfs) -libc_hidden_weak(statfs) #endif diff --git a/libc/sysdeps/linux/common/stime.c b/libc/sysdeps/linux/common/stime.c index af8595533..de060c8a2 100644 --- a/libc/sysdeps/linux/common/stime.c +++ b/libc/sysdeps/linux/common/stime.c @@ -13,9 +13,9 @@ #ifdef __USE_SVID #ifdef __NR_stime -_syscall1(int, stime, const time_t *, t); +_syscall1(int, stime, const time_t *, t) #else -libc_hidden_proto(settimeofday) +/* libc_hidden_proto(settimeofday) */ int stime(const time_t * when) { diff --git a/libc/sysdeps/linux/common/swapoff.c b/libc/sysdeps/linux/common/swapoff.c index a0de283ed..db0b9befc 100644 --- a/libc/sysdeps/linux/common/swapoff.c +++ b/libc/sysdeps/linux/common/swapoff.c @@ -12,6 +12,6 @@ #ifdef __NR_swapoff #include <sys/swap.h> -_syscall1(int, swapoff, const char *, path); +_syscall1(int, swapoff, const char *, path) #endif diff --git a/libc/sysdeps/linux/common/swapon.c b/libc/sysdeps/linux/common/swapon.c index e9ffb6347..5d6b6e2de 100644 --- a/libc/sysdeps/linux/common/swapon.c +++ b/libc/sysdeps/linux/common/swapon.c @@ -12,6 +12,6 @@ #ifdef __NR_swapon #include <sys/swap.h> -_syscall2(int, swapon, const char *, path, int, swapflags); +_syscall2(int, swapon, const char *, path, int, swapflags) #endif diff --git a/libc/sysdeps/linux/common/symlink.c b/libc/sysdeps/linux/common/symlink.c index 97f34eb8f..e53e8d413 100644 --- a/libc/sysdeps/linux/common/symlink.c +++ b/libc/sysdeps/linux/common/symlink.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K #include <unistd.h> -_syscall2(int, symlink, const char *, oldpath, const char *, newpath); +_syscall2(int, symlink, const char *, oldpath, const char *, newpath) #endif diff --git a/libc/sysdeps/linux/common/sync.c b/libc/sysdeps/linux/common/sync.c index d2f81229c..e663c5886 100644 --- a/libc/sysdeps/linux/common/sync.c +++ b/libc/sysdeps/linux/common/sync.c @@ -15,7 +15,7 @@ #ifndef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) __syscall_sync (args) #define __NR___syscall_sync __NR_sync -static __inline__ _syscall0(void, __syscall_sync); +static __inline__ _syscall0(void, __syscall_sync) #endif void sync(void) diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c new file mode 100644 index 000000000..7e2deff41 --- /dev/null +++ b/libc/sysdeps/linux/common/sync_file_range.c @@ -0,0 +1,33 @@ +/* vi: set sw=4 ts=4: */ +/* + * sync_file_range() for uClibc + * + * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <sys/syscall.h> +#if defined __USE_GNU +#include <fcntl.h> + +#if defined __NR_sync_file_range && defined __UCLIBC_HAS_LFS__ +#define __NR___syscall_sync_file_range __NR_sync_file_range +static __inline__ _syscall6(int, __syscall_sync_file_range, int, fd, + off_t, offset_hi, off_t, offset_lo, + off_t, nbytes_hi, off_t, nbytes_lo, unsigned int, flags) +int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags) +{ + return __syscall_sync_file_range(fd, + __LONG_LONG_PAIR((long)(offset >> 32), (long)(offset & 0xffffffff)), + __LONG_LONG_PAIR((long)(nbytes >> 32), (long)(nbytes & 0xffffffff)), + flags); +} +#elif defined __UCLIBC_HAS_STUBS__ +int sync_file_range(int fd, __off64_t offset, __off64_t nbytes, unsigned int flags) +{ + __set_errno(ENOSYS); + return -1; +} +#endif +#endif diff --git a/libc/sysdeps/linux/common/sysctl.c b/libc/sysdeps/linux/common/sysctl.c index adee22837..11d53cd8e 100644 --- a/libc/sysdeps/linux/common/sysctl.c +++ b/libc/sysdeps/linux/common/sysctl.c @@ -24,8 +24,8 @@ struct __sysctl_args { unsigned long __unused[4]; }; -static inline -_syscall1(int, _sysctl, struct __sysctl_args *, args); +static __always_inline +_syscall1(int, _sysctl, struct __sysctl_args *, args) int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp, void *newval, size_t newlen) diff --git a/libc/sysdeps/linux/common/sysfs.c b/libc/sysdeps/linux/common/sysfs.c index a4292f768..02f37d78d 100644 --- a/libc/sysdeps/linux/common/sysfs.c +++ b/libc/sysdeps/linux/common/sysfs.c @@ -12,6 +12,6 @@ #include <sys/syscall.h> #if defined __USE_SVID -_syscall3(int, sysfs, int, option, unsigned int, index, char, addr); +_syscall3(int, sysfs, int, option, unsigned int, index, char, addr) #endif #endif diff --git a/libc/sysdeps/linux/common/sysinfo.c b/libc/sysdeps/linux/common/sysinfo.c index 78bf75150..fc37aaff6 100644 --- a/libc/sysdeps/linux/common/sysinfo.c +++ b/libc/sysdeps/linux/common/sysinfo.c @@ -9,4 +9,4 @@ #include <sys/syscall.h> #include <sys/sysinfo.h> -_syscall1(int, sysinfo, struct sysinfo *, info); +_syscall1(int, sysinfo, struct sysinfo *, info) diff --git a/libc/sysdeps/linux/common/tee.c b/libc/sysdeps/linux/common/tee.c index 6725e82bb..504776716 100644 --- a/libc/sysdeps/linux/common/tee.c +++ b/libc/sysdeps/linux/common/tee.c @@ -12,5 +12,5 @@ #ifdef __NR_tee _syscall4(ssize_t, tee, int, __fdin, int, __fdout, size_t, __len, - unsigned int, __flags); + unsigned int, __flags) #endif diff --git a/libc/sysdeps/linux/common/time.c b/libc/sysdeps/linux/common/time.c index a7aa153d4..a40d8fc53 100644 --- a/libc/sysdeps/linux/common/time.c +++ b/libc/sysdeps/linux/common/time.c @@ -14,9 +14,9 @@ /* Experimentally off - libc_hidden_proto(time) */ #ifdef __NR_time -_syscall1(time_t, time, time_t *, t); +_syscall1(time_t, time, time_t *, t) #else -libc_hidden_proto(gettimeofday) +/* libc_hidden_proto(gettimeofday) */ time_t time(time_t * t) { diff --git a/libc/sysdeps/linux/common/times.c b/libc/sysdeps/linux/common/times.c index a68a2981f..a0644ef1f 100644 --- a/libc/sysdeps/linux/common/times.c +++ b/libc/sysdeps/linux/common/times.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <sys/times.h> -libc_hidden_proto(times) +/* libc_hidden_proto(times) */ -_syscall1(clock_t, times, struct tms *, buf); +_syscall1(clock_t, times, struct tms *, buf) libc_hidden_def(times) diff --git a/libc/sysdeps/linux/common/truncate.c b/libc/sysdeps/linux/common/truncate.c index 5ae8749ed..22da552da 100644 --- a/libc/sysdeps/linux/common/truncate.c +++ b/libc/sysdeps/linux/common/truncate.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(truncate) +/* libc_hidden_proto(truncate) */ -_syscall2(int, truncate, const char *, path, __off_t, length); +_syscall2(int, truncate, const char *, path, __off_t, length) libc_hidden_def(truncate) diff --git a/libc/sysdeps/linux/common/truncate64.c b/libc/sysdeps/linux/common/truncate64.c index d4a1798fe..40989334f 100644 --- a/libc/sysdeps/linux/common/truncate64.c +++ b/libc/sysdeps/linux/common/truncate64.c @@ -25,7 +25,7 @@ #if __WORDSIZE == 64 /* For a 64 bit machine, life is simple... */ -_syscall2(int, truncate64, const char *, path, __off64_t, length); +_syscall2(int, truncate64, const char *, path, __off64_t, length) #elif __WORDSIZE == 32 @@ -34,10 +34,10 @@ _syscall2(int, truncate64, const char *, path, __off64_t, length); #define __NR___syscall_truncate64 __NR_truncate64 #if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__) static __inline__ _syscall4(int, __syscall_truncate64, const char *, path, - uint32_t, pad, unsigned long, high_length, unsigned long, low_length); + uint32_t, pad, unsigned long, high_length, unsigned long, low_length) #else static __inline__ _syscall3(int, __syscall_truncate64, const char *, path, - unsigned long, high_length, unsigned long, low_length); + unsigned long, high_length, unsigned long, low_length) #endif #endif @@ -62,7 +62,7 @@ int truncate64 (const char * path, __off64_t length) #else /* __NR_truncate64 */ -libc_hidden_proto(truncate) +/* libc_hidden_proto(truncate) */ int truncate64 (const char * path, __off64_t length) { diff --git a/libc/sysdeps/linux/common/ulimit.c b/libc/sysdeps/linux/common/ulimit.c index 2a1c88081..3c1a0cc1c 100644 --- a/libc/sysdeps/linux/common/ulimit.c +++ b/libc/sysdeps/linux/common/ulimit.c @@ -10,7 +10,7 @@ #ifdef __NR_ulimit extern long int ulimit(int cmd, long arg); -_syscall2(long, ulimit, int, cmd, long, arg); +_syscall2(long, ulimit, int, cmd, long, arg) #else @@ -19,9 +19,9 @@ _syscall2(long, ulimit, int, cmd, long, arg); #include <ulimit.h> #include <sys/resource.h> -libc_hidden_proto(sysconf) -libc_hidden_proto(getrlimit) -libc_hidden_proto(setrlimit) +/* libc_hidden_proto(sysconf) */ +/* libc_hidden_proto(getrlimit) */ +/* libc_hidden_proto(setrlimit) */ long int ulimit(int cmd, ...) { diff --git a/libc/sysdeps/linux/common/umask.c b/libc/sysdeps/linux/common/umask.c index 01a7b9eb3..ef9860e31 100644 --- a/libc/sysdeps/linux/common/umask.c +++ b/libc/sysdeps/linux/common/umask.c @@ -11,7 +11,7 @@ #include <sys/stat.h> #define __NR___syscall_umask __NR_umask -static __inline__ _syscall1(__kernel_mode_t, __syscall_umask, __kernel_mode_t, mode); +static __inline__ _syscall1(__kernel_mode_t, __syscall_umask, __kernel_mode_t, mode) mode_t umask(mode_t mode) { diff --git a/libc/sysdeps/linux/common/umount.c b/libc/sysdeps/linux/common/umount.c index 9090696d5..453ecd27b 100644 --- a/libc/sysdeps/linux/common/umount.c +++ b/libc/sysdeps/linux/common/umount.c @@ -15,13 +15,13 @@ /* arch provides umount() syscall */ #ifdef __NR_umount -_syscall1(int, umount, const char *, specialfile); +_syscall1(int, umount, const char *, specialfile) /* arch provides umount2() syscall */ #elif defined __NR_umount2 # define __NR___syscall_umount2 __NR_umount2 -static __inline__ _syscall2(int, __syscall_umount2, const char *, special_file, int, flags); +static __inline__ _syscall2(int, __syscall_umount2, const char *, special_file, int, flags) int umount(const char *special_file) { diff --git a/libc/sysdeps/linux/common/umount2.c b/libc/sysdeps/linux/common/umount2.c index 25c24d450..bd44717d4 100644 --- a/libc/sysdeps/linux/common/umount2.c +++ b/libc/sysdeps/linux/common/umount2.c @@ -12,7 +12,7 @@ #if defined __USE_GNU #include <sys/mount.h> #ifdef __NR_umount2 /* Old kernels don't have umount2 */ -_syscall2(int, umount2, const char *, special_file, int, flags); +_syscall2(int, umount2, const char *, special_file, int, flags) #else int umount2(const char *special_file, int flags) { diff --git a/libc/sysdeps/linux/common/uname.c b/libc/sysdeps/linux/common/uname.c index 22b870370..1e29b9f23 100644 --- a/libc/sysdeps/linux/common/uname.c +++ b/libc/sysdeps/linux/common/uname.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <sys/utsname.h> -libc_hidden_proto(uname) +/* libc_hidden_proto(uname) */ -_syscall1(int, uname, struct utsname *, buf); +_syscall1(int, uname, struct utsname *, buf) libc_hidden_def(uname) diff --git a/libc/sysdeps/linux/common/unlink.c b/libc/sysdeps/linux/common/unlink.c index 313be9e0b..1ad1f2c6d 100644 --- a/libc/sysdeps/linux/common/unlink.c +++ b/libc/sysdeps/linux/common/unlink.c @@ -10,7 +10,7 @@ #include <sys/syscall.h> #include <unistd.h> -libc_hidden_proto(unlink) +/* libc_hidden_proto(unlink) */ -_syscall1(int, unlink, const char *, pathname); +_syscall1(int, unlink, const char *, pathname) libc_hidden_def(unlink) diff --git a/libc/sysdeps/linux/common/uselib.c b/libc/sysdeps/linux/common/uselib.c index ffc5d77a1..b2b806f39 100644 --- a/libc/sysdeps/linux/common/uselib.c +++ b/libc/sysdeps/linux/common/uselib.c @@ -13,6 +13,6 @@ linux specific and we do not use it in uClibc. #include <unistd.h> #ifdef __NR_uselib int uselib (const char *library); -_syscall1(int, uselib, const char *, library); +_syscall1(int, uselib, const char *, library) #endif #endif diff --git a/libc/sysdeps/linux/common/ustat.c b/libc/sysdeps/linux/common/ustat.c index 578763cb5..09edaa369 100644 --- a/libc/sysdeps/linux/common/ustat.c +++ b/libc/sysdeps/linux/common/ustat.c @@ -13,7 +13,7 @@ #define __NR___syscall_ustat __NR_ustat static __inline__ _syscall2(int, __syscall_ustat, - unsigned short int, kdev_t, struct ustat *, ubuf); + unsigned short int, kdev_t, struct ustat *, ubuf) int ustat(dev_t dev, struct ustat *ubuf) { diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c index 6e35be2c1..f87afcfc4 100644 --- a/libc/sysdeps/linux/common/utime.c +++ b/libc/sysdeps/linux/common/utime.c @@ -10,16 +10,16 @@ #include <sys/syscall.h> #include <utime.h> -libc_hidden_proto(utime) +/* libc_hidden_proto(utime) */ #ifdef __NR_utime -_syscall2(int, utime, const char *, file, const struct utimbuf *, times); +_syscall2(int, utime, const char *, file, const struct utimbuf *, times) #else #include <stdlib.h> #include <sys/time.h> -libc_hidden_proto(utimes) -libc_hidden_proto(gettimeofday) +/* libc_hidden_proto(utimes) */ +/* libc_hidden_proto(gettimeofday) */ int utime(const char *file, const struct utimbuf *times) { diff --git a/libc/sysdeps/linux/common/utimes.c b/libc/sysdeps/linux/common/utimes.c index 83ddb7381..191b1afd8 100644 --- a/libc/sysdeps/linux/common/utimes.c +++ b/libc/sysdeps/linux/common/utimes.c @@ -11,15 +11,14 @@ #include <utime.h> #include <sys/time.h> -libc_hidden_proto(utimes) +/* libc_hidden_proto(utimes) */ #ifdef __NR_utimes -_syscall2(int, utimes, const char *, file, const struct timeval *, tvp); +_syscall2(int, utimes, const char *, file, const struct timeval *, tvp) #else #include <stdlib.h> -#include <sys/time.h> -libc_hidden_proto(utime) +/* libc_hidden_proto(utime) */ int utimes(const char *file, const struct timeval tvp[2]) { diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c index f9634cd5c..eda76aeac 100644 --- a/libc/sysdeps/linux/common/vfork.c +++ b/libc/sysdeps/linux/common/vfork.c @@ -12,14 +12,14 @@ #ifdef __ARCH_USE_MMU__ #ifdef __NR_fork -libc_hidden_proto(fork) +/* libc_hidden_proto(fork) */ extern __typeof(vfork) __vfork attribute_hidden; pid_t __vfork(void) { return fork(); } -libc_hidden_proto(vfork) +/* libc_hidden_proto(vfork) */ weak_alias(__vfork,vfork) libc_hidden_weak(vfork) #endif diff --git a/libc/sysdeps/linux/common/vhangup.c b/libc/sysdeps/linux/common/vhangup.c index 8989a69d6..77910e68f 100644 --- a/libc/sysdeps/linux/common/vhangup.c +++ b/libc/sysdeps/linux/common/vhangup.c @@ -10,5 +10,5 @@ #include <sys/syscall.h> #include <unistd.h> #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98) -_syscall0(int, vhangup); +_syscall0(int, vhangup) #endif diff --git a/libc/sysdeps/linux/common/vmsplice.c b/libc/sysdeps/linux/common/vmsplice.c index a0156d772..c5fd6c7ed 100644 --- a/libc/sysdeps/linux/common/vmsplice.c +++ b/libc/sysdeps/linux/common/vmsplice.c @@ -10,11 +10,9 @@ #include <sys/syscall.h> #include <fcntl.h> -libc_hidden_proto(vmsplice) - #ifdef __NR_vmsplice _syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov, - size_t, __count, unsigned int, __flags); + size_t, __count, unsigned int, __flags) #else ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags) @@ -23,6 +21,3 @@ ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count, return -1; } #endif - -libc_hidden_def(vmsplice) - diff --git a/libc/sysdeps/linux/common/wait3.c b/libc/sysdeps/linux/common/wait3.c index 8a2d43f7a..11985e3db 100644 --- a/libc/sysdeps/linux/common/wait3.c +++ b/libc/sysdeps/linux/common/wait3.c @@ -11,7 +11,7 @@ #if defined __USE_BSD -libc_hidden_proto(wait4) +/* libc_hidden_proto(wait4) */ /* Wait for a child to exit. When one does, put its status in *STAT_LOC and * return its process ID. For errors return (pid_t) -1. If USAGE is not nil, diff --git a/libc/sysdeps/linux/common/write.c b/libc/sysdeps/linux/common/write.c index dbe5c12e6..7776ec955 100644 --- a/libc/sysdeps/linux/common/write.c +++ b/libc/sysdeps/linux/common/write.c @@ -12,8 +12,8 @@ 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) +_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) #if 0 diff --git a/libc/sysdeps/linux/common/xattr.c b/libc/sysdeps/linux/common/xattr.c index 5b4c2f5bf..8a4e3be29 100644 --- a/libc/sysdeps/linux/common/xattr.c +++ b/libc/sysdeps/linux/common/xattr.c @@ -28,7 +28,7 @@ /* sets */ #ifdef __NR_setxattr _syscall5(int, setxattr, const char *, path, const char *, name, - const void *, value, size_t, size, int, flags); + const void *, value, size_t, size, int, flags) #else int setxattr(__const char *__path, __const char *__name, __const void *__value, size_t __size, int __flags) @@ -40,7 +40,7 @@ int setxattr(__const char *__path, __const char *__name, #ifdef __NR_lsetxattr _syscall5(int, lsetxattr, const char *, path, const char *, name, - const void *, value, size_t, size, int, flags); + const void *, value, size_t, size, int, flags) #else int lsetxattr(__const char *__path, __const char *__name, __const void *__value, size_t __size, int __flags) @@ -52,7 +52,7 @@ int lsetxattr(__const char *__path, __const char *__name, #ifdef __NR_fsetxattr _syscall5(int, fsetxattr, int, filedes, const char *, name, const void *, - value, size_t, size, int, flags); + value, size_t, size, int, flags) #else int fsetxattr(int __fd, __const char *__name, __const void *__value, size_t __size, int __flags) @@ -65,7 +65,7 @@ int fsetxattr(int __fd, __const char *__name, __const void *__value, /* gets */ #ifdef __NR_getxattr _syscall4(ssize_t, getxattr, const char *, path, const char *, name, - void *, value, size_t, size); + void *, value, size_t, size) #else ssize_t getxattr(__const char *__path, __const char *__name, void *__value, size_t __size) @@ -77,7 +77,7 @@ ssize_t getxattr(__const char *__path, __const char *__name, void *__value, #ifdef __NR_lgetxattr _syscall4(ssize_t, lgetxattr, const char *, path, const char *, name, - void *, value, size_t, size); + void *, value, size_t, size) #else ssize_t lgetxattr(__const char *__path, __const char *__name, void *__value, size_t __size) @@ -89,7 +89,7 @@ ssize_t lgetxattr(__const char *__path, __const char *__name, #ifdef __NR_fgetxattr _syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *, - value, size_t, size); + value, size_t, size) #else ssize_t fgetxattr(int __fd, __const char *__name, void *__value, size_t __size) @@ -102,7 +102,7 @@ ssize_t fgetxattr(int __fd, __const char *__name, void *__value, /* list */ #ifdef __NR_listxattr _syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t, - size); + size) #else ssize_t listxattr(__const char *__path, char *__list, size_t __size) { @@ -113,7 +113,7 @@ ssize_t listxattr(__const char *__path, char *__list, size_t __size) #ifdef __NR_llistxattr _syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t, - size); + size) #else ssize_t llistxattr(__const char *__path, char *__list, size_t __size) { @@ -123,7 +123,7 @@ ssize_t llistxattr(__const char *__path, char *__list, size_t __size) #endif #ifdef __NR_flistxattr -_syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size); +_syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size) #else ssize_t flistxattr(int __fd, char *__list, size_t __size) { @@ -134,7 +134,7 @@ ssize_t flistxattr(int __fd, char *__list, size_t __size) /* remove */ #ifdef __NR_removexattr -_syscall2(int, removexattr, const char *, path, const char *, name); +_syscall2(int, removexattr, const char *, path, const char *, name) #else int removexattr(__const char *__path, __const char *__name) { @@ -144,7 +144,7 @@ int removexattr(__const char *__path, __const char *__name) #endif #ifdef __NR_lremovexattr -_syscall2(int, lremovexattr, const char *, path, const char *, name); +_syscall2(int, lremovexattr, const char *, path, const char *, name) #else int lremovexattr(__const char *__path, __const char *__name) { @@ -154,7 +154,7 @@ int lremovexattr(__const char *__path, __const char *__name) #endif #ifdef __NR_fremovexattr -_syscall2(int, fremovexattr, int, filedes, const char *, name); +_syscall2(int, fremovexattr, int, filedes, const char *, name) #else int fremovexattr(int __fd, __const char *__name) { |