Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> sigaction and signals in general
post Feb 12 2006, 12:21 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 12-February 06
Member No.: 6,059

Hi all.. im in need of some serious help.. i cant find any examples anywhere on how to use signals.. even a little ishy example.. i simply dont understand how to use them...


i have to write a simple chat program where a signal is sent USR1 to another process PID which happens when a user sends a message. The signal is to instruct the other process to 'wake up' .. to display the message then ask for a reply.. once its done replying.. it is supposed to suspend or make the process wait on the other process and so on etc..

i believe to send the signal its kill (pid, SIGUSR1) .. how do I make a process wait on this signal? .. how exactly does a process receive this signal and what does it do or where does it go when it receives this signal?

I have a method which is my method handler..

void messageHandler (int sig, siginfo_t *info, void *ctx)
       if (sig == SIGUSR1)
               fprintf(stdout, "SENDER PID: %d", info->si_pid);

this is a very simple message handler which Is just used to test.. its just printing out the PID of the process that sent the signal.. but I dont see how this method is ever called..


Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 16th July 2018 - 01:13 PM