www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/05/07/07:50:46

From: proven AT io DOT proven DOT org (Chris Provenzano)
Subject: Re: sigaddset, sigdelset, sigmasks "wrong" in cygwin32
7 May 1998 07:50:46 -0700 :
Message-ID: <199805071321.GAA00259.cygnus.cygwin32.developers@io.proven.org>
References: <199805062319 DOT TAA00935 AT kramden DOT cygnus DOT com>
To: Christopher Faylor <cgf AT cygnus DOT com>
Cc: cygwin32-developers AT cygnus DOT com, gnu-win32-local AT cygnus DOT com

>>From: Geoffrey Noer <noer AT cygnus DOT com>
>>Date: Wed, 6 May 1998 15:59:00 -0700 (PDT)
>>
>>Christopher Faylor wrote:
>>> 
>>> A net user has just brought to my attention the fact that there is,
>>> for some reason, macros in /usr/include/sys/signal.h which implement
>>> sigaddset and sigdelset.  This is clearly wrong as there are library
>>> routines to handle this and the macro does no bounds checking.
>>
>>I looked in the POSIX standard and it doesn't seem to specify that
>>sigaddset and sigdelset be macros.  The O'Reilly POSIX book doesn't
>>say one way or another either.
>
>The "Single UNIX Specification" refers to sigaddset, sigdelset, and
>sigismember as "functions".  It also mentions that they set errno is
>set which the macros don't do.
>
>This is a generic newlib problem, actually.  There is a macro for sigaddset
>which does not correspond with a function in libc/unix/sigset.c.
>
>I was mistaken in saying that sigdelset was a macro, btw.  It is only
>sigaddset and sigemptyset.
>
>I'm not sure what to do.  If we make this change now, that means that
>if we release B19.2 we'll also have to release every binary that uses
>sigaddset, sigdelset, etc.  The current macro implementation is wrong
>and the current implementation in winsup is wron.  I'm surprised that
>this hasn't broken something somewhere...
>

Just some clarification on errors for sigaddset() and friends and for
POSIX in general.

    3.3.3.4 Errors

    For each of the following conditions, if the condition is detected, 
    the sigaddset(), ...

POSIX consitiantly uses the "if the condition is detected" to mean a 
valid implementation does not have to check. This mean the macros are
compliant if they do no checking and always return 0 (success).

CAP

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019