![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux进程与同步
文章平均质量分 64
CodingMonkey
这个作者很懒,什么都没留下…
展开
-
execve用法举例
通过execve简单的调用,下面我们要调用 “ls”来显示我当前目录下的文件 :/* * execve */#include #include #include int main(){ char *args[] = {"/bin/ls", NULL}; if(execve ("/bin/ls", args, NULL) == -1) { perror ("execv原创 2012-10-27 21:36:08 · 4377 阅读 · 0 评论 -
Kill用法举例
/* * Killing other processes */#include #include #include #include #include int main(){pid_t child;int status, retval;if((child = fork()) < 0){perror ("fork");exit (EXIT_FAILURE);}原创 2012-10-30 21:34:46 · 759 阅读 · 0 评论 -
fork系统调用
/* * simple fork usage */#include #include #include int main(){ pid_t child; if ((child = fork()) == -1) { perror("fork"); exit(EXIT_FAILURE); } else if(child == 0) { puts("in chil原创 2012-10-26 18:42:00 · 734 阅读 · 0 评论 -
使用system函数
system函数声明为: int system(const char *string);string为你要输入的命令。 实例如下:/* * Demonstrate the system() call */#include #include int main(){ int retval;//retval is the return value of the system ca原创 2012-10-26 17:38:19 · 529 阅读 · 0 评论