
本文共 2227 字,大约阅读时间需要 7 分钟。
������
������������������������
#include "stdlib.h"
#include "sys/wait.h"
#include "sys/types.h"
int system(const char *command);
������������������
���������������������������������������������
������fork������������������������������fork���������������������-1���
���������������������shell������
������������execl������������/bin/sh���������������������������������������"sh -c command"���
���������������������������������shell������������������status������8-15���������������������������
������������������������������������
������waitpid������������������������������������������������������������status���������8-15���������������������������
������������������������������������������������������������������������
���������������
system������������������������
-1���������������
0������������������������������������
>0���������������������������������������������PID
���������������������
������������������
wifexited(status)������������������������������������
wexitstatus(status)������������������������������������
wifsigENDED(status)���������������������������������
wtermigd(status)���������������������������
wifstopped(status)������������������������������������������
wstopsig(status)������������������������������������
������������������
������system()���������SIGCHLD���������������������SIGINT���SIGQUIT���������������������
���������������������������I/O���������������������������������
������������������
������������������������������������������
#include "stdio.h"
#include "stdlib.h"
#include "sys/wait.h"
#include "sys/types.h"
int main(int argc, char **argv) {
int ret = 0;
ret = system(command);
if (ret == -1) {
printf("system������������\n");
} else {/* ��������������������������� */
}
发表评论
最新留言
关于作者
