[bwelling@anomaly.munge.com] libc/872: possibly incorrect pselect() definition

Andreas Jaeger aj@arthur.rhein-neckar.de
Wed Nov 25 14:44:00 GMT 1998


Could somebody please check the "standards" so that the pselect
interface gets fixed.

Thanks,
Andreas

glibc 2.1 uses a pselect definition that's different from the one used 
in Stevens' Unix Network Programming:

We use in glibc 2.1:
extern int pselect __P ((int __nfds, __fd_set *__readfds,
                         __fd_set *__writefds, __fd_set *__exceptfds,
                         struct timespec *__timeout));

and Stevens has (Unix Network Programming, Volume 1, 2nd Ed., 1998, p. 168):

int pselect (int maxfdp1, fd_set *readset, fd_set *writeset, 
	     fd_set *exceptset, const struct *timespec, const sigset_t *sigmask);

Stevens states that this is "Posix.1g".  AFAIK Posix.1g is still not
released and therefore I'd like to know what the "right" interface is.

The differences between the definitions are:
- _const_ struct timespec * versus struct timespec *
- additional paramter *sigmask.  Stevens writes: "pselect adds a sixth 
  argument: a pointer to a signal mask.  This allows the program to
  disable the delivery of certain signals, test some global variables
  that are set by the handlers for these now-disabled signals, and
  then call pselect, telling it to reset the signal mask."

-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


More information about the Libc-hacker mailing list