1 /*
2 * Copyright (c) 2002-3, 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 the killpg() function shall set errno to ESRCH if it is
9 passed an invalid process group number
10
11 */
12
13
14 #include <signal.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <unistd.h>
18 #include <errno.h>
19 #include "posixtest.h"
20
main(void)21 int main(void)
22 {
23 if (killpg(999999, 0) != -1) {
24 printf
25 ("killpg did not return -1 even though it was passed an invalid process group id.");
26 return PTS_UNRESOLVED;
27 }
28
29 if (errno != ESRCH) {
30 printf
31 ("killpg did not set errno to ESRCH even though it was passed an invalid signal number.");
32 return PTS_FAIL;
33 }
34
35 printf("Test PASSED\n");
36 return PTS_PASS;
37 }
38