diff options
author | jb <jb@FreeBSD.org> | 1998-06-09 23:21:05 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-06-09 23:21:05 +0000 |
commit | 765df5f4d29065eac50b4bfab3407a7da8a90323 (patch) | |
tree | e14930dc53674181c346bbe0f43647669e330569 /lib/libkse/thread/thr_writev.c | |
parent | 5ed1d7e9485fa8756d1be3fdf6cfa5125ac45657 (diff) | |
download | FreeBSD-src-765df5f4d29065eac50b4bfab3407a7da8a90323.zip FreeBSD-src-765df5f4d29065eac50b4bfab3407a7da8a90323.tar.gz |
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.
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 26a6006..9810aca 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: */ |