Sighup
Hi we have ctrl-c key stroke to generate SIGINT signal. Then whats the key stroke for SIGHUP signal. I had to use in the script. Please help.
|
Quote:
SIGHUP, like many other signals, is not tied to any particular key on the keyboard, unlike SIGINT (the <CTRL>-C), and others that are supposed to come from the TTY. In the old days, it was common to dial up a computer from your terminal and log in, the same way you log in on a virtual console after pressing, say, <CTRL><ALT><F1> to get to that virtual console in the first place. No PPP, no Internet, no network connection at all. You can still configure your Linux system to accept phone calls via your modem and directly present the caller with a login screen. Once the user logs in this way, he gets a shell prompt. He can then run programs. If, during the running of a program, the modem disconnects, the program receives SIGHUP. HUP stands for "hang up", as in hang up the phone. So if you want to go to that trouble, you generate a SIGHUP that way. You can also generate a SIGHUP for a particular process number x by going to another virtual terminal or xterm window and typing at the shell prompt "kill -HUP <PID>" |
hI TBONE
Hi i have to write a program to show the working of signals. I have written like this for SIGINT and SIGQUIT. But not sure for how to continue it for using SIGHUP. What is the program here should be for SIGHUP.
#include <stdio.h> #include <signal.h> #include <sys/wait.h> void sigproc(); main() { signal(SIGINT, sigproc); sigproc(SIGQUIT, sigproc); for(;;) { PRINTF("SUMAN"); } } void sigproc() { printf("you have pressed ctrl-c \n"); void sigproc() { printf("you have pressed ctrl-\ \n"); } I am asking how to make it for SIGHUP. Please help. |
Forget about 'keyboard' signals.
Just read man 2 signal man 7 signal |
Quote:
Quote:
And this very much sounds like homework.... |
Quote:
palisetty; I think we're starting to see a pattern here--are you planning to simply use LQ as a homework service? |
HI
Yes it is my home work but i asked you only after i tried and even i wrote what i got. So whats wrong? You told that OP's have to try first and to show what they did before asking for homework. So i did not get where i did wrong.
|
Quote:
I think the issue is that your posting history gives the impression that you are simply relaying the homework questions as you get them. |
And I'm closing this thread now ... this chap is a very
persistent "homework question poster", and violating our rules pretty much in every thread. |
All times are GMT -5. The time now is 06:35 AM. |