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

13 lines
335 B
C
Raw Permalink Normal View History

2023-08-15 19:05:13 +08:00
#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;
}