?? test9_10.txt
字號(hào):
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <unistd.h>
int system(const char *cmdstring)
{
pid_t pid;
int status;
if(!cmdstring)
return(1);
if((pid=fork())<0)
status=-1;
else if(pid==0)
{
execl("/bin/sh", "sh", "-c",cmdstring, NULL);
_exit(255);
}
else
{
while(waitpid(pid, &status, 0)<0)
if(errno!=EINTR)
{
status=-1;
break;
}
}
return(status);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -