fork compare to exec in linux c program
pid_t pid=fork()
it has 3 situation for the return result pid
0 child
>0 parent process
<0 fork fail
fork create a new process and it parent live alse when the child process had been created
相关文档:
1 shutdown:
[NAME
] shutdown - bring the system down
SYNOPSIS
/sbin/shutdown [-t sec] [-arkhncfF] time [warning-message]
DESCRIPTION
shutdown brings the system down in a secure way.&nb ......
在win主机上用ipconfig查看VMnet8的IP地址,
一般是192.168.X.1/255.255.255.0,
此时VMnet8的设置应该是自动获取IP,现在改成静态IP,并把此IP直接填入VMnet8里,不设网关。
同时在VM网络设置里的NAT项中查看VMnet8,一般是192.168.X.2/255.255.255.0
这个地址就是VMnet8,NAT的网关
现在在LINUX下把网卡I ......
程序12:类似java 里面的switch case
[root@localhost scripts]# cat sh12.sh
read -p "input comand:" command
case $command in
"fix")
echo "fix system"
;;
"fuck")
echo "fuck you"
;;
*)
echo "what a stupid man!ex>$0 some word"
......
在实现驱动程序的mmap函数时,要注意映射地址的转换问题,见代码。
定义一个设备结构体:
struct leedriver
{
struct cdev cdev;
unsigned char mem[MEMSIZE];
};
这里面这个MEMSIZE,最小都要是4096,因为内存映射是以页为单位的。
在实现simple_remap_mmap函数时,代码如下
static int simple_remap_mmap(stru ......
pid_t pid=fork()
it has 3 situation for the return result pid
0 child
>0 parent process
<0 fork fail
fork create a new process and it parent live alse when the child process had been created ......