NAME
	  sigaction, signal - Specifies	the action to take upon
	  delivery of a	signal

     SYNOPSIS
	  #include <signal.h>
	  int sigaction	(
	       int signal,
	       const struct sigaction *action,
	       struct sigaction	*o_action );
	  void (*signal(
	       int signal,
	       void (*function)( int ) ) ) ( int );


     PARAMETERS
	  signal    Defines the	signal.

	  action    Points to a	sigaction structure that describes the
		    action to be taken upon receipt of the signal
		    parameter.

	  o_action  Points to a	sigaction structure in which the sig-
		    nal	action data in effect at the time the sigac-
		    tion() function is returned.

	  function  Specifies the action associated with a signal.


     DESCRIPTION
	  OSF/1	defines	a set of signals that may be delivered to a
	  process to inform the	process	about various hardware or
	  software conditions.	A signal that is posted	to a process
	  must be disposed of in one way or another.  A	process	may
	  elect	to ignore the delivery of some signals,	while allowing
	  the system to	perform	default	actions	upon the delivery of
	  other	signals.  The system also allows processes to install
	  process-specific signal handler functions.  When a process
	  receives a signal for	which it has installed its own signal
	  handler, the signal handler function executes	in response
	  the signal's delivery.

	  The following	table lists the	signals	defined	for OSF/1 and
	  the corresponding default actions for	each signal as indi-
	  cated	in the signals.h header	file.

	  NAME	      DEFAULT ACTION	  DESCRIPTION

	  SIGHUP      terminate	process	  hangup
	  SIGINT      terminate	process	  interrupt
	  SIGQUIT     terminate	process	  quit
	  SIGILL      core dump		  illegal instruction
	  SIGTRAP     core dump		  trace	trap
	  SIGABRT     core dump		  abort	process
	  SIGEMT      terminate	process	  EMT instruction
	  SIGFPE      core dump		  floating point exception
	  SIGKILL     terminate	process	  kill
	  SIGBUS      core dump		  bus error
	  SIGSEGV     core dump		  segmentation violation
	  SIGSYS      core dump		  bad argument to system call
	  SIGPIPE     terminate	process	  write	on a pipe with no one to read it
	  SIGALRM     terminate	process	  alarm	clock
	  SIGTERM     terminate	process	  software termination signal from kill
	  SIGUSRG     discard signal	  urgent condition on I/O channel
	  SIGSTOP     stop process	  stop
	  SIGSTP      stop process	  interactive stop
	  SIGCONT     terminate	process	  continue
	  SIGCHLD     discard signal	  child	has stopped or exited
	  SIGTTIN     stop process	  background read attempted from control termina
	  SIGTTOU     stop process	  background write attempted to	control	terminal
	  SIGIO	      discard signal	  I/O possible,	or completed
	  SIGXCPU     terminate	process	  cpu time limit exceeded (see setrlimit())
	  SIGXFSZ     terminate	process	  file size limit exceeded (see	setrlimit())
	  SIGVTALRM   terminate	process	  virtual time alarm (see setitimer)
	  SIGPROF     terminate	process	  profiling time alarm (see setitimer)
	  SIGWINCH    discard signal	  window size changed
	  SIGINFO     terminate	process	  information request
	  SIGUSR1     terminate	process	  user defined signal 1
	  SIGUSR2     terminate	process	  user defined signal 2

	  Note that the	SIGKILL, SIGSTOP, and SIGCONT signals cannot
	  be caught or ignored.	 The signals.h file also defines a set
	  of signal names for the purposes of compatibility.  The fol-
	  lowing lists these names  and	their corresponding "true"
	  signals:

	  COMPATIBLITY	 DESCRIPTION	     CORRESPONDING
	  NAME				     SIGNAL

	  SIGIOINT	 printer error	     SIGURG
	  SIGAIO	 base lan i/o	     SIGIO
	  SIGPTY	 pty i/o	     SIGIO
	  SIGPOLL	 STREAMS i/o	     SIGIO
	  SIGIOT	 abort (terminate)   SIGABRT

	  The sigaction() function allows the calling process to exam-
	  ine and/or change the	action to be taken when	a specific
	  signal is delivered to the process issuing this function.

	  The signal parameter specifies the signal. If	the action
	  parameter is not null, it points to a	sigaction structure
	  that describes the action to be taken	on receipt of the sig-
	  nal parameter	signal.	If the o_action	parameter is not null,
	  it points to a sigaction structure in	which the signal
	  action data in effect	at the time of the sigaction() call is
	  returned. If the action parameter is null, signal handling
	  is unchanged;	thus, the call can be used to inquire about
	  the current handling of a given signal.

	  The sigaction	structure has the following members:
	       void			       (*sa_handler)();
	       sigset_t	   sa_mask;
	       int	   sa_flags;

	  The sa_handler field can have	the SIG_DFL or SIG_IGN value,
	  or can point to a function. A	SIG_DFL	value requests default
	  action to be taken when the signal is	delivered.  A value of
	  SIG_IGN requests that	the signal have	no effect on the
	  receiving process. A pointer to a function requests that the
	  signal be caught; that is, the signal	should cause the func-
	  tion to be called. These actions are more fully described in
	  the signal.h file.

	  The sa_mask field can	be used	to specify that	individual
	  signals, in addition to those	in the process signal mask, be
	  blocked from being delivered while the signal	handler	func-
	  tion specified in sa_handler is executing. The sa_flags
	  field	can have the SA_ONSTACK, SA_RESTART, or	SA_NOCLDSTOP
	  bits set to specify further control over the actions taken
	  on delivery of a signal.

	  If the SA_ONSTACK bit	is set,	the system runs	the signal-
	  catching function on the signal stack	specified by the
	  sigaltstack()	function. If this bit is not set, the function
	  runs on the stack of the process to which the	signal is
	  delivered.

	  If the SA_RESETHAND bit is set, the signal is	reset to
	  SIG_DFL on entry to the signal handler. Note that the	system
	  silently enforces the	following restriction: SIGKILL,
	  SIGTRAP, and SIGPWR cannot be	automatically reset when
	  delivered.

	  If the SA_SIGINFO bit	is cleared and the signal is caught,
	  only the signal parameter is passed to the signal catching
	  function. If the SA_SIGINFO bit is set and the signal	is
	  caught, two additional arguments are passed to the signal
	  catching function:


	    o  The first additional argument points to an object of
	       type siginfo_t that contains more detailed information
	       about how the signal is generated, such as the follow-
	       ing:


		 -- The	reason for a potentially hardware generated
		    signal (for	example, a SIGKILL is caused by	a
		    coprocessor	error).

		 -- Reasons for	SIGCHLD	(for example, stopped child
		    has	continued).

		 -- Reasons for	SIGPOLL	(for example, high priority
		    input available).

		 -- Signal sent	via the	kill() interface.


	    o  The second additional argument points to	an argument of
	       type ucontext_t that describes the context of a thread
	       of control within the executing process.	It contains
	       the context that	will be	resumed	when the context
	       returns,	the signal mask	of the context,	the stack used
	       by the context, as well as the machine registers	and
	       any implementation specific context data.


	  If the SA_NOCLDWAIT bit is set and the signal	parameter
	  equals SIGCHLD, no zombie processes are created when chil-
	  dren of the calling process exit. If at a later time,	the
	  calling process issues a wait() function, it will block
	  until	all of the child processes of the calling process end,
	  and then return a -1 value with errno	set to [ECHILD].

	  If the signal	parameter is SIGCHLD and a child process of
	  the calling process stops, a SIGCHLD signal will be sent to
	  the calling process if and only if SA_NOCLDSTOP is not set
	  for SIGCHLD.

	  If a signal for which	a signal-catching function exists is
	  sent to a process while that process is executing certain
	  system calls,	the call can be	restarted if the SA_RESTART
	  bit is set.  The affected system calls are the read()	and
	  write() functions on a slow device (such as a	terminal, but
	  not a	regular	file) and the wait() function.	If SA_RESTART
	  is not set, and such a system	call is	interrupted by a sig-
	  nal which is caught, then the	system call returns -1 and
	  sets errno to	[EINTR].

	  The signal parameter can be any one of the signal values
	  defined in the signal.h header file, except SIGKILL.

	  The signal() function	is provided for	compatibility with
	  older	versions of UNIX operating systems.  It	sets the
	  action associated with a signal. The function	parameter can
	  have the same	values that are	described for the sa_handler
	  field	in the sigaction structure of the sigaction()
	  function.
	   However, no signal handler mask or flags can	be specified.

	  The effect of	calling	the signal() function differs in some
	  details depending on whether the calling program is linked
	  with either of the special libraries libbsd or libsys5.  If
	  neither library is used, the behavior	is the same as that of
	  the sigaction() function with	all flags set to 0 (zero). If
	  the libbsd library is	used (through compilation with the -
	  lbsd switch),	the behavior is	the same as that of the	sigac-
	  tion() function with the SA_RESTART flag set.	If the libsys5
	  library is used (though compilation with the -lsys5 switch),
	  then the specified signal is not blocked from	delivery when
	  the handler is entered, and the disposition of the signal
	  reverts to SIG_DFL when the signal is	delivered. See the
	  OSF/1	Applications Programmer's Guide	for details on these
	  switches.

     NOTES
	  In a multi-threaded environment, the sigaction() function
	  should only be used for the synchronous signals.

	  The sigvec() and signal() functions are provided for compa-
	  tibility to old UNIX systems;	their function is a subset of
	  that available with the sigaction() function.


	  AES Support Level:
			 Full use


     RETURN VALUES
	  Upon successful completion of	the sigaction()	function, a
	  value	of 0 (zero) is returned. If the	sigaction() function
	  fails, a value of -1 is returned and errno is	set to indi-
	  cate the error.

	  Upon successful completion of	a signal() function, the value
	  of the previous signal action	is returned.  If the call
	  fails, a value of -1 is returned and errno is	set to indi-
	  cate the error as in the sigaction() call.

     ERRORS
	  If the sigaction() function fails, no	new signal handler is
	  installed and	errno may be set to one	of the following
	  values:


	  [EFAULT]  The	action or o_action parameter points to a loca-
		    tion outside of the	allocated address space	of the
		    process.

	  [EINVAL]  The	signal parameter is not	a valid	signal number.

	  [EINVAL]  An attempt was made	to ignore or supply a handler
		    for	the SIGKILL, SIGSTOP, and SIGCONT signals.


     RELATED INFORMATION
	  Functions: acct(2), exit(2), kill(2),	pause(3), ptrace(2),
	  setjmp(3), sigaltstack(2), sigblock(2), sigpause(3), sig-
	  procmask(2), sigstack(2), sigsuspend(2), sigvec(2),
	  umask(2), wait(2)

	  Commands: kill(1)

	  Files: signal(4)





































Acknowledgement and Disclaimer