glibc/nptl/tst-signal7.c

60 lines
1.6 KiB
C
Raw Normal View History

2007-07-13 02:26:36 +08:00
/* Copyright (C) 2005 Free Software Foundation, Inc.
2004-12-23 04:09:42 +08:00
This file is part of the GNU C Library.
2007-07-13 02:26:36 +08:00
Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
2004-12-23 04:09:42 +08:00
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
2007-07-13 02:26:36 +08:00
#include <errno.h>
#include <pthreadP.h>
#include <signal.h>
2004-12-23 04:09:42 +08:00
#include <stdio.h>
static int
do_test (void)
{
2007-07-13 02:26:36 +08:00
int result = 0;
2004-12-23 04:09:42 +08:00
2007-07-13 02:26:36 +08:00
errno = 0;
if (sigaction (SIGCANCEL, NULL, NULL) == 0)
2004-12-23 04:09:42 +08:00
{
2007-07-13 02:26:36 +08:00
puts ("sigaction(SIGCANCEL) did not fail");
result = 1;
2004-12-23 04:09:42 +08:00
}
2007-07-13 02:26:36 +08:00
else if (errno != EINVAL)
2004-12-23 04:09:42 +08:00
{
2007-07-13 02:26:36 +08:00
puts ("sigaction(SIGCANCEL) did not set errno to EINVAL");
result = 1;
2004-12-23 04:09:42 +08:00
}
2007-07-13 02:26:36 +08:00
errno = 0;
if (sigaction (SIGSETXID, NULL, NULL) == 0)
{
puts ("sigaction(SIGSETXID) did not fail");
result = 1;
}
else if (errno != EINVAL)
{
puts ("sigaction(SIGSETXID) did not set errno to EINVAL");
result = 1;
}
2004-12-23 04:09:42 +08:00
2007-07-13 02:26:36 +08:00
return result;
2004-12-23 04:09:42 +08:00
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"