📄 forkdemo1.c
字号:
/* forkdemo1.c * shows how fork creates two processes, distinguishable * by the different return values from fork() */#include <stdio.h>main(){ int ret_from_fork, mypid; mypid = getpid(); /* who am i? */ printf("Before: my pid is %d\n", mypid); /* tell the world */ ret_from_fork = fork(); sleep(1); printf("After: my pid is %d, fork() said %d\n", getpid(), ret_from_fork);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -