summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-03-13 05:58:57 +0000
committerrwatson <rwatson@FreeBSD.org>2004-03-13 05:58:57 +0000
commit6a1193a64c350d44ed36b22470a2517b09ab74ba (patch)
tree4e34c60ba784bb133eaac4a126bfbd03d273df1f /sys/kern
parent8a06745b209f354a1d62e12be48a3ee28a6c5df3 (diff)
downloadFreeBSD-src-6a1193a64c350d44ed36b22470a2517b09ab74ba.zip
FreeBSD-src-6a1193a64c350d44ed36b22470a2517b09ab74ba.tar.gz
Add annotations to mtx_lock(&Giant) in kern_select() and poll() that
we always grab Giant, even if we're actually only polling objects that don't require giant. Once socket locking is merged, there will be strong motivation to fix this.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sys_generic.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 8154e59..0de1d85 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -746,6 +746,10 @@ kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
if (nd < 0)
return (EINVAL);
fdp = td->td_proc->p_fd;
+ /*
+ * XXX: kern_select() currently requires that we acquire Giant
+ * even if none of the file descriptors we poll requires Giant.
+ */
mtx_lock(&Giant);
FILEDESC_LOCK(fdp);
@@ -954,6 +958,10 @@ poll(td, uap)
nfds = uap->nfds;
+ /*
+ * XXX: poll() currently requires that we acquire Giant even if
+ * none of the file descriptors we poll requires Giant.
+ */
mtx_lock(&Giant);
/*
* This is kinda bogus. We have fd limits, but that is not
OpenPOWER on IntegriCloud