vlastni osetreni signalu SIGINT

Petr Uzel petr.uzel na centrum.cz
Čtvrtek Říjen 20 23:39:39 CEST 2005


> ---------------------------------------
> #include <stdio.h>
> #include <signal.h>
>
> void clean_exit(int i) {
>   printf("heeeelp! murdeeeer! \n");
>   return EOF;
>   fflush(stdout);
>   _exit(0);
>   /* a tak podobne */
> }
>
> int main(void) {
>   [...]
>   signal(SIGINT, clean_exit);
> }
> ---------------------------------------
>
> PS: Parametry funkce: 'void clean_exit(int i)' jsou takoveho typu na ktere
> si kompilator konecne prestal stezovat. Pak se mu ale samozrejme nelibi ten
> 'return EOF' kvuli tomu 'void'u

Zdravim,
   mozna jsem natvrdly, ale ceho vlastne chcete dosahnout pomoci toho 'return 
EOF' ? Nechcete ten EOF spis nasypat do stdout?


Další informace o konferenci Linux