Path: utzoo!utgpu!watserv1!watmath!att!hriso!attdso!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c Subject: Re: Catching ^C and ^Z Summary: ^C is not kill and you don't ignore a SIGSTOP, you prevent it. Message-ID: <439@mole-end.UUCP> Date: 8 Sep 90 05:30:00 GMT References: Organization: mole-end--private system. admin: mole-end!newtnews Lines: 31 > > [I wanna write a lockscreen.] > weisen@eniac.seas.upenn.edu: > > Under BSD, you should be able to do something like: > > signal(SIGINT,SIG_IGN); > > signal(SIGQUIT,SIG_IGN); > > to IGNore the signals. > SunOS signal(3): > > SIGKILL 9 kill (cannot be caught, blocked, or ignored) > > SIGSTOP 17 stop (cannot be caught, blocked, or ignored) > Therein lies the incentive to capture the characters before a shell can see > them. Well, if you are under SunOS you already have a very nice lockscreen, at least in all the windowing environments. BUT ^C does NOT generate a SIGKILL, it generates a SIGINT (or does SunOS still call it a SIGDEL ?) That certainly CAN be caught or ignored. To prevent being SIGSTOPped, you read the terminal modes ( ioctl() ) to determine the present stop character, SET the stop character to NUL (thereby disabling the feature) and RESTORE the stop character before you go away. This is really a Unix/Berzerkelix/SunOS question, you know ... -- (This man's opinions are his own.) From mole-end Mark Terribile