diff options
author | green <green@FreeBSD.org> | 1999-09-19 17:00:25 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 1999-09-19 17:00:25 +0000 |
commit | 140cb4ff83b0061eeba0756f708f3f7c117e76e5 (patch) | |
tree | dbfb58e46547ab96401ba9719626c5b12448fbfd /sys/svr4/svr4_filio.c | |
parent | c171f3b18205ec5324a32cba54aff58ae5594701 (diff) | |
download | FreeBSD-src-140cb4ff83b0061eeba0756f708f3f7c117e76e5.zip FreeBSD-src-140cb4ff83b0061eeba0756f708f3f7c117e76e5.tar.gz |
This is what was "fdfix2.patch," a fix for fd sharing. It's pretty
far-reaching in fd-land, so you'll want to consult the code for
changes. The biggest change is that now, you don't use
fp->f_ops->fo_foo(fp, bar)
but instead
fo_foo(fp, bar),
which increments and decrements the fp refcount upon entry and exit.
Two new calls, fhold() and fdrop(), are provided. Each does what it
seems like it should, and if fdrop() brings the refcount to zero, the
fd is freed as well.
Thanks to peter ("to hell with it, it looks ok to me.") for his review.
Thanks to msmith for keeping me from putting locks everywhere :)
Reviewed by: peter
Diffstat (limited to 'sys/svr4/svr4_filio.c')
-rw-r--r-- | sys/svr4/svr4_filio.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/svr4/svr4_filio.c b/sys/svr4/svr4_filio.c index 0be9f22..9d404c7 100644 --- a/sys/svr4/svr4_filio.c +++ b/sys/svr4/svr4_filio.c @@ -196,8 +196,6 @@ svr4_fil_ioctl(fp, p, retval, fd, cmd, data) int error; int num; struct filedesc *fdp = p->p_fd; - int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) = - fp->f_ops->fo_ioctl; *retval = 0; @@ -229,7 +227,7 @@ svr4_fil_ioctl(fp, p, retval, fd, cmd, data) #ifdef SVR4_DEBUG if (cmd == FIOASYNC) DPRINTF(("FIOASYNC\n")); #endif - error = (*ctl)(fp, cmd, (caddr_t) &num, p); + error = fo_ioctl(fp, cmd, (caddr_t) &num, p); if (error) return error; |