1 /* 2 * Copyright (c) 2002, Intel Corporation. All rights reserved. 3 * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com 4 * This file is licensed under the GPL license. For the full content 5 * of this license, see the COPYING file at the top level of this 6 * source tree. 7 8 Test the error condition of calling sigdelset() to delete a signal not 9 there. 10 Test steps: 11 1) Initialize an empty signal set. 12 2) Verify the SIGCHLD signal is not in the empty signal set. 13 3) Attempt to remove the SIGCHLD signal from the signal set. 14 4) Verify the SIGCHLD signal is still not in the signal set. 15 */ 16 #include <stdio.h> 17 #include <signal.h> 18 #include "posixtest.h" 19 main(void)20int main(void) 21 { 22 sigset_t signalset; 23 24 if (sigemptyset(&signalset) == -1) { 25 perror("sigemptyset failed -- test aborted"); 26 return PTS_UNRESOLVED; 27 } 28 29 if (sigismember(&signalset, SIGCHLD) == 1) { 30 perror("SIGCHLD is already a member of signal set"); 31 return PTS_UNRESOLVED; 32 } 33 34 sigdelset(&signalset, SIGCHLD); 35 36 if (sigismember(&signalset, SIGCHLD) == 0) { 37 printf("Test PASSED\n"); 38 return PTS_PASS; 39 } else { 40 printf("Test FAILED\n"); 41 return PTS_FAIL; 42 } 43 } 44