bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Solaris 7 select() may hang on a /dev/null fd when timeout


From: Mark D. Baushke
Subject: [Bug-gnulib] Solaris 7 select() may hang on a /dev/null fd when timeout == NULL
Date: Tue, 19 Oct 2004 15:08:20 -0700

Greetings,

While working on the top-of-tree version of CVS, I
ran into the problem that is described here:

  http://sunsolve.sun.com/search/printfriendly.do?assetkey=1-1-1171830-1

(hmmm... the URL seems unreachable right now, I
will include a copy of it in the set of
attachments below.)

Briefly, Solaris 7 systems have a bug when
select() is called with only "/dev/null" readfds
and a NULL value for the timeout. The workaround
is to avoid calling select() in this case and just
to return with the readfds updated to include the
count of descriptors.

Again on Solaris 7 systems, if "/dev/null" is one
of the readfds and there are other non-"/dev/null"
fds in the fd sets being passed, the "/dev/null"
fd will never be set on return from select().
Similarly, any "/dev/null" fds that were part of
the exceptfds will also be zero on return. On
Solaris 9, "/dev/null" fds always show up in the
returning fd set as being available.

I am given to understand that Solaris 2.6 may the
hang problem, but I do not have such a system to
test at present.

I believe that the attached files:

  lib/select.c
  m4/select.m4
  modules/select

may approimate the standards for inclusion in the
GNULIB.

I would like to see it or something like it added
to the GNULIB project.

Your advice as to automake macro naming and format
as well as the implementation of the workaround
would be much appreciated.

Note: It could be argued that having "/dev/null"
in the exceptfds does not require any special
handling as there will never be any exceptions to
service. My application does not need it, so I am
willing to take your advice in the implementation.

        Thank you,
        -- Mark

Attachment: select.c
Description: Possible lib/select.c implementation

Attachment: select.m4
Description: Possible m4/select.m4 implementation

Attachment: select
Description: Possible modules/select implementation

Attachment: 1171830
Description: Text of Document ID: 1171830 from Sun Microsystems.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]