qfedu-linux-advanced-level/day2/d6.c

13 lines
335 B
C

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char const *argv[])
{
printf("%d fork before\n", getpid()); // 向缓冲区写入数据
int pid = fork();
// int pid2 = fork();
// int pid3 = fork();
// printf("%d fork after\n", getpid()); // 向缓冲区写入数据
return 0;
}