⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p7.14.c

📁 linux编程源代码,其中是由大量的实例
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>int main(int argc,char* argv[]){	pid_t pid;	int exit_code;	pid=getpid();	srand((unsigned)pid);	exit_code=(int)(rand() % 256);	sleep(10);	if(atoi(*(argv+1)) % 2){		printf("the child process id:%d receive signal SIGKILL\n",pid);		kill(pid,9);	}else{		printf("the child process id:%d normally exit,exit_code is %0x\n",pid,exit_code);		exit(exit_code);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -