diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2001-01-24 13:03:38 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2001-01-24 13:03:38 +0000 |
| commit | e5106342c6de9cbe26c4827e4e29bae309cd8cfb (patch) | |
| tree | 5199387f09deaa21f12482317c165f815c4e8c2b /lib/libpthread/thread/thr_writev.c | |
| parent | f9447cd11209a5fb5ecef3f4cbe539e990f3b1bd (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_writev.c')
| -rw-r--r-- | lib/libpthread/thread/thr_writev.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/libpthread/thread/thr_writev.c b/lib/libpthread/thread/thr_writev.c index 5f3146887765..66b451fed2d3 100644 --- a/lib/libpthread/thread/thr_writev.c +++ b/lib/libpthread/thread/thr_writev.c @@ -39,13 +39,15 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#ifdef _THREAD_SAFE #include <pthread.h> #include "pthread_private.h" +#pragma weak writev=_writev + ssize_t _writev(int fd, const struct iovec * iov, int iovcnt) { + struct pthread *curthread = _get_curthread(); int blocking; int idx = 0; int type; @@ -92,7 +94,7 @@ _writev(int fd, const struct iovec * iov, int iovcnt) */ while (ret == 0) { /* Perform a non-blocking write syscall: */ - n = _thread_sys_writev(fd, &p_iov[idx], iovcnt - idx); + n = __sys_writev(fd, &p_iov[idx], iovcnt - idx); /* Check if one or more bytes were written: */ if (n > 0) { @@ -158,11 +160,11 @@ _writev(int fd, const struct iovec * iov, int iovcnt) */ if (blocking && ((n < 0 && (errno == EWOULDBLOCK || errno == EAGAIN)) || (n >= 0 && idx < iovcnt))) { - _thread_run->data.fd.fd = fd; + curthread->data.fd.fd = fd; _thread_kern_set_timeout(NULL); /* Reset the interrupted operation flag: */ - _thread_run->interrupted = 0; + curthread->interrupted = 0; _thread_kern_sched_state(PS_FDW_WAIT, __FILE__, __LINE__); @@ -171,7 +173,7 @@ _writev(int fd, const struct iovec * iov, int iovcnt) * Check if the operation was * interrupted by a signal */ - if (_thread_run->interrupted) { + if (curthread->interrupted) { /* Return an error: */ ret = -1; } @@ -200,6 +202,3 @@ _writev(int fd, const struct iovec * iov, int iovcnt) return (ret); } - -__strong_reference(_writev, writev); -#endif |
