diff options
author | John Birrell <jb@FreeBSD.org> | 1998-06-09 23:21:05 +0000 |
---|---|---|
committer | John Birrell <jb@FreeBSD.org> | 1998-06-09 23:21:05 +0000 |
commit | ddc8afd422568750de7698d8a92b79b27599dd2f (patch) | |
tree | 7b6d63e77297f7bad0d21a6bb68fa893b9a54574 /lib/libkse/thread/thr_writev.c | |
parent | a67502218841058625ebd524b04693bee2622955 (diff) | |
download | src-ddc8afd422568750de7698d8a92b79b27599dd2f.tar.gz src-ddc8afd422568750de7698d8a92b79b27599dd2f.zip |
Implement compile time debug support instead of tracking file name and
line number every time a file descriptor is locked.
This looks like a big change but it isn't. It should reduce the size
of libc_r and make it run slightly faster.
Notes
Notes:
svn path=/head/; revision=36830
Diffstat (limited to 'lib/libkse/thread/thr_writev.c')
-rw-r--r-- | lib/libkse/thread/thr_writev.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libkse/thread/thr_writev.c b/lib/libkse/thread/thr_writev.c index 26a60065a08b..9810aca0d4ef 100644 --- a/lib/libkse/thread/thr_writev.c +++ b/lib/libkse/thread/thr_writev.c @@ -29,13 +29,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: uthread_writev.c,v 1.6 1998/05/25 21:45:52 jb Exp $ + * $Id: uthread_writev.c,v 1.7 1998/05/27 00:44:58 jb Exp $ * */ #include <sys/types.h> #include <sys/fcntl.h> #include <sys/uio.h> #include <errno.h> +#include <stdlib.h> +#include <string.h> #include <unistd.h> #ifdef _THREAD_SAFE #include <pthread.h> @@ -68,8 +70,7 @@ writev(int fd, const struct iovec * iov, int iovcnt) memcpy(p_iov,iov,iovcnt * sizeof(struct iovec)); /* Lock the file descriptor for write: */ - if ((ret = _thread_fd_lock(fd, FD_WRITE, NULL, - __FILE__, __LINE__)) == 0) { + if ((ret = _FD_LOCK(fd, FD_WRITE, NULL)) == 0) { /* Check if file operations are to block */ blocking = ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0); @@ -166,7 +167,7 @@ writev(int fd, const struct iovec * iov, int iovcnt) /* Return the number of bytes written: */ ret = num; } - _thread_fd_unlock(fd, FD_RDWR); + _FD_UNLOCK(fd, FD_RDWR); } /* If memory was allocated for the array, free it: */ |