svn commit: trunk/uClibc: libc/inet libc/sysdeps/linux/common libc etc...

vda at uclibc.org vda at uclibc.org
Wed Feb 25 11:06:31 UTC 2009


Author: vda
Date: 2009-02-25 11:06:29 +0000 (Wed, 25 Feb 2009)
New Revision: 25449

Log:
Reinstate __libc_foo's needed for linuxthreads.old.
Now they are only enabled if linuxthreads.old are selected.



Modified:
   trunk/uClibc/libc/inet/socketcalls.c
   trunk/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c
   trunk/uClibc/libc/sysdeps/linux/common/close.c
   trunk/uClibc/libc/sysdeps/linux/common/fsync.c
   trunk/uClibc/libc/sysdeps/linux/common/llseek.c
   trunk/uClibc/libc/sysdeps/linux/common/lseek.c
   trunk/uClibc/libc/sysdeps/linux/common/msync.c
   trunk/uClibc/libc/sysdeps/linux/common/nanosleep.c
   trunk/uClibc/libc/sysdeps/linux/common/open.c
   trunk/uClibc/libc/sysdeps/linux/common/open64.c
   trunk/uClibc/libc/sysdeps/linux/common/pause.c
   trunk/uClibc/libc/sysdeps/linux/common/poll.c
   trunk/uClibc/libc/sysdeps/linux/common/read.c
   trunk/uClibc/libc/sysdeps/linux/common/wait.c
   trunk/uClibc/libc/sysdeps/linux/common/waitpid.c
   trunk/uClibc/libc/sysdeps/linux/common/write.c
   trunk/uClibc/libc/termios/tcdrain.c
   trunk/uClibc/libpthread/linuxthreads.old/cancel.c
   trunk/uClibc/libpthread/linuxthreads.old/pthread.c
   trunk/uClibc/libpthread/linuxthreads.old/wrapsyscall.c


Changeset:
Modified: trunk/uClibc/libc/inet/socketcalls.c
===================================================================
--- trunk/uClibc/libc/inet/socketcalls.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/inet/socketcalls.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -35,9 +35,9 @@
 
 
 #ifdef L_accept
-#ifdef __NR_accept
+# ifdef __NR_accept
 _syscall3(int, accept, int, call, struct sockaddr *, addr, socklen_t *,addrlen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 int accept(int s, struct sockaddr *addr, socklen_t * addrlen)
 {
 	unsigned long args[3];
@@ -47,8 +47,13 @@
 	args[2] = (unsigned long) addrlen;
 	return __socketcall(SYS_ACCEPT, args);
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(accept)
+# else
+libc_hidden_weak(accept)
+strong_alias(accept,__libc_accept)
+# endif
 #endif
 
 #ifdef L_bind
@@ -70,9 +75,9 @@
 #endif
 
 #ifdef L_connect
-#ifdef __NR_connect
+# ifdef __NR_connect
 _syscall3(int, connect, int, sockfd, const struct sockaddr *, saddr, socklen_t, addrlen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 int connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen)
 {
 	unsigned long args[3];
@@ -82,8 +87,13 @@
 	args[2] = addrlen;
 	return __socketcall(SYS_CONNECT, args);
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(connect)
+# else
+libc_hidden_weak(connect)
+strong_alias(connect,__libc_connect)
+# endif
 #endif
 
 #ifdef L_getpeername
@@ -157,10 +167,10 @@
 #endif
 
 #ifdef L_recv
-#ifdef __NR_recv
+# ifdef __NR_recv
 _syscall4(ssize_t, recv, int, sockfd, __ptr_t, buffer, size_t, len,
 	int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* recv, recvfrom added by bir7 at leland.stanford.edu */
 ssize_t recv(int sockfd, __ptr_t buffer, size_t len, int flags)
 {
@@ -172,21 +182,25 @@
 	args[3] = flags;
 	return (__socketcall(SYS_RECV, args));
 }
-#elif defined(__NR_recvfrom)
-/* libc_hidden_proto(recvfrom) */
+# elif defined(__NR_recvfrom)
 ssize_t recv(int sockfd, __ptr_t buffer, size_t len, int flags)
 {
 	return (recvfrom(sockfd, buffer, len, flags, NULL, NULL));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(recv)
+# else
+libc_hidden_weak(recv)
+strong_alias(recv,__libc_recv)
+# endif
 #endif
 
 #ifdef L_recvfrom
-#ifdef __NR_recvfrom
+# ifdef __NR_recvfrom
 _syscall6(ssize_t, recvfrom, int, sockfd, __ptr_t, buffer, size_t, len,
 	int, flags, struct sockaddr *, to, socklen_t *, tolen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* recv, recvfrom added by bir7 at leland.stanford.edu */
 ssize_t recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags,
 		 struct sockaddr *to, socklen_t * tolen)
@@ -201,14 +215,19 @@
 	args[5] = (unsigned long) tolen;
 	return (__socketcall(SYS_RECVFROM, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(recvfrom)
+# else
+libc_hidden_weak(recvfrom)
+strong_alias(recvfrom,__libc_recvfrom)
+# endif
 #endif
 
 #ifdef L_recvmsg
-#ifdef __NR_recvmsg
+# ifdef __NR_recvmsg
 _syscall3(ssize_t, recvmsg, int, sockfd, struct msghdr *, msg, int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags)
 {
 	unsigned long args[3];
@@ -218,14 +237,19 @@
 	args[2] = flags;
 	return (__socketcall(SYS_RECVMSG, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(recvmsg)
+# else
+libc_hidden_weak(recvmsg)
+strong_alias(recvmsg,__libc_recvmsg)
+# endif
 #endif
 
 #ifdef L_send
-#ifdef __NR_send
+# ifdef __NR_send
 _syscall4(ssize_t, send, int, sockfd, const void *, buffer, size_t, len, int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* send, sendto added by bir7 at leland.stanford.edu */
 ssize_t send(int sockfd, const void *buffer, size_t len, int flags)
 {
@@ -237,21 +261,24 @@
 	args[3] = flags;
 	return (__socketcall(SYS_SEND, args));
 }
-#elif defined(__NR_sendto)
-/* libc_hidden_proto(sendto) */
+# elif defined(__NR_sendto)
 ssize_t send(int sockfd, const void *buffer, size_t len, int flags)
 {
 	return (sendto(sockfd, buffer, len, flags, NULL, 0));
 }
-#endif
-/* libc_hidden_proto(send) */
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(send)
+# else
+libc_hidden_weak(send)
+strong_alias(send,__libc_send)
+# endif
 #endif
 
 #ifdef L_sendmsg
-#ifdef __NR_sendmsg
+# ifdef __NR_sendmsg
 _syscall3(ssize_t, sendmsg, int, sockfd, const struct msghdr *, msg, int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
 {
 	unsigned long args[3];
@@ -261,15 +288,20 @@
 	args[2] = flags;
 	return (__socketcall(SYS_SENDMSG, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(sendmsg)
+# else
+libc_hidden_weak(sendmsg)
+strong_alias(sendmsg,__libc_sendmsg)
+# endif
 #endif
 
 #ifdef L_sendto
-#ifdef __NR_sendto
+# ifdef __NR_sendto
 _syscall6(ssize_t, sendto, int, sockfd, const void *, buffer,
 	size_t, len, int, flags, const struct sockaddr *, to, socklen_t, tolen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* send, sendto added by bir7 at leland.stanford.edu */
 ssize_t sendto(int sockfd, const void *buffer, size_t len, int flags,
 	   const struct sockaddr *to, socklen_t tolen)
@@ -284,8 +316,13 @@
 	args[5] = tolen;
 	return (__socketcall(SYS_SENDTO, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(sendto)
+# else
+libc_hidden_weak(sendto)
+strong_alias(sendto,__libc_sendto)
+# endif
 #endif
 
 #ifdef L_setsockopt

Modified: trunk/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -38,7 +38,12 @@
 
 	return (__syscall_fcntl(fd, cmd, arg));
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(fcntl)
+#else
+libc_hidden_weak(fcntl)
+strong_alias(fcntl,__libc_fcntl)
+#endif
 
 #if ! defined __NR_fcntl64 && defined __UCLIBC_HAS_LFS__
 strong_alias(fcntl,fcntl64)

Modified: trunk/uClibc/libc/sysdeps/linux/common/close.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/close.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/close.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -11,4 +11,10 @@
 #include <unistd.h>
 
 _syscall1(int, close, int, fd)
+
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(close)
+#else
+libc_hidden_weak(close)
+strong_alias(close,__libc_close)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/fsync.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/fsync.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/fsync.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -10,4 +10,9 @@
 #include <sys/syscall.h>
 #include <unistd.h>
 
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(fsync) weak_function fsync;
+strong_alias(fsync,__libc_fsync)
+#endif
+
 _syscall1(int, fsync, int, fd)

Modified: trunk/uClibc/libc/sysdeps/linux/common/llseek.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/llseek.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/llseek.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -36,4 +36,9 @@
 
 #endif
 
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(lseek64)
+#else
+libc_hidden_weak(lseek64)
+strong_alias(lseek64,__libc_lseek64)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/lseek.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/lseek.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/lseek.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -19,4 +19,9 @@
 	return lseek64(fildes, offset, whence);
 }
 #endif
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(lseek)
+#else
+libc_hidden_weak(lseek)
+strong_alias(lseek,__libc_lseek)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/msync.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/msync.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/msync.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -14,6 +14,11 @@
 
 #include <sys/mman.h>
 
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(msync) weak_function msync;
+strong_alias(msync,__libc_msync)
+#endif
+
 _syscall3(int, msync, void *, addr, size_t, length, int, flags)
 
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/nanosleep.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/nanosleep.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/nanosleep.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -13,5 +13,10 @@
 #if defined __USE_POSIX199309 && defined __NR_nanosleep
 _syscall2(int, nanosleep, const struct timespec *, req,
 		  struct timespec *, rem)
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(nanosleep)
+#else
+libc_hidden_weak(nanosleep)
+strong_alias(nanosleep,__libc_nanosleep)
 #endif
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/open.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/open.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/open.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -31,7 +31,12 @@
 
 	return __syscall_open(file, oflag, mode);
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(open)
+#else
+libc_hidden_weak(open)
+strong_alias(open,__libc_open)
+#endif
 
 int creat(const char *file, mode_t mode)
 {

Modified: trunk/uClibc/libc/sysdeps/linux/common/open64.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/open64.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/open64.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -30,6 +30,11 @@
 
     return open(file, oflag | O_LARGEFILE, mode);
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(open64)
+#else
+libc_hidden_weak(open64)
+strong_alias(open64,__libc_open64)
+#endif
 
 #endif /* __UCLIBC_HAS_LFS__ */

Modified: trunk/uClibc/libc/sysdeps/linux/common/pause.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/pause.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/pause.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -10,17 +10,18 @@
 #define __UCLIBC_HIDE_DEPRECATED__
 #include <sys/syscall.h>
 #include <unistd.h>
+#include <signal.h>
 
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(pause) weak_function pause;
+strong_alias(pause,__libc_pause)
+#endif
+
 #ifdef __NR_pause
-
 _syscall0(int, pause)
-
 #else
-
-#include <signal.h>
 int pause(void)
 {
 	return (__sigpause(sigblock(0), 0));
 }
-
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/poll.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/poll.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/poll.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -20,18 +20,14 @@
 #include <sys/syscall.h>
 #include <sys/poll.h>
 
-extern __typeof(poll) __libc_poll;
-
 #ifdef __NR_poll
 
-# define __NR___libc_poll __NR_poll
-_syscall3(int, __libc_poll, struct pollfd *, fds,
+_syscall3(int, poll, struct pollfd *, fds,
 	unsigned long int, nfds, int, timeout)
 
 #elif defined(__NR_ppoll) && defined __UCLIBC_LINUX_SPECIFIC__
 
-/* libc_hidden_proto(ppoll) */
-int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
 {
 	struct timespec *ts = NULL, tval;
 	if (timeout > 0) {
@@ -57,11 +53,6 @@
 #include <sys/param.h>
 #include <unistd.h>
 
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* Experimentally off - libc_hidden_proto(memset) */
-/* libc_hidden_proto(getdtablesize) */
-/* libc_hidden_proto(select) */
-
 /* uClinux 2.0 doesn't have poll, emulate it using select */
 
 /* Poll the file descriptors described by the NFDS structures starting at
@@ -70,7 +61,7 @@
    Returns the number of file descriptors with events, zero if timed out,
    or -1 for errors.  */
 
-int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
 {
     static int max_fd_size;
     struct timeval tv;
@@ -229,6 +220,10 @@
 }
 
 #endif
-/* libc_hidden_proto(poll) */
-weak_alias(__libc_poll,poll)
+
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(poll)
+#else
 libc_hidden_weak(poll)
+strong_alias(poll,__libc_poll)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/read.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/read.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/read.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -11,4 +11,9 @@
 #include <unistd.h>
 
 _syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(read)
+#else
+libc_hidden_weak(read)
+strong_alias(read,__libc_read)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/wait.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/wait.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/wait.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -10,11 +10,14 @@
 #include <sys/wait.h>
 #include <sys/resource.h>
 
-/* libc_hidden_proto(wait4) */
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(wait) weak_function wait;
+strong_alias(wait,__libc_wait)
+#endif
 
 /* Wait for a child to die.  When one does, put its status in *STAT_LOC
  * and return its process ID.  For errors, return (pid_t) -1.  */
-__pid_t wait (__WAIT_STATUS_DEFN stat_loc)
+__pid_t wait(__WAIT_STATUS_DEFN stat_loc)
 {
-      return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
+	return wait4(WAIT_ANY, stat_loc, 0, NULL);
 }

Modified: trunk/uClibc/libc/sysdeps/linux/common/waitpid.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/waitpid.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/waitpid.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -10,10 +10,13 @@
 #include <sys/wait.h>
 #include <sys/resource.h>
 
-/* libc_hidden_proto(wait4) */
-
 __pid_t waitpid(__pid_t pid, int *wait_stat, int options)
 {
 	return wait4(pid, wait_stat, options, NULL);
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(waitpid)
+#else
+libc_hidden_weak(waitpid)
+strong_alias(waitpid,__libc_waitpid)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/write.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/write.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/sysdeps/linux/common/write.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -11,7 +11,13 @@
 #include <unistd.h>
 
 _syscall3(ssize_t, write, int, fd, const __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(write)
+#else
+libc_hidden_weak(write)
+strong_alias(write,__libc_write)
+#endif
+
 #if 0
 /* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o
  * which is a blatant GNU libc-ism... */

Modified: trunk/uClibc/libc/termios/tcdrain.c
===================================================================
--- trunk/uClibc/libc/termios/tcdrain.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libc/termios/tcdrain.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -20,10 +20,13 @@
 #include <termios.h>
 #include <sys/ioctl.h>
 
-/* libc_hidden_proto(ioctl) */
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(tcdrain) weak_function tcdrain;
+strong_alias(tcdrain,__libc_tcdrain)
+#endif
 
 /* Wait for pending output to be written on FD.  */
 int tcdrain(int fd)
 {
-      return ioctl(fd, TCSBRK, 1);
+	return ioctl(fd, TCSBRK, 1);
 }

Modified: trunk/uClibc/libpthread/linuxthreads.old/cancel.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/cancel.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libpthread/linuxthreads.old/cancel.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -215,7 +215,7 @@
 #ifndef __PIC__
 /* We need a hook to force the cancelation wrappers to be linked in when
    static libpthread is used.  */
-extern const int __pthread_provide_wrappers;
-static const int * const __pthread_require_wrappers =
+extern const char __pthread_provide_wrappers;
+static const char *const __pthread_require_wrappers =
   &__pthread_provide_wrappers;
 #endif

Modified: trunk/uClibc/libpthread/linuxthreads.old/pthread.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/pthread.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libpthread/linuxthreads.old/pthread.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -1156,7 +1156,7 @@
 #ifndef __PIC__
 /* We need a hook to force the cancelation wrappers to be linked in when
    static libpthread is used.  */
-extern const int __pthread_provide_wrappers;
-static const int *const __pthread_require_wrappers =
+extern const char __pthread_provide_wrappers;
+static const char *const __pthread_require_wrappers =
   &__pthread_provide_wrappers;
 #endif

Modified: trunk/uClibc/libpthread/linuxthreads.old/wrapsyscall.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/wrapsyscall.c	2009-02-24 18:42:38 UTC (rev 25448)
+++ trunk/uClibc/libpthread/linuxthreads.old/wrapsyscall.c	2009-02-25 11:06:29 UTC (rev 25449)
@@ -37,12 +37,13 @@
 #ifndef __PIC__
 /* We need a hook to force this file to be linked in when static
    libpthread is used.  */
-const int __pthread_provide_wrappers = 0;
+const char __pthread_provide_wrappers = 0;
 #endif
 
-
+/* Using private interface to libc (__libc_foo) to implement
+ * cancellable versions of some libc functions */
 #define CANCELABLE_SYSCALL(res_type, name, param_list, params)			\
-res_type name param_list;							\
+res_type __libc_##name param_list;						\
 res_type									\
 __attribute__ ((weak))								\
 name param_list									\
@@ -50,13 +51,13 @@
   res_type result;								\
   int oldtype;									\
   pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);		\
-  result = name params;								\
+  result = __libc_##name params;						\
   pthread_setcanceltype (oldtype, NULL);					\
   return result;								\
 }
 
 #define CANCELABLE_SYSCALL_VA(res_type, name, param_list, params, last_arg)	\
-res_type name param_list;							\
+res_type __libc_##name param_list;						\
 res_type									\
 __attribute__ ((weak))								\
 name param_list									\
@@ -66,7 +67,7 @@
   va_list ap;									\
   pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);		\
   va_start (ap, last_arg);							\
-  result = name params;								\
+  result = __libc_##name params;						\
   va_end (ap);									\
   pthread_setcanceltype (oldtype, NULL);					\
   return result;								\



More information about the uClibc-cvs mailing list