OSDN Git Service

psm updates: add __libc symbols for signal cancellation
authorMike Frysinger <vapier@gentoo.org>
Wed, 23 Aug 2006 23:25:34 +0000 (23:25 -0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 23 Aug 2006 23:25:34 +0000 (23:25 -0000)
libc/sysdeps/linux/common/creat64.c
libc/sysdeps/linux/common/ioctl.c
libc/sysdeps/linux/common/open.c
libc/sysdeps/linux/common/open64.c
libc/sysdeps/linux/common/poll.c
libc/sysdeps/linux/common/pselect.c
libc/sysdeps/linux/common/readv.c
libc/sysdeps/linux/common/select.c
libc/sysdeps/linux/common/sigsuspend.c
libc/sysdeps/linux/common/writev.c

index c1f2508..f5f0018 100644 (file)
 #include <fcntl.h>
 #include <sys/types.h>
 
-libc_hidden_proto(open64)
+extern __typeof(open64) __libc_open64;
+libc_hidden_proto(__libc_open64)
+extern __typeof(creat64) __libc_creat64;
 
 /* Create FILE with protections MODE.  */
-int creat64 (const char *file, mode_t mode)
+int __libc_creat64 (const char *file, mode_t mode)
 {
-    return open64 (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+    return __libc_open64 (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
 }
+weak_alias(__libc_creat64,creat64)
 #endif /* __UCLIBC_HAS_LFS__ */
index e8e3a10..e4e710a 100644 (file)
@@ -15,7 +15,7 @@ libc_hidden_proto(ioctl)
 
 #define __NR___syscall_ioctl __NR_ioctl
 static inline
-_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg);
+_syscall3(int, __syscall_ioctl, int, fd, int, request, void *, arg);
 
 int ioctl(int fd, unsigned long int request, ...)
 {
index 822ac4f..580876a 100644 (file)
 #include <sys/param.h>
 
 extern __typeof(open) __libc_open;
-libc_hidden_proto(__libc_open)
+extern __typeof(creat) __libc_creat;
 
 #define __NR___syscall_open __NR_open
 static inline _syscall3(int, __syscall_open, const char *, file,
                int, flags, __kernel_mode_t, mode);
 
+libc_hidden_proto(__libc_open)
 int __libc_open(const char *file, int flags, ...)
 {
        /* gcc may warn about mode being uninitialized.
@@ -42,7 +43,8 @@ libc_hidden_proto(open)
 weak_alias(__libc_open,open)
 libc_hidden_weak(open)
 
-int creat(const char *file, mode_t mode)
+int __libc_creat(const char *file, mode_t mode)
 {
        return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
 }
+weak_alias(__libc_creat,creat)
index 81480f8..93a27e9 100644 (file)
@@ -20,6 +20,7 @@ libc_hidden_proto(__libc_open)
 
 /* Open FILE with access OFLAG.  If OFLAG includes O_CREAT,
    a third argument is the file protection.  */
+libc_hidden_proto(__libc_open64)
 int __libc_open64 (const char *file, int oflag, ...)
 {
   int mode = 0;
@@ -34,6 +35,8 @@ int __libc_open64 (const char *file, int oflag, ...)
 
   return __libc_open(file, oflag | O_LARGEFILE, mode);
 }
+libc_hidden_def(__libc_open64)
+
 libc_hidden_proto(open64)
 weak_alias(__libc_open64,open64)
 libc_hidden_weak(open64)
index 00fd708..2512dc4 100644 (file)
 #include "syscalls.h"
 #include <sys/poll.h>
 
-libc_hidden_proto(poll)
+extern __typeof(poll) __libc_poll;
 
 #ifdef __NR_poll
-_syscall3(int, poll, struct pollfd *, fds,
+# define __NR___libc_poll __NR_poll
+_syscall3(int, __libc_poll, struct pollfd *, fds,
        unsigned long int, nfds, int, timeout);
 #else
 
@@ -48,7 +49,7 @@ libc_hidden_proto(select)
    Returns the number of file descriptors with events, zero if timed out,
    or -1 for errors.  */
 
-int poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
 {
     static int max_fd_size;
     struct timeval tv;
@@ -207,4 +208,6 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout)
 }
 
 #endif
-libc_hidden_def(poll)
+libc_hidden_proto(poll)
+weak_alias(__libc_poll,poll)
+libc_hidden_weak(poll)
index 93a85a6..3a958fc 100644 (file)
@@ -23,6 +23,8 @@
 #include <sys/time.h>
 #include <sys/select.h>
 
+extern __typeof(pselect) __libc_pselect;
+
 libc_hidden_proto(sigprocmask)
 libc_hidden_proto(select)
 
@@ -34,7 +36,7 @@ libc_hidden_proto(select)
    SIGMASK for this call.  Returns the number of ready descriptors, or -1 for
    errors.  */
 int
-pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+__libc_pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
           const struct timespec *timeout, const sigset_t *sigmask)
 {
   struct timeval tval;
@@ -64,3 +66,4 @@ pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
 
   return retval;
 }
+weak_alias(__libc_pselect,pselect)
index 040e612..20226f3 100644 (file)
@@ -9,5 +9,10 @@
 
 #include "syscalls.h"
 #include <sys/uio.h>
-_syscall3(ssize_t, readv, int, filedes, const struct iovec *, vector,
+
+extern __typeof(readv) __libc_readv;
+
+#define __NR___libc_readv __NR_readv
+_syscall3(ssize_t, __libc_readv, int, filedes, const struct iovec *, vector,
                  int, count);
+weak_alias(__libc_readv,readv)
index 9a50d19..db03810 100644 (file)
 #include "syscalls.h"
 #include <sys/select.h>
 
-libc_hidden_proto(select)
+extern __typeof(select) __libc_select;
 
 #ifdef __NR__newselect
-# undef __NR_select
-# define __NR_select __NR__newselect
+# define __NR___libc_select __NR__newselect
+#else
+# define __NR___libc_select __NR_select
 #endif
-_syscall5(int, select, int, n, fd_set *, readfds, fd_set *, writefds,
+_syscall5(int, __libc_select, int, n, fd_set *, readfds, fd_set *, writefds,
                  fd_set *, exceptfds, struct timeval *, timeout);
-libc_hidden_def(select)
+libc_hidden_proto(select)
+weak_alias(__libc_select,select)
+libc_hidden_weak(select)
index 7bc3a59..87054e8 100644 (file)
@@ -9,15 +9,14 @@
 
 #include "syscalls.h"
 #include <signal.h>
-#undef sigsuspend
 
-libc_hidden_proto(sigsuspend)
+extern __typeof(sigsuspend) __libc_sigsuspend;
 
 #ifdef __NR_rt_sigsuspend
 # define __NR___rt_sigsuspend __NR_rt_sigsuspend
 static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size);
 
-int sigsuspend(const sigset_t * mask)
+int __libc_sigsuspend(const sigset_t * mask)
 {
        return __rt_sigsuspend(mask, _NSIG / 8);
 }
@@ -26,9 +25,11 @@ int sigsuspend(const sigset_t * mask)
 static inline _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
                  unsigned long int, c);
 
-int sigsuspend(const sigset_t * set)
+int __libc_sigsuspend(const sigset_t * set)
 {
        return __syscall_sigsuspend(0, 0, set->__val[0]);
 }
 #endif
-libc_hidden_def(sigsuspend)
+libc_hidden_proto(sigsuspend)
+weak_alias(__libc_sigsuspend,sigsuspend)
+libc_hidden_weak(sigsuspend)
index 4efff02..4ea9395 100644 (file)
@@ -9,5 +9,10 @@
 
 #include "syscalls.h"
 #include <sys/uio.h>
-_syscall3(ssize_t, writev, int, filedes, const struct iovec *, vector,
+
+extern __typeof(writev) __libc_writev;
+
+#define __NR___libc_writev __NR_writev
+_syscall3(ssize_t, __libc_writev, int, filedes, const struct iovec *, vector,
                  int, count);
+weak_alias(__libc_writev,writev)