This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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



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



>Number:         872
>Category:       libc
>Synopsis:       possibly incorrect pselect() definition
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Nov 24 00:00:02 EST 1998
>Last-Modified:
>Originator:     bwelling@anomaly.munge.com
>Organization:
net
>Release:        2.0.x, 2.1.x
>Environment:
anywhere
>Description:
The definition of pselect in glibc (2.1.103) is:

extern int __pselect __P ((int __nfds, __fd_set *__readfds,
                           __fd_set *__writefds, __fd_set *__exceptfds,
                           struct timespec *__timeout));

In Stevens' "UNIX Network Programming", BSD/OS 4.0, and the POSIX 1003.12 and 
1003.1g specs (supposedly - I haven't seen either spec), the definition is:

int pselect(int nfds, void *rfds, void *wfds, void *efds, struct timespec *tsp,
	    const sigset_t *sigmask)

Is glibc correct or outdated?
>How-To-Repeat:

>Fix:
>Audit-Trail:
>Unformatted:




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]