summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-04-01 11:09:54 +0000
committerrwatson <rwatson@FreeBSD.org>2006-04-01 11:09:54 +0000
commit53d8847cf38e5f7265c8e830a4dff1c7f888c359 (patch)
tree5c612c842bd5ae4158c8cd43154e4da540db5be1
parent952b01bba90b5a9a2bc6620cd505ad36e2d82e87 (diff)
downloadFreeBSD-src-53d8847cf38e5f7265c8e830a4dff1c7f888c359.zip
FreeBSD-src-53d8847cf38e5f7265c8e830a4dff1c7f888c359.tar.gz
Mark fgetsock() and fputsock() as depcrecated: callers should rely on
the file descriptor reference, rather than paying additional lock operations to acquire a socket reference from the file descriptor. This will also help to ensure that file descriptor based socket requests are not delivered to a socket after close. Most consumers have already been converted to this model. MFC after: 3 months
-rw-r--r--sys/kern/kern_descrip.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 8482307..63b0832 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -2090,6 +2090,10 @@ fgetvp_write(struct thread *td, int fd, struct vnode **vpp)
*
* We bump the ref count on the returned socket. XXX Also obtain the SX
* lock in the future.
+ *
+ * XXXRW: fgetsock() and fputsock() are deprecated, as consumers should rely
+ * on their file descriptor reference to prevent the socket from being
+ * freed during use.
*/
int
fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp)
@@ -2119,8 +2123,10 @@ fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp)
}
/*
- * Drop the reference count on the socket and XXX release the SX lock in
- * the future. The last reference closes the socket.
+ * Drop the reference count on the socket and XXX release the SX lock in the
+ * future. The last reference closes the socket.
+ *
+ * XXXRW: fputsock() is deprecated, see comment for fgetsock().
*/
void
fputsock(struct socket *so)
OpenPOWER on IntegriCloud