diff options
author | jasone <jasone@FreeBSD.org> | 2000-01-12 09:28:58 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-01-12 09:28:58 +0000 |
commit | 4b4a2e733a2332d82db33d43f90c3e14fb0ff31e (patch) | |
tree | 5f61d93336476ecbaf8b9665c656c202589b1e08 /lib/libkse | |
parent | 75903038bc52105bc7479fe5f2b75f22f10c1c50 (diff) | |
download | FreeBSD-src-4b4a2e733a2332d82db33d43f90c3e14fb0ff31e.zip FreeBSD-src-4b4a2e733a2332d82db33d43f90c3e14fb0ff31e.tar.gz |
Track libc's three-tier symbol naming. libc_r must currently implement
the _libc_*() entry points and add *() weak aliases. This will all
change for the better when libc_r becomes libpthread.
Diffstat (limited to 'lib/libkse')
26 files changed, 75 insertions, 32 deletions
diff --git a/lib/libkse/thread/thr_attr_setdetachstate.c b/lib/libkse/thread/thr_attr_setdetachstate.c index 36a846a..6be3e4e 100644 --- a/lib/libkse/thread/thr_attr_setdetachstate.c +++ b/lib/libkse/thread/thr_attr_setdetachstate.c @@ -36,7 +36,8 @@ #include <pthread.h> #include "pthread_private.h" -int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate) +int +pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate) { int ret; diff --git a/lib/libkse/thread/thr_attr_setstackaddr.c b/lib/libkse/thread/thr_attr_setstackaddr.c index 7eb8c5d..46469e4 100644 --- a/lib/libkse/thread/thr_attr_setstackaddr.c +++ b/lib/libkse/thread/thr_attr_setstackaddr.c @@ -36,7 +36,8 @@ #include <pthread.h> #include "pthread_private.h" -int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr) +int +pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr) { int ret; diff --git a/lib/libkse/thread/thr_attr_setstacksize.c b/lib/libkse/thread/thr_attr_setstacksize.c index 2a2d854..3897811 100644 --- a/lib/libkse/thread/thr_attr_setstacksize.c +++ b/lib/libkse/thread/thr_attr_setstacksize.c @@ -36,7 +36,8 @@ #include <pthread.h> #include "pthread_private.h" -int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) +int +pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) { int ret; diff --git a/lib/libkse/thread/thr_close.c b/lib/libkse/thread/thr_close.c index 2580fce..fe2d9e2 100644 --- a/lib/libkse/thread/thr_close.c +++ b/lib/libkse/thread/thr_close.c @@ -41,7 +41,7 @@ #include "pthread_private.h" int -close(int fd) +_libc_close(int fd) { int flags; int ret; @@ -102,4 +102,6 @@ close(int fd) _thread_leave_cancellation_point(); return (ret); } + +__weak_reference(_libc_close, close); #endif diff --git a/lib/libkse/thread/thr_exit.c b/lib/libkse/thread/thr_exit.c index abe4b27..57ac114 100644 --- a/lib/libkse/thread/thr_exit.c +++ b/lib/libkse/thread/thr_exit.c @@ -41,7 +41,7 @@ #include <pthread.h> #include "pthread_private.h" -void _exit(int status) +void _libc__exit(int status) { int flags; int i; @@ -77,6 +77,8 @@ void _exit(int status) _thread_sys__exit(status); } +__weak_reference(_libc__exit, _exit); + void _thread_exit(char *fname, int lineno, char *string) { diff --git a/lib/libkse/thread/thr_fcntl.c b/lib/libkse/thread/thr_fcntl.c index 878554c..6cd2b12 100644 --- a/lib/libkse/thread/thr_fcntl.c +++ b/lib/libkse/thread/thr_fcntl.c @@ -39,7 +39,7 @@ #include "pthread_private.h" int -fcntl(int fd, int cmd,...) +_libc_fcntl(int fd, int cmd,...) { int flags = 0; int nonblock; @@ -142,4 +142,6 @@ fcntl(int fd, int cmd,...) /* Return the completion status: */ return (ret); } + +__weak_reference(_libc_fcntl, fcntl); #endif diff --git a/lib/libkse/thread/thr_fork.c b/lib/libkse/thread/thr_fork.c index 08ea812..8c112e8 100644 --- a/lib/libkse/thread/thr_fork.c +++ b/lib/libkse/thread/thr_fork.c @@ -41,7 +41,7 @@ #include "pthread_private.h" pid_t -fork(void) +_libc_fork(void) { int i, flags; pid_t ret; @@ -220,4 +220,6 @@ fork(void) /* Return the process ID: */ return (ret); } + +__weak_reference(_libc_fork, fork); #endif diff --git a/lib/libkse/thread/thr_fsync.c b/lib/libkse/thread/thr_fsync.c index 21c3b56..048e60b 100644 --- a/lib/libkse/thread/thr_fsync.c +++ b/lib/libkse/thread/thr_fsync.c @@ -37,7 +37,7 @@ #include "pthread_private.h" int -fsync(int fd) +_libc_fsync(int fd) { int ret; @@ -49,4 +49,6 @@ fsync(int fd) _thread_leave_cancellation_point(); return (ret); } + +__weak_reference(_libc_fsync, fsync); #endif diff --git a/lib/libkse/thread/thr_msync.c b/lib/libkse/thread/thr_msync.c index 209286d..9559ec4 100644 --- a/lib/libkse/thread/thr_msync.c +++ b/lib/libkse/thread/thr_msync.c @@ -13,7 +13,7 @@ #include "pthread_private.h" int -msync(addr, len, flags) +_libc_msync(addr, len, flags) void *addr; size_t len; int flags; @@ -37,4 +37,6 @@ msync(addr, len, flags) return (ret); } + +__weak_reference(_libc_msync, msync); #endif diff --git a/lib/libkse/thread/thr_multi_np.c b/lib/libkse/thread/thr_multi_np.c index 39dd948..9a2f7c1 100644 --- a/lib/libkse/thread/thr_multi_np.c +++ b/lib/libkse/thread/thr_multi_np.c @@ -36,7 +36,8 @@ #include <pthread.h> #include "pthread_private.h" -int pthread_multi_np() +int +pthread_multi_np() { /* Return to multi-threaded scheduling mode: */ _thread_single = NULL; diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c index c625ef2..6526a35 100644 --- a/lib/libkse/thread/thr_mutex.c +++ b/lib/libkse/thread/thr_mutex.c @@ -243,7 +243,7 @@ pthread_mutex_destroy(pthread_mutex_t * mutex) } static int -init_static (pthread_mutex_t *mutex) +init_static(pthread_mutex_t *mutex) { int ret; @@ -1219,7 +1219,7 @@ mutex_priority_adjust(pthread_mutex_t mutex) } static void -mutex_rescan_owned (pthread_t pthread, pthread_mutex_t mutex) +mutex_rescan_owned(pthread_t pthread, pthread_mutex_t mutex) { int active_prio, inherited_prio; pthread_mutex_t m; diff --git a/lib/libkse/thread/thr_mutexattr_destroy.c b/lib/libkse/thread/thr_mutexattr_destroy.c index 9afebad..6eed2a2 100644 --- a/lib/libkse/thread/thr_mutexattr_destroy.c +++ b/lib/libkse/thread/thr_mutexattr_destroy.c @@ -37,7 +37,8 @@ #include <pthread.h> #include "pthread_private.h" -int pthread_mutexattr_destroy(pthread_mutexattr_t *attr) +int +pthread_mutexattr_destroy(pthread_mutexattr_t *attr) { int ret; if (attr == NULL || *attr == NULL) { diff --git a/lib/libkse/thread/thr_nanosleep.c b/lib/libkse/thread/thr_nanosleep.c index e4772b4..e9052f9 100644 --- a/lib/libkse/thread/thr_nanosleep.c +++ b/lib/libkse/thread/thr_nanosleep.c @@ -38,8 +38,8 @@ #include "pthread_private.h" int -nanosleep(const struct timespec * time_to_sleep, - struct timespec * time_remaining) +_libc_nanosleep(const struct timespec * time_to_sleep, + struct timespec * time_remaining) { int ret = 0; struct timespec current_time; @@ -120,4 +120,6 @@ nanosleep(const struct timespec * time_to_sleep, _thread_leave_cancellation_point(); return (ret); } + +__weak_reference(_libc_nanosleep, nanosleep); #endif diff --git a/lib/libkse/thread/thr_open.c b/lib/libkse/thread/thr_open.c index 4e9993e..4bc2f1a 100644 --- a/lib/libkse/thread/thr_open.c +++ b/lib/libkse/thread/thr_open.c @@ -42,7 +42,7 @@ #include "pthread_private.h" int -open(const char *path, int flags,...) +_libc_open(const char *path, int flags,...) { int fd; int mode = 0; @@ -74,4 +74,6 @@ open(const char *path, int flags,...) /* Return the file descriptor or -1 on error: */ return (fd); } + +__weak_reference(_libc_open, open); #endif diff --git a/lib/libkse/thread/thr_poll.c b/lib/libkse/thread/thr_poll.c index 10a9db7..ce2b7af 100644 --- a/lib/libkse/thread/thr_poll.c +++ b/lib/libkse/thread/thr_poll.c @@ -44,7 +44,7 @@ int -poll(struct pollfd *fds, unsigned int nfds, int timeout) +_libc_poll(struct pollfd *fds, unsigned int nfds, int timeout) { struct timespec ts; int numfds = nfds; @@ -96,4 +96,6 @@ poll(struct pollfd *fds, unsigned int nfds, int timeout) return (ret); } + +__weak_reference(_libc_poll, poll); #endif diff --git a/lib/libkse/thread/thr_read.c b/lib/libkse/thread/thr_read.c index 8cbb5be..ad66df3 100644 --- a/lib/libkse/thread/thr_read.c +++ b/lib/libkse/thread/thr_read.c @@ -42,7 +42,7 @@ #include "pthread_private.h" ssize_t -read(int fd, void *buf, size_t nbytes) +_libc_read(int fd, void *buf, size_t nbytes) { int ret; int type; @@ -100,4 +100,6 @@ read(int fd, void *buf, size_t nbytes) _thread_leave_cancellation_point(); return (ret); } + +__weak_reference(_libc_read, read); #endif diff --git a/lib/libkse/thread/thr_readv.c b/lib/libkse/thread/thr_readv.c index a1a862d..c1965d8 100644 --- a/lib/libkse/thread/thr_readv.c +++ b/lib/libkse/thread/thr_readv.c @@ -42,7 +42,7 @@ #include "pthread_private.h" ssize_t -readv(int fd, const struct iovec * iov, int iovcnt) +_libc_readv(int fd, const struct iovec * iov, int iovcnt) { int ret; int type; @@ -90,4 +90,6 @@ readv(int fd, const struct iovec * iov, int iovcnt) } return (ret); } + +__weak_reference(_libc_readv, readv); #endif diff --git a/lib/libkse/thread/thr_rwlockattr.c b/lib/libkse/thread/thr_rwlockattr.c index 7a56bca..37eb3ea 100644 --- a/lib/libkse/thread/thr_rwlockattr.c +++ b/lib/libkse/thread/thr_rwlockattr.c @@ -34,7 +34,7 @@ #include "pthread_private.h" int -pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr) +pthread_rwlockattr_destroy(pthread_rwlockattr_t *rwlockattr) { pthread_rwlockattr_t prwlockattr; @@ -52,7 +52,7 @@ pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr) } int -pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *rwlockattr, +pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *rwlockattr, int *pshared) { *pshared = (*rwlockattr)->pshared; @@ -61,7 +61,7 @@ pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *rwlockattr, } int -pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) +pthread_rwlockattr_init(pthread_rwlockattr_t *rwlockattr) { pthread_rwlockattr_t prwlockattr; @@ -81,7 +81,7 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) } int -pthread_rwlockattr_setpshared (pthread_rwlockattr_t *rwlockattr, int pshared) +pthread_rwlockattr_setpshared(pthread_rwlockattr_t *rwlockattr, int pshared) { /* Only PTHREAD_PROCESS_PRIVATE is supported. */ if (pshared != PTHREAD_PROCESS_PRIVATE) diff --git a/lib/libkse/thread/thr_select.c b/lib/libkse/thread/thr_select.c index 9bfae89..a7ceecc 100644 --- a/lib/libkse/thread/thr_select.c +++ b/lib/libkse/thread/thr_select.c @@ -45,8 +45,8 @@ #include "pthread_private.h" int -select(int numfds, fd_set * readfds, fd_set * writefds, - fd_set * exceptfds, struct timeval * timeout) +_libc_select(int numfds, fd_set * readfds, fd_set * writefds, fd_set * + exceptfds, struct timeval * timeout) { struct timespec ts; int i, ret = 0, f_wait = 1; @@ -203,4 +203,6 @@ select(int numfds, fd_set * readfds, fd_set * writefds, return (ret); } + +__weak_reference(_libc_select, select); #endif diff --git a/lib/libkse/thread/thr_sigaction.c b/lib/libkse/thread/thr_sigaction.c index 7fa8ebf..f2f7286 100644 --- a/lib/libkse/thread/thr_sigaction.c +++ b/lib/libkse/thread/thr_sigaction.c @@ -38,7 +38,7 @@ #include "pthread_private.h" int -sigaction(int sig, const struct sigaction * act, struct sigaction * oact) +_libc_sigaction(int sig, const struct sigaction * act, struct sigaction * oact) { int ret = 0; struct sigaction gact; @@ -105,4 +105,6 @@ sigaction(int sig, const struct sigaction * act, struct sigaction * oact) /* Return the completion status: */ return (ret); } + +__weak_reference(_libc_sigaction, sigaction); #endif diff --git a/lib/libkse/thread/thr_sigpending.c b/lib/libkse/thread/thr_sigpending.c index 2d61e21..feb4300 100644 --- a/lib/libkse/thread/thr_sigpending.c +++ b/lib/libkse/thread/thr_sigpending.c @@ -38,7 +38,7 @@ #include "pthread_private.h" int -sigpending(sigset_t * set) +_libc_sigpending(sigset_t * set) { int ret = 0; @@ -53,4 +53,6 @@ sigpending(sigset_t * set) /* Return the completion status: */ return (ret); } + +__weak_reference(_libc_sigpending, sigpending); #endif diff --git a/lib/libkse/thread/thr_sigprocmask.c b/lib/libkse/thread/thr_sigprocmask.c index 592a61e..28ab4fa 100644 --- a/lib/libkse/thread/thr_sigprocmask.c +++ b/lib/libkse/thread/thr_sigprocmask.c @@ -41,7 +41,7 @@ #include "pthread_private.h" int -sigprocmask(int how, const sigset_t * set, sigset_t * oset) +_libc_sigprocmask(int how, const sigset_t * set, sigset_t * oset) { int ret = 0; @@ -89,4 +89,6 @@ sigprocmask(int how, const sigset_t * set, sigset_t * oset) /* Return the completion status: */ return (ret); } + +__weak_reference(_libc_sigprocmask, sigprocmask); #endif diff --git a/lib/libkse/thread/thr_sigsuspend.c b/lib/libkse/thread/thr_sigsuspend.c index ac06ff7..b64897a 100644 --- a/lib/libkse/thread/thr_sigsuspend.c +++ b/lib/libkse/thread/thr_sigsuspend.c @@ -38,7 +38,7 @@ #include "pthread_private.h" int -sigsuspend(const sigset_t * set) +_libc_sigsuspend(const sigset_t * set) { int ret = -1; sigset_t oset; @@ -67,4 +67,6 @@ sigsuspend(const sigset_t * set) /* Return the completion status: */ return (ret); } + +__weak_reference(_libc_sigsuspend, sigsuspend); #endif diff --git a/lib/libkse/thread/thr_wait4.c b/lib/libkse/thread/thr_wait4.c index 4a58a70..4c3f1de 100644 --- a/lib/libkse/thread/thr_wait4.c +++ b/lib/libkse/thread/thr_wait4.c @@ -38,7 +38,7 @@ #include "pthread_private.h" pid_t -wait4(pid_t pid, int *istat, int options, struct rusage * rusage) +_libc_wait4(pid_t pid, int *istat, int options, struct rusage * rusage) { pid_t ret; @@ -66,4 +66,6 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage) return (ret); } + +__weak_reference(_libc_wait4, wait4); #endif diff --git a/lib/libkse/thread/thr_write.c b/lib/libkse/thread/thr_write.c index 40c4cc5..f25c606 100644 --- a/lib/libkse/thread/thr_write.c +++ b/lib/libkse/thread/thr_write.c @@ -42,7 +42,7 @@ #include "pthread_private.h" ssize_t -write(int fd, const void *buf, size_t nbytes) +_libc_write(int fd, const void *buf, size_t nbytes) { int blocking; int type; @@ -136,4 +136,6 @@ write(int fd, const void *buf, size_t nbytes) _thread_leave_cancellation_point(); return (ret); } + +__weak_reference(_libc_write, write); #endif diff --git a/lib/libkse/thread/thr_writev.c b/lib/libkse/thread/thr_writev.c index 375f599..74da521 100644 --- a/lib/libkse/thread/thr_writev.c +++ b/lib/libkse/thread/thr_writev.c @@ -44,7 +44,7 @@ #include "pthread_private.h" ssize_t -writev(int fd, const struct iovec * iov, int iovcnt) +_libc_writev(int fd, const struct iovec * iov, int iovcnt) { int blocking; int idx = 0; @@ -200,4 +200,6 @@ writev(int fd, const struct iovec * iov, int iovcnt) return (ret); } + +__weak_reference(_libc_writev, writev); #endif |