In article <local.mail.freebsd-hackers/[EMAIL PROTECTED]> you
write:
>Hi,
>
> The following program returns an inconsistant rc/errno value.
>Setting a bit corresponding to filedescriptor which is not open
>is only found when it is less than 20. ie:
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
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message