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 return 0 upon success.
9 
10  */
11 
12 #define _XOPEN_SOURCE 600
13 
14 #include <signal.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <unistd.h>
18 #include "posixtest.h"
19 
main(void)20 int main(void)
21 {
22 	int pgrp;
23 
24 	if ((pgrp = getpgrp()) == -1) {
25 		printf("Could not get process group number\n");
26 		return PTS_UNRESOLVED;
27 	}
28 
29 	if (killpg(pgrp, 0) != 0) {
30 		printf("killpg did not return success.\n");
31 		return PTS_UNRESOLVED;
32 	}
33 
34 	printf("Test PASSED\n");
35 	return PTS_PASS;
36 }
37