mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-12 06:46:48 +00:00
14 lines
282 B
C
14 lines
282 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
int main() {
|
|
printf("before fork\n");
|
|
fflush(stdout);
|
|
if(fork() == 0) {
|
|
printf("after fork: Hello from child\n");
|
|
} else {
|
|
printf("after fork: Hello from parent\n");
|
|
}
|
|
fflush(stdout);
|
|
return 0;
|
|
} |