LINUX 进程间 信号
#include <iostream>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <signal.h>
using namespace std;
extern char **environ;
void signal_handle(int signal_no){
cout << "sign:" <<signal_no << endl;
}
int main(int args,char *argc[]){
pid_t pid=fork();
if(pid<0){
cout << "fork error!" <<endl;
}else if(pid==0){
signal(SIGUSR1,signal_handle_kill);
int count=0;
while(count<10){
count++;
cout << "count:" <<count <<endl;
sleep(1);
}
kill(getppid(),SIGUSR1);
}else{
signal(SIGUSR1,signal_handle);
pause();
}
}
相关文档:
总览
用iptables -ADC 来指定链的规
则
,-A添加 -D删除 -C 修改
iptables - [RI] chain rule num rule-specification[option]
用iptables - RI 通过规则的顺序指定
iptables -D chain rule num[option]
删除指定规则
iptables -[LFZ] [chain][option]
用iptables -LFZ 链名 [选项]
iptables -[NX] chain
用 -NX ......
#!/bin/bash
#Key Words:linux0.11 bochs harddisk bash
#mount hdimg name:hdimage-devel
#mount point:/mnt/initrd
hdimg=hdimage-devel
mpoint=/mnt/initrd
if [ "$1" == "mount" ]
then
#mount hdimg
echo "$1 START"
&n ......
In my embedded platform, I want to use tftp command,
run tftp, it will output:
Usage: tftp [OPTION]... HOST [PORT]
Transfer a file from/to tftp server
Options:
-l FILE Local FILE
-r FILE Remote FILE
&n ......
以 i2c-mpc.c 驱动模块为例
fsl_i2c_init -> of_register_platform_driver -> of_register_driver -> driver_register -> bus_add_driver -> driver_attach
-> bus_for_each_dev -> __driver_attach -> driver_probe_device -> really_probe -> drv->probe(dev); ......