o*****e 发帖数: 23 | 1 【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: oldbare (oldbare), 信区: Programming
标 题: Re: 如何屏蔽掉CTRL-Z(UNIX的TERMINAL) 急
发信站: The unknown SPACE (Sun Jul 9 17:32:17 2000) WWW-POST
我是这么写的, 虽然可以屏蔽掉CTRL-Z, 但也无法继续运行程序。
请各位帮忙看看, 谢了。
void
handler(int p)
{
printf("[pid:%ld] SigInt received in Main Program:\n^C
not allowed here, quit
the program normally.\n", (long) getpid());
sigset(SIGINT, handler);
printf("[pid:%ld] SigTstp received in Main Program:\n^Z
not allowed here,quit
the program normally.\n", |
|