1 /* 2 * Copyright (c) 2002-2003, Intel Corporation. All rights reserved. 3 * Created by: salwan.searty 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 that when signo in sigqueue() is invalid, then -1 is returned 9 * and errno is set to [EINVAL] 10 11 */ 12 13 #define _XOPEN_REALTIME 1 14 15 #include <signal.h> 16 #include <stdio.h> 17 #include <stdlib.h> 18 #include <unistd.h> 19 #include <errno.h> 20 #include <sys/types.h> 21 #include "posixtest.h" 22 23 int main(void) 24 { 25 int failure = 0; 26 union sigval value; 27 value.sival_int = 0; /* 0 is just an arbitrary value */ 28 29 if (-1 == sigqueue(getpid(), -1, value)) { 30 if (EINVAL == errno) { 31 printf("EINVAL error received\n"); 32 } else { 33 printf 34 ("sigqueue() failed on EINVAL but errno not set correctly\n"); 35 failure = 1; 36 } 37 } else { 38 printf("sigqueue() did not return -1 on EINVAL\n"); 39 failure = 1; 40 } 41 42 if (failure) { 43 return PTS_FAIL; 44 } 45 printf("Test PASSED\n"); 46 return PTS_PASS; 47 } 48