diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2017-01-13 22:16:41 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2017-01-13 22:16:41 +0000 |
commit | 4fce19da8d30be0bd4b2af4ae9d6c60861c52b03 (patch) | |
tree | 3e6e6fc108b8323156d7fef2f0d48c2e0ec631e1 /sys/kern | |
parent | e2c14d90df0643821551383be83fad03cfbcc226 (diff) | |
download | src-4fce19da8d30be0bd4b2af4ae9d6c60861c52b03.tar.gz src-4fce19da8d30be0bd4b2af4ae9d6c60861c52b03.zip |
Remove deprecated fgetsock() and fputsock().
Notes
Notes:
svn path=/head/; revision=312087
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index f470b045de66..fd6c796da14d 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include <sys/resourcevar.h> #include <sys/sbuf.h> #include <sys/signalvar.h> -#include <sys/socketvar.h> #include <sys/kdb.h> #include <sys/stat.h> #include <sys/sx.h> @@ -2840,61 +2839,6 @@ fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp, #endif /* - * Like fget() but loads the underlying socket, or returns an error if the - * descriptor does not represent a socket. - * - * We bump the ref count on the returned socket. XXX Also obtain the SX lock - * in the future. - * - * Note: fgetsock() and fputsock() are deprecated, as consumers should rely - * on their file descriptor reference to prevent the socket from being free'd - * during use. - */ -int -fgetsock(struct thread *td, int fd, cap_rights_t *rightsp, struct socket **spp, - u_int *fflagp) -{ - struct file *fp; - int error; - - *spp = NULL; - if (fflagp != NULL) - *fflagp = 0; - if ((error = _fget(td, fd, &fp, 0, rightsp, NULL)) != 0) - return (error); - if (fp->f_type != DTYPE_SOCKET) { - error = ENOTSOCK; - } else { - *spp = fp->f_data; - if (fflagp) - *fflagp = fp->f_flag; - SOCK_LOCK(*spp); - soref(*spp); - SOCK_UNLOCK(*spp); - } - fdrop(fp, td); - - return (error); -} - -/* - * Drop the reference count on the socket and XXX release the SX lock in the - * future. The last reference closes the socket. - * - * Note: fputsock() is deprecated, see comment for fgetsock(). - */ -void -fputsock(struct socket *so) -{ - - ACCEPT_LOCK(); - SOCK_LOCK(so); - CURVNET_SET(so->so_vnet); - sorele(so); - CURVNET_RESTORE(); -} - -/* * Handle the last reference to a file being closed. */ int |