diff options
author | deischen <deischen@FreeBSD.org> | 2001-02-11 22:07:32 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2001-02-11 22:07:32 +0000 |
commit | 3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f (patch) | |
tree | 5a22dcd523f742073beada495d06ed1dc2fce5e9 /lib/libc_r/uthread/uthread_fd.c | |
parent | 1143b5e42a7816a7665798bcab7d5db4a37935b3 (diff) | |
download | FreeBSD-src-3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f.zip FreeBSD-src-3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f.tar.gz |
Remove (int) file descriptor locking. It should be up to the
application to provide locking for I/O operations. This doesn't
break any of my tests, but the old behavior can be restored by
compiling with _FDLOCKS_ENABLED. This will eventually be removed
when it is obvious it does not cause any problems.
Remove most of flockfile implementation, with the exception of
flockfile_debug.
Make error messages more informational (submitted by Mike Heffner
<spock@techfour.net>, who's now known as mikeh@FreeBSD.org).
Diffstat (limited to 'lib/libc_r/uthread/uthread_fd.c')
-rw-r--r-- | lib/libc_r/uthread/uthread_fd.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_fd.c b/lib/libc_r/uthread/uthread_fd.c index ef905e3..98a70e0 100644 --- a/lib/libc_r/uthread/uthread_fd.c +++ b/lib/libc_r/uthread/uthread_fd.c @@ -58,8 +58,10 @@ do { \ static spinlock_t fd_table_lock = _SPINLOCK_INITIALIZER; /* Prototypes: */ +#ifdef _FDLOCKS_ENABLED static inline pthread_t fd_next_reader(int fd); static inline pthread_t fd_next_writer(int fd); +#endif /* @@ -180,6 +182,7 @@ _thread_fd_table_init(int fd) return (ret); } +#ifdef _FDLOCKS_ENABLED void _thread_fd_unlock(int fd, int lock_type) { @@ -991,3 +994,40 @@ fd_next_writer(int fd) return (pthread); } + +#else + +void +_thread_fd_unlock(int fd, int lock_type) +{ +} + +int +_thread_fd_lock(int fd, int lock_type, struct timespec * timeout) +{ + return (0); +} + +void +_thread_fd_unlock_debug(int fd, int lock_type, char *fname, int lineno) +{ +} + +int +_thread_fd_lock_debug(int fd, int lock_type, struct timespec * timeout, + char *fname, int lineno) +{ + return (0); +} + +void +_thread_fd_unlock_owned(pthread_t pthread) +{ +} + +void +_fd_lock_backout(pthread_t pthread) +{ +} + +#endif |