文件名称:fork_textcanjian
-
所属分类:
- 标签属性:
- 上传时间:2008-10-13
-
文件大小:8.02kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
1、 了解系统调用fork()、execl()、exit()、getpid()和waitpid()的功能和实现过程
2、 编写一段程序实现以下功能:
a) 使用系统调用fork()创建两个子进程
b) 父进程重复显示字符串”parent:”,并使用函数getpid()显示自己的进程ID。
c) 两个子进程分别重复显示字符串”child:”,并使用函数getpid()显示自己的进程ID
3、 编写一段程序实现以下功能:
a) 使用系统调用fork()创建一个子进程
b) 子进程显示自己的进程ID和字符串\": The child is calling an exec.\\n\",然后通过execl()调用系统命令ps显示当前运行的进程情况,从而更换自己的执行代码,最后调用exit()结束。
c) 父进程显示自己的进程ID和字符串” \": The parent is waiting for child to exit.\\n \",然后调用waitpid()等待子进程结束,并在子进程结束后显示”The parent exit.\\n
-1, the understanding of the system call fork (), execl (), exit (), getpid (), and waitpid () function and process 2, write a procedure to achieve the following functions : a) The use of system calls fork () to create two child process b) the parent process repeated string "parent : ", and the use of function getpid () show their ID process. C) two separate child process repeated string "child :" and the use of function getpid () show their ID 3 process, to prepare a process to achieve the following functions : a) The use of system calls fork () to create a child process b) children show their ID process, and the string " : The child is calling an exec. \\ n " Then execl () call system commands ps shows currently running process, thereby replacing the execution
2、 编写一段程序实现以下功能:
a) 使用系统调用fork()创建两个子进程
b) 父进程重复显示字符串”parent:”,并使用函数getpid()显示自己的进程ID。
c) 两个子进程分别重复显示字符串”child:”,并使用函数getpid()显示自己的进程ID
3、 编写一段程序实现以下功能:
a) 使用系统调用fork()创建一个子进程
b) 子进程显示自己的进程ID和字符串\": The child is calling an exec.\\n\",然后通过execl()调用系统命令ps显示当前运行的进程情况,从而更换自己的执行代码,最后调用exit()结束。
c) 父进程显示自己的进程ID和字符串” \": The parent is waiting for child to exit.\\n \",然后调用waitpid()等待子进程结束,并在子进程结束后显示”The parent exit.\\n
-1, the understanding of the system call fork (), execl (), exit (), getpid (), and waitpid () function and process 2, write a procedure to achieve the following functions : a) The use of system calls fork () to create two child process b) the parent process repeated string "parent : ", and the use of function getpid () show their ID process. C) two separate child process repeated string "child :" and the use of function getpid () show their ID 3 process, to prepare a process to achieve the following functions : a) The use of system calls fork () to create a child process b) children show their ID process, and the string " : The child is calling an exec. \\ n " Then execl () call system commands ps shows currently running process, thereby replacing the execution
(系统自动生成,下载前可以参看下载内容)
下载文件列表
fork_test.c
fork_test.exe
forktest.c
forktest.exe
www.dssz.com.txt
fork_test.exe
forktest.c
forktest.exe
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.