This is the mail archive of the cygwin-patches@sources.redhat.com mailing list for the Cygwin project.


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

Re: einval-on-wrong-args patch


On Fri, Feb 16, 2001 at 08:50:19PM +0300, Egor Duda wrote:
>Hi!
>
>Friday, 16 February, 2001 Christopher Faylor cgf@redhat.com wrote:
>
>>>  return  EINVAL  if  signal()  or  lseek()  are  called  with illegal
>>>arguments.
>
>CF> Either your signal() change is not quite right, or sigaction() is wrong.
>CF> sigaction() allows setting the handler for SIGKILL to SIG_DFL.  Is
>CF> that incorrect?  If not, then please modify your change (and check it in).
>CF> If it is the incorrect behavior, could you fix sigaction, too?
>
>SUSv2 is a bit vague on the subject, but this program
>
>#include <stdio.h>
>#include <signal.h>
>
>main ()
>{
>  struct sigaction act;
>  act.sa_handler = SIG_DFL;
>  act.sa_flags = 0;
>  act.sa_sigaction = NULL;
>  sigemptyset ( &act.sa_mask );
>  if ( signal ( SIGKILL, SIG_DFL ) == SIG_ERR ) perror ("signal" );
>  if ( sigaction ( SIGKILL, NULL, NULL ) ) perror ( "sigaction1" );
>  if ( sigaction ( SIGKILL, &act, NULL ) ) perror ( "sigaction2" );
>}
>
>when run on linux, prints
>
>signal: Invalid argument
>sigaction2: Invalid argument
>
>so  perhaps sigaction should be fixed. moreover, SUSv2 says that if we
>add SIGKILL or SIGSTOP to sa_mask, this should be silently ignored.

Hopefully that much is true, at least.

Would you mind checking in your patch and fixing sigaction to conform to
linux?

Thanks,
cgf


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