mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 18:03:25 +00:00
Reorganize the codebase
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
888853a6de
commit
271a16d492
10
regression/apps/fork_c/Makefile
Normal file
10
regression/apps/fork_c/Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
.PHONY: build clean run
|
||||
|
||||
build: fork.c
|
||||
@gcc -static fork.c -o fork
|
||||
|
||||
clean:
|
||||
@rm fork
|
||||
|
||||
run: build
|
||||
@./fork
|
3
regression/apps/fork_c/fork
Executable file
3
regression/apps/fork_c/fork
Executable file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ca7a77a72da160f11670a04a16b623944295b9059399da45f57668f121b00d11
|
||||
size 877152
|
14
regression/apps/fork_c/fork.c
Normal file
14
regression/apps/fork_c/fork.c
Normal file
@ -0,0 +1,14 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user