/* 利用信号实现父子进程通信(传递信息)和同步,author by bob #include #include #include
void sig_usr2(int signo,siginfo_t *info,void *myact) { printf("signo = %d\n",signo); printf("child process has sent its signal \n"); } int main(void) { sigset_t wait_set; int sig_no; const struct timespec tv = {5,0}; //timeout siginfo_t sig_info ;//传递的信息结构 pid_t pid = 0;