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

📄 myint.c.svn-base

📁 os project / shell 程序
💻 SVN-BASE
字号:
/*  * myint.c - Another handy routine for testing your tiny shell *  * usage: myint <n> * Sleeps for <n> seconds and sends SIGINT to itself. * */#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <sys/types.h>#include <sys/wait.h>#include <signal.h>int main(int argc, char **argv) {    int i, secs;    pid_t pid;     if (argc != 2) {	fprintf(stderr, "Usage: %s <n>\n", argv[0]);	exit(0);    }    secs = atoi(argv[1]);    for (i=0; i < secs; i++)       sleep(1);	    pid = getpid();     if (kill(pid, SIGINT) < 0)       fprintf(stderr, "kill (int) error");    exit(0);}

⌨️ 快捷键说明

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