linux定时器
摘要:
今天看书看到了关于alarm的一些用法,自己有在网上找了些资料看了下;1。alarm()执行后,进程将继续执行,在后期(alarm以后)的执行过程中将会在seconds秒后收到信号SIGALRM并执行其处理函数。#include <stdio.h>#include <unistd.h>#include <signal.h>void sigalrm_fn(int sig){ printf("alarm!\n"); alarm(2); return;}int main(void){ signal(SIGALRM, sigalrm_fn); a 阅读全文
posted @ 2012-04-11 14:16 心心程序博客 阅读(28867) 评论(0) 推荐(2) 编辑