*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/signal (2)              
Title
Content
Arch
Section
 

Contents


SIGNAL(2)							     SIGNAL(2)


NAME    [Toc]    [Back]

     signal - software signal facilities (System V)

C SYNOPSIS    [Toc]    [Back]

     #include <signal.h>

     C:
       void (*signal (int sig, void (*func)()))();
     C++:
       void (*signal (int sig, void (*func)(int)))(int);

     #if _XOPEN_SOURCE
       void (*signal (int sig, void (*func)(int)))(int);
     #endif

DESCRIPTION    [Toc]    [Back]

     signal allows the calling process to choose one of	three ways in which it
     is	possible to handle the receipt of a specific signal.  sig specifies
     the signal	and func specifies the choice.

     For a list	of valid signals and a general description of the signal
     mechanism please see signal(5).

     [EINVAL]  signal will fail	if sig is an illegal signal number, including
	       SIGKILL and SIGSTOP.

     [EINVAL]  signal will fail	if an illegal operation	is requested (for
	       example,	ignoring SIGCONT, which	is ignored by default).

SEE ALSO    [Toc]    [Back]

      
      
     kill(1), intro(2),	blockproc(2), kill(2), pause(2), ptrace(2),
     sigaction(2), sigset(2), wait(2), setjmp(3C), sigvec(3B),
     pthread_kill(3P), signal(5)

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, signal	returns	the previous value of func for
     the specified signal sig.	Otherwise, a value of SIG_ERR is returned and
     errno is set to indicate the error.  SIG_ERR is defined in	the header
     file <sys/signal.h>.

WARNINGS    [Toc]    [Back]

     Signals raised by any instruction in the instruction stream, including
     SIGFPE, SIGILL, SIGEMT, SIGBUS, and SIGSEGV, will cause infinite loops if
     their handler returns, or the action is set to SIG_IGN. This is because
     the exception PC at the time of the signal	points to the instruction that
     raised the	exception or signal, and resuming the process will re-execute
     that same instruction.

     The POSIX signal routines (sigaction(2), sigpending(2), sigprocmask(2),
     sigsuspend(2), sigsetjmp(3)), and the 4.3BSD signal routines (sigvec(3B),
     signal(3B), sigblock(3B), sigpause(3B), sigsetmask(3B)) must NEVER	be
     used with signal(2) or sigset(2).



									Page 1






SIGNAL(2)							     SIGNAL(2)



     Before entering the signal-catching function, the value of	func for the
     caught signal will	be set to SIG_DFL unless the signal is SIGILL,
     SIGTRAP, or SIGPWR.  This means that before exiting the handler, a	signal
     call is necessary to again	set the	disposition to catch the signal.

     Note that handlers	installed by signal execute with no signals blocked,
     not even the one that invoked the handler.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
sigaction FreeBSD software signal facilities
sigvec NetBSD software signal facilities
sigvec Linux BSD software signal facilities
sigaction OpenBSD software signal facilities
sigvector HP-UX software signal facilities
sigvec OpenBSD software signal facilities
sigaction NetBSD software signal facilities
sigvec FreeBSD software signal facilities
sigvec IRIX 4.3BSD software signal facilities
signal FreeBSD simplified software signal facilities
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service