Your question suggests that you are confused - or perhaps English is not your first language.
I have a signal that blocks SIGINT and basically says: "Sorry, you cannot exit. \ N"
, SIGINT. , "signal()" , sigaction() POSIX, .
, .
, 'this', -, , , . , , ; , . , SIGQUIT (, , ); , , , "kill -9 pid", .
f, scanf printf .
... , -, , 'printf()' ( , " " ) "scanf()"? ... - - , , .
printf, scanf . , . printf - .
- O/S ( POSIX.) 'scanf()'; . , , . "scanf()" . "scanf()" , , "sigsetjmp()" , "setjmp()", , "scanf()" ), 'siglongjmp()' :
sigjmp_buf trap;
int intermediary(int argument)
{
if (sigsetjmp(trap) == 0)
{
function_calling_scanf(argument);
return 0;
}
return -1;
}
:
:
scanf("get stuff") -> User is able to enter stuff in.
- > SIGINT .
- > "--" .
- > Scanf -- .
, scanf "--"? , .
, scanf ( , , , ).
sigsetjmp().
EDIT: , scanf . - scanf.
, "signal()" , , "sigaction()". "signal()" , , . 'sigaction()' ; (SIGINT) , . , , ( ).