From 6a1193a64c350d44ed36b22470a2517b09ab74ba Mon Sep 17 00:00:00 2001 From: rwatson Date: Sat, 13 Mar 2004 05:58:57 +0000 Subject: 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. --- sys/kern/sys_generic.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.1