[lkml]   [1996]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: File Descriptors & Linux 2.0
Followup to:  <4qs1aq$>
By author: (Miquel van Smoorenburg)
In newsgroup:
> I just checked the Linux-2.0.0 kernel and the sys_select function never
> writes further in your fd_set than the nr_fds argument to select(). This
> means that if NR_OPEN is increased, and the size of fd_set increases with it,
> it doesn't have consequences for older applications. The only thing is that
> an old application can't handle a fd > 255 in a select() if one is passed
> through fork()/exec() but I know of no applications that do this. So I think
> you can do this without trouble.
> If it's the other way around, and you try to pass a nr_fds > NR_OPEN to
> select() the kernel sys_select function will round it down to NR_OPEN
> quietly. So that doesn't cause trouble either.
> Somehow I get the feeling that sys_select() was coded with this already
> in mind..

How many applications do you know that actually check if the file
descriptor they get from the kernel is in the range 0 <= fd < NR_OPEN?
Most apps just use FD_SET() without any further checking.

PGP public key available - finger
I don't work for Yggdrasil, but they sponsor the linux.* hierarchy.
"The earth is but one country, and mankind its citizens." -- Bahá'u'lláh
Just Say No to Morden * Save Babylon 5:

 \ /
  Last update: 2005-03-22 13:37    [W:0.053 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site