Date: Thu, 8 Jul 1999 14:33:19 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Jonathan Lemon <jlemon@americantv.com> Cc: jwd@unx.sas.com, hackers@FreeBSD.ORG Subject: Re: Strange select/poll behaviour [EBADF inconsistancy] Message-ID: <199907082133.OAA43126@apollo.backplane.com>
next in thread | raw e-mail | index | archive | help
:This is because initially, only 20 descriptors are allocated, and :the system is quietly ignoring any descriptors over the allocated :amount: : : if (uap->nd > p->p_fd->fd_nfiles) : uap->nd = p->p_fd->fd_nfiles; /* forgiving; slightly wrong */ : :This should be: : : if (uap->nd > p->p_fd->fd_nfiles) : return (EBADF); : :-- :Jonathan Not unless you want to blow up virtually every program that uses select!!! Passing an nd parameter that is greater then the current number of descriptors is perfectly valid. It's setting a bit in the bitmask for one of those descriptors that should return EBADF! -Matt Matthew Dillon <dillon@backplane.com> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907082133.OAA43126>