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/compat/svr4/svr4_sockio.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/compat/svr4/svr4_sockio.c')
-rw-r--r-- | sys/compat/svr4/svr4_sockio.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c index 7d61846..8fe8099 100644 --- a/sys/compat/svr4/svr4_sockio.c +++ b/sys/compat/svr4/svr4_sockio.c @@ -88,8 +88,6 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data) caddr_t data; { int error; - int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) = - fp->f_ops->fo_ioctl; *retval = 0; @@ -136,7 +134,7 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data) (void) strncpy(br.ifr_name, sr.svr4_ifr_name, sizeof(br.ifr_name)); - if ((error = (*ctl)(fp, SIOCGIFFLAGS, + if ((error = fo_ioctl(fp, SIOCGIFFLAGS, (caddr_t) &br, p)) != 0) { DPRINTF(("SIOCGIFFLAGS (%s) %s: error %d\n", br.ifr_name, sr.svr4_ifr_name, error)); @@ -160,7 +158,7 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data) sizeof(struct ifreq), sizeof(struct svr4_ifreq), sc.svr4_ifc_len)); - if ((error = (*ctl)(fp, OSIOCGIFCONF, + if ((error = fo_ioctl(fp, OSIOCGIFCONF, (caddr_t) &sc, p)) != 0) return error; |