示例#1
0
文件: 10-4.c 项目: klion26/APUE
int main(void)
{
	printf("before\n");
	sleep1(5);
	printf("after\n");
	return 0;
}
示例#2
0
文件: prog10_4.c 项目: clamxyz/apue
int main(int argc, char *argv[])
{
	printf("start...\n");
	sleep1(5);
	printf("end...\n");
	return 0;
}
示例#3
0
文件: sleep2.c 项目: contry1/learngit
int main(int argc, char const *argv[])
{
    unsigned int unslep;
    if (signal(SIGINT,sig_int)==SIG_ERR)
    {
        /* code */printf("err sig int\n");
    }
    unslep = sleep1(5);
    printf("sleep1 return %u\n",unslep );
    return 0;
}
示例#4
0
文件: process.c 项目: whr4935/apue
int test_sleep1()
{
	int ret;
	time_t beg, end;

	signal(SIGINT, sleep1_sig_interrupt);

	beg = time(NULL);
	ret = sleep1(8);
	printf("sleep left time is %d\n", ret);
	end = time(NULL);

	printf("duration %d\n", end - beg);

	return 0;
}
示例#5
0
文件: 10.10.1.c 项目: cedarli/linux
int main(void){
    alarm(5);
    printf("main sleep1 before\n");
    sleep1(3);
    printf("main sleep1 after\n");
}