|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Sigsuspend function of the way?
Int received_signal=0;
Void catch_ctrl_c (int signo)
(Printf ( "catch signal %d\n" signo);
Printf ( "set received signal flag\n");
Received_signal=1;}
Main (int argc, char **argv)
{
Sigset_t newmask;
Struct sigaction action;
Action.sa_handler=catch_ctrl_c;
Sigemptyset (&action.sa_mask);
Action.sa_flags=0;
If (sigaction (SIGINT, &action, NULL) ==-1)
Perror ( "can not install the handler for SIGINT");
Sigprocmask (SIG_BLOCK, &newmask, NULL);
Sigdelset (&newmask, SIGINT);
Printf ( "waiting for signal SIGINT\n");
While (received_signal==0)
Sigsuspend (&newmask);
}
What is the use of this function will sigsuspend ah
It would obstruct the process? |
Sigsuspend function of the way?
How Mody no response ah |
| |