source:
tags/syscall-add-simple-foo/forca.c
Last change on this file was 2, checked in by , 13 years ago | |
---|---|
File size: 353 bytes |
Line | |
---|---|
1 | #include <unistd.h> |
2 | #include <stdio.h> |
3 | #include <stdlib.h> |
4 | |
5 | int main(void){ |
6 | int x = fork(); |
7 | if (x < 0){ |
8 | perror("Errore nella fork:"); |
9 | exit(1); |
10 | } else { |
11 | if (x != 0){ |
12 | while(1) printf("Processo padre (Figlio: %d)\n", x); |
13 | } else { |
14 | while(1) printf("Processo figlio (%d)\n", x); |
15 | } |
16 | } |
17 | return 0; |
18 | } |
19 | |
20 | |
21 | |
22 |
Note:
See TracBrowser
for help on using the repository browser.