Sponsored Content
Full Discussion: Signal Default Action
Top Forums Programming Signal Default Action Post 302147629 by matrixmadhan on Wednesday 28th of November 2007 12:19:15 AM
Old 11-28-2007
Quote:
The sigaction() function provides a more comprehensive and reliable mechanism for controlling signals; new applications should use sigaction() rather than signal().
I perfectly agree with the above and have been using that only.

Am just curious to know about the behavior of signal(); and why its behavior is different in different systems.

Is it due to the reason that different libraries are in use ? If so, how to identify them ?

Quote:
from occurring until the current signal handling has completed
Am confused about this too, there is no guarantee with the older semantics that the signal of same type will not be delivered while the current function block for the signal is being executed.

In that case, there is no reason for it to wait till the function block is executed.

In short, can it be said signal() behavior is undefined - or am I being rude in saying that ?
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

any idea to repeat a action in VI

Any idea to repeat an action to all the lines in vi... suppose i want to delete the first word from all the lines in VI .. how would i do it ? in general i am also looking for a way to apply a action to all the lines in VI . (6 Replies)
Discussion started by: myelvis
6 Replies

2. Shell Programming and Scripting

action command

Hi.. When i refered the script /etc/rc.sysinit... i found the "action commands" like But this is not working in my shells.. the following error is coming... Please anybody help Thanks in advance esham (5 Replies)
Discussion started by: esham
5 Replies

3. Shell Programming and Scripting

same action in then as in else: explanation?

in /etc/init.d/networking of an ubuntu computer, I found this code: if ifdown -a --exclude=lo; then log_action_end_msg $? else log_action_end_msg $? fi Shouldn't it be replace by ifdown -a --exclude=lo ... (0 Replies)
Discussion started by: raphinou
0 Replies

4. Shell Programming and Scripting

Need help with find its action

I am writing a shell script that takes at least 2 arguments. The first is an octal representation of file permissions, the second is a command that is executed on all the files found with that permission. #!/bin/sh find . -perm $1 -exec $2 $3 $4 {} \; invoked: ./script.sh 543 ls -la what... (3 Replies)
Discussion started by: computethis
3 Replies

5. AIX

Received signal #11, SIGSEGV [default] on AIX 6.1

Hello, One of our customer is getting segmentation fault when he runs his shell script which invokes our executable on AIX 6.1. On AIX 5.3, there were no issues. Here is the truss output. 811242: __loadx(0x0A040000, 0xF0D3A26C, 0x00000000, 0x00000009, 0x00000000) = 0xF026E884... (0 Replies)
Discussion started by: erra_krishna
0 Replies

6. Shell Programming and Scripting

multiple action!

lets explain it easy by showing the initial file and desired file: I've a file such this that contains: initial_file: 31/12/2011 23:46:08 38.6762 43.689 14.16 Ml 3.1 ... (1 Reply)
Discussion started by: oreka18
1 Replies
signal(2)							System Calls Manual							 signal(2)

NAME
signal - Modifies signal functions SYNOPSIS
#include <signal.h> void (*signal( int sig, void (*function)(int)) (int) ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: signal(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Defines the signal. All signals are valid with the exception of SIGKILL and SIGSTOP. Specifies the address of a signal handler. DESCRIPTION
The signal function provides compatibility for older versions of the operating system whose function is a subset of the sigaction function. The signal function sets the action associated with a signal. The function parameter uses the values SIG_DFL, SIG_IGN, or it can point to an address of a signal handler. A SIG_DFL value specifies the default action that is to be taken when the signal is delivered. A value of SIG_IGN specifies that the sig- nal has no effect on the receiving process. A pointer to a function requests that the signal be caught; that is, the signal should cause the function to be called. These actions are more fully described in the <signal.h> file. NOTES
The sigaction() function provides a more comprehensive and reliable mechanism for controlling signals and is recommended instead of sig- nal() for new applications. [Tru64 UNIX] The effect of calling the signal function behavior differs depending on whether the calling program is linked with either of the special libraries, libbsd or libsys5, which supply BSD or System V signaling characteristics respectively. If neither library is used, the behavior is the same as that of the sigaction function with all the flags set to 0 (zero). If the libsys5 library is used (through compilation with the -lsys5 switch), then the specified signal is not blocked from delivery when the handler is entered, and the disposi- tion of the signal reverts to SIG_DFL when the signal is delivered. If the libbsd library or the bsd_signal() function is used, the behav- ior is the same as that of the sigaction() function with the SA_RESTART flag set. [Tru64 UNIX] When compiled in the X/Open UNIX environment, calls to the signal() function are internally renamed by prepending _E to the function name. When you are debugging a module that includes the libc version of the signal() function and for which _XOPEN_SOURCE_EXTENDED has been defined, use _Esignal to refer to the signal() call. See standards(5) for information on when the _XOPEN_SOURCE_EXTENDED macro is defined. RETURN VALUES
Upon successful completion of the signal function, the value of the previous signal action is returned. Otherwise, SIG_ERR is returned and errno is set to indicate the error. ERRORS
The signal() function sets errno to the specified values for the following conditions: The sig parameter is not a valid signal number or an attempt was made to catch a signal that cannot be caught or to ignore a signal that cannot be ignored. SEE ALSO
Commands: kill(1) Functions: acct(2), bsd_signal(2), exit(2), kill(2), pause(3), ptrace(2), setjmp(3), sigaction(2), sigblock(2), sigpause(3), sigproc- mask(2), sigstack(2), sigsuspend(2), sigvec(2), umask(2), wait(2) Files: signal(4) Standards: standards(5) signal(2)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy