📄 lab4-1.c
字号:
#include <stdio.h>#include<stdlib.h>#include<unistd.h>#include<sys/types.h>#include <sys/wait.h>int main(void){ pid_t pid, pid2; while((pid=fork()) < 0); if(pid==0){ printf("The son1 start:\n"); if(execl("/etc/linfeng/test-8led-exe","","","NULL")<0) printf("linfeng is testing wrong. son1==!!!\n"); }else{ while((pid2=fork())<0); if(pid2==0){ sleep(5); printf("The son2 start:\n"); if(execl("/etc/linfeng/test-led-exe","","","NULL")<0) printf("linfeng is testing wrong. son2==!!!\n"); } } exit(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -