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_fcntl.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_fcntl.c')
-rw-r--r-- | lib/libkse/thread/thr_fcntl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_fcntl.c b/lib/libkse/thread/thr_fcntl.c index 9a50c1c..556bd1f 100644 --- a/lib/libkse/thread/thr_fcntl.c +++ b/lib/libkse/thread/thr_fcntl.c @@ -47,7 +47,7 @@ fcntl(int fd, int cmd,...) va_list ap; /* Lock the file descriptor: */ - if ((ret = _thread_fd_lock(fd, FD_RDWR, NULL, __FILE__, __LINE__)) == 0) { + if ((ret = _FD_LOCK(fd, FD_RDWR, NULL)) == 0) { /* Initialise the variable argument list: */ va_start(ap, cmd); @@ -80,8 +80,11 @@ fcntl(int fd, int cmd,...) } break; case F_SETFD: + flags = va_arg(ap, int); + ret = _thread_sys_fcntl(fd, cmd, flags); break; case F_GETFD: + ret = _thread_sys_fcntl(fd, cmd, 0); break; case F_GETFL: ret = _thread_fd_table[fd]->flags; @@ -102,7 +105,7 @@ fcntl(int fd, int cmd,...) va_end(ap); /* Unlock the file descriptor: */ - _thread_fd_unlock(fd, FD_RDWR); + _FD_UNLOCK(fd, FD_RDWR); } /* Return the completion status: */ |