Sponsored Content
Full Discussion: Multiple Signals
Top Forums Programming Multiple Signals Post 34052 by S.P.Prasad on Saturday 1st of February 2003 01:55:05 AM
Old 02-01-2003
I did tried your code as you have posted.But it did not generate the result as you have stated. The signal handler was called only once inspite of multiple signals instances feeded to it. I have tried your code both on SCO 5.5 and SunOS 5.8.The output is same as I have stated.
The problem is that for the Process Manager there can be a possibility that all the process can get killed at a single moment. In this scenario I will receive a single instance of SIGCHLD. This will be a very major problem with respect to development.
Thanks for all your consideration to my request but if you can provide us a best solution ( as you have already did many times ) it would be very helpful to us.
 

10 More Discussions You Might Find Interesting

1. Programming

Signals In HP-UX

does the way of handling, interrupting signals in HP-UX same as that of solaris. If there is difference than what it is.?:confused: (1 Reply)
Discussion started by: kapilv
1 Replies

2. Programming

Threads Signals

Hi In my process there are few threads. Now, lets say all the threads are blocked for some reason or other.. now i read it somewhere that the kernel in this situation sends in some signal which can be caught. please let me know what signal is it and more details about that.. Thanks in... (1 Reply)
Discussion started by: uday_kumar_spl
1 Replies

3. UNIX for Dummies Questions & Answers

Signals...

(posted this in the scripting forum as well, but figured it should go here) So, what's going on is this: For our program, we had to create our own shell, and if the user pressed ctrl-c just at the cmdline, then this signal would be ignored, but if there is a foreground process running, let's... (0 Replies)
Discussion started by: blind melon
0 Replies

4. Programming

Using Signals

How can use signals in a C program If i want a child program to signal it's parent program that it(child) program has completed the task that it was assigned.:confused: (2 Replies)
Discussion started by: kapilv
2 Replies

5. UNIX for Dummies Questions & Answers

threads and signals

can any one give me an example of a concurrency program in threads and signals, i.e how to deliver messages between threads using signals. thanks (0 Replies)
Discussion started by: moe_7
0 Replies

6. Programming

threads and signals

can any one give me an example of a concurrency program in threads and signals, i.e how to deliver messages between threads using signals. thanks (2 Replies)
Discussion started by: moe_7
2 Replies

7. OS X (Apple)

How to debug signals

Hi, In our program, we are using SIGTERM and i tired to put break point in this function. But my debuger is unable to brake at that point. I am working on Mac X and using XCode. Thanks (0 Replies)
Discussion started by: Saurabh78
0 Replies

8. Programming

Can we debug Signals

Hi, In our program, we are using SIGTERM and i tired to put break point in this function. But my debuger is unable to brake at that point. I am working on Mac X and using XCode. Thanks (1 Reply)
Discussion started by: Saurabh78
1 Replies

9. Programming

C++ signals Linux

how can do this programs in c++ Program description: Infinite loop in a program starts working with 2 seconds the screen (console) "I 'm trying" to write, but it automatically after 10 seconds, the screen "Close" will terminate the execution of typing. c++ code (3 Replies)
Discussion started by: ss54
3 Replies

10. UNIX for Advanced & Expert Users

Help with Signals

Hi All, The problem statement is as below: Problem: A process (exe) is getting executed in background. The output of this process is getting logged in a file. After successfully running for some time the process gets terminated. In the log file following is present: ^M[7m Interrupt ^M[27m... (8 Replies)
Discussion started by: Praty.27
8 Replies
SIGNAL(3)						   BSD Library Functions Manual 						 SIGNAL(3)

NAME
signal -- simplified software signal facilities LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <signal.h> void (* signal(int sig, void (*func)(int)))(int); DESCRIPTION
This signal() facility is a simplified interface to the more general sigaction(2) facility. Signals allow the manipulation of a process from outside its domain as well as allowing the process to manipulate itself or copies of itself (children). There are two general types of signals: those that cause termination of a process and those that do not. Signals which cause termination of a program might result from an irrecoverable error or might be the result of a user at a terminal typing the `interrupt' char- acter. Signals are used when a process is stopped because it wishes to access its control terminal while in the background (see tty(4)). Signals are optionally generated when a process resumes after being stopped, when the status of child processes changes, or when input is ready at the control terminal. Most signals result in the termination of the process receiving them if no action is taken; some signals instead cause the process receiving them to be stopped, or are simply discarded if the process has not requested otherwise. Except for the SIGKILL and SIGSTOP signals, the signal() function allows for a signal to be caught, to be ignored, or to generate an interrupt. See signal(7) for comprehensive list of supported signals. The func procedure allows a user to choose the action upon receipt of a signal. To set the default action of the signal to occur as listed above, func should be SIG_DFL. A SIG_DFL resets the default action. To ignore the signal func should be SIG_IGN. This will cause subse- quent instances of the signal to be ignored and pending instances to be discarded. If SIG_IGN is not used, further occurrences of the signal are automatically blocked and func is called. The handled signal is unblocked when the function returns and the process continues from where it left off when the signal occurred. Unlike previous signal facilities, the handler func() remains installed after a signal has been delivered. For some system calls, if a signal is caught while the call is executing and the call is prematurely terminated, the call is automatically restarted. (The handler is installed using the SA_RESTART flag with sigaction(2)). The affected system calls include read(2), write(2), sendto(2), recvfrom(2), sendmsg(2) and recvmsg(2) on a communications channel or a low speed device and during a ioctl(2) or wait(2). How- ever, calls that have already committed are not restarted, but instead return a partial success (for example, a short read count). When a process which has installed signal handlers forks, the child process inherits the signals. All caught signals may be reset to their default action by a call to the execve(2) function; ignored signals remain ignored. Only functions that are async-signal-safe can safely be used in signal handlers, see signal(7) for a complete list. RETURN VALUES
The previous action is returned on a successful call. Otherwise, SIG_ERR is returned and the global variable errno is set to indicate the error. ERRORS
signal() will fail and no action will take place if one of the following occur: [EINVAL] Specified sig is not a valid signal number. [EINVAL] An attempt is made to ignore or supply a handler for SIGKILL or SIGSTOP. SEE ALSO
kill(1), kill(2), ptrace(2), sigaction(2), sigaltstack(2), sigprocmask(2), sigsuspend(2), psignal(3), setjmp(3), strsignal(3), tty(4), signal(7) HISTORY
This signal() facility appeared in 4.0BSD. BSD
June 11, 2004 BSD
All times are GMT -4. The time now is 01:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy