diff options
-rw-r--r-- | libc/sysdeps/linux/common/close.c | 6 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/llseek.c | 5 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/lseek.c | 5 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/open.c | 5 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/open64.c | 5 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/read.c | 5 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/write.c | 6 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/cancel.c | 4 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/pthread.c | 4 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/wrapsyscall.c | 13 |
10 files changed, 48 insertions, 10 deletions
diff --git a/libc/sysdeps/linux/common/close.c b/libc/sysdeps/linux/common/close.c index be3d2e051..d6b5fbb20 100644 --- a/libc/sysdeps/linux/common/close.c +++ b/libc/sysdeps/linux/common/close.c @@ -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 diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c index 6bb88cac5..29582f768 100644 --- a/libc/sysdeps/linux/common/llseek.c +++ b/libc/sysdeps/linux/common/llseek.c @@ -36,4 +36,9 @@ loff_t lseek64(int fd, loff_t offset, int whence) #endif +#ifndef __LINUXTHREADS_OLD__ libc_hidden_def(lseek64) +#else +libc_hidden_weak(lseek64) +strong_alias(lseek64,__libc_lseek64) +#endif diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c index b58f75c01..9ff424048 100644 --- a/libc/sysdeps/linux/common/lseek.c +++ b/libc/sysdeps/linux/common/lseek.c @@ -19,4 +19,9 @@ __off_t lseek(int fildes, __off_t offset, int whence) return lseek64(fildes, offset, whence); } #endif +#ifndef __LINUXTHREADS_OLD__ libc_hidden_def(lseek) +#else +libc_hidden_weak(lseek) +strong_alias(lseek,__libc_lseek) +#endif diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c index 0faf02a00..66c266371 100644 --- a/libc/sysdeps/linux/common/open.c +++ b/libc/sysdeps/linux/common/open.c @@ -31,7 +31,12 @@ int open(const char *file, int oflag, ...) 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) { diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index 403e91a46..c1f5400b8 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -47,6 +47,11 @@ int open64 (const char *file, int oflag, ...) return open(file, oflag | O_LARGEFILE, mode); #endif } +#ifndef __LINUXTHREADS_OLD__ libc_hidden_def(open64) +#else +libc_hidden_weak(open64) +strong_alias(open64,__libc_open64) +#endif #endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/read.c b/libc/sysdeps/linux/common/read.c index b380812e6..9e122fc10 100644 --- a/libc/sysdeps/linux/common/read.c +++ b/libc/sysdeps/linux/common/read.c @@ -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 diff --git a/libc/sysdeps/linux/common/write.c b/libc/sysdeps/linux/common/write.c index b6d71f033..5a6f7225f 100644 --- a/libc/sysdeps/linux/common/write.c +++ b/libc/sysdeps/linux/common/write.c @@ -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... */ diff --git a/libpthread/linuxthreads.old/cancel.c b/libpthread/linuxthreads.old/cancel.c index 239b821f1..03a85e4e9 100644 --- a/libpthread/linuxthreads.old/cancel.c +++ b/libpthread/linuxthreads.old/cancel.c @@ -215,7 +215,7 @@ void __pthread_perform_cleanup(char *currentframe) #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 diff --git a/libpthread/linuxthreads.old/pthread.c b/libpthread/linuxthreads.old/pthread.c index 308845d36..e1e6c9fd6 100644 --- a/libpthread/linuxthreads.old/pthread.c +++ b/libpthread/linuxthreads.old/pthread.c @@ -1156,7 +1156,7 @@ void __pthread_message(char * fmt, ...) #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 diff --git a/libpthread/linuxthreads.old/wrapsyscall.c b/libpthread/linuxthreads.old/wrapsyscall.c index 462768d9d..6e18388ca 100644 --- a/libpthread/linuxthreads.old/wrapsyscall.c +++ b/libpthread/linuxthreads.old/wrapsyscall.c @@ -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 @@ name param_list \ 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 @@ name param_list \ 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; \ |