File: test-33333333.c

package info (click to toggle)
proot 5.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,012 kB
  • sloc: ansic: 18,627; sh: 1,662; python: 108; asm: 41; makefile: 16; awk: 6
file content (23 lines) | stat: -rw-r--r-- 428 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Check a child is traced even if its parent doesn't call wait(2).
 * 
 * Reported-by: Clément BAZIN <clement.bazin@st.com>
 *              on Ubuntu 11.10 x86_64
 */

#include <stdlib.h> /* exit(3), */
#include <unistd.h> /* fork(2), */

int main(void)
{
	switch (fork()) {
	case -1:
		exit(EXIT_FAILURE);

	case 0: /* Child: XXX */
		sleep(2);
		return 0;

	default: /* Parent: "look child, no wait(2)!" */
		return 1;
	}
}