unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



sigsend(2)							   sigsend(2)



NAME

  sigsend, sigsendset -	Send a signal to one or	more processes

SYNOPSIS

  #include <&lt;sys/types.h>&gt;

  #include <&lt;sys/signal.h>&gt;

  #include <&lt;sys/procset.h>&gt;

  int sigsend(
	  idtype_t idtype,
	  id_t id,
	  int sig );

  int sigsendset(
	  const	procset_t *psetp,
	  int sig );

LIBRARY

  Standard C Library (libc)

PARAMETERS

  id  Specifies	a process or group of processes	to which a signal is sent.

  idtype
      Specifies	how the	id parameter is	to be interpreted.

  sig Specifies	the signal to be sent.

  psetp
      Points to	a procset_t structure that defines a set of processes.

DESCRIPTION

  The sigsend function sends a signal to a group of processes specified	by
  the id and idtype parameters.	The sig	parameter specifies the	signal to be
  sent.	 It contains either a valid signal or a	zero (0), which	indicates
  that no signal is to be sent,	though the usual error checking	will still be
  performed.

  To send the signal, the real or effective user IDs of	the sending process
  must match those of the receiving process, unless the	sending	process	has
  appropriate privileges, or the sig parameter is SIGCONT and the receiving
  process is in	the same session as the	sender.

  The id and the idtype	parameters together select the target process(es)
  according to the following rules:

    +  If the idtype parameter is set to P_PID,	the target process is the
       process whose process ID	is equal to (pid_t)id.

    +  If the idtype parameter is set to P_GID,	the target processes are
       those whose effective group ID is equal to (gid_t)id.

    +  If the idtype parameter is set to P_UID,	the target processes are
       those whose effective user ID is	equal to (uid_t)id.

    +  If the idtype parameter is set to P_PGID, the target processes are
       those whose process group ID is equal to	(pid_t)id.

    +  If the idtype parameter is set to P_SID,	the target processes are
       those whose session ID is equal to (pid_t)id.

    +  If the idtype parameter is set to P_PPID, sig is	sent to	all children
       of id.

    +  If the idtype parameter is set to P_CID,	sig is sent to any process
       whose scheduling	class ID is equal to id.

    +  If the idtype parameter is set to P_ALL,	all eligible processes are
       targets of this operation, and id is ignored.

    +  If the id parameter is set to P_MYID, the value used for	id is taken
       from the	calling	process.

  The process having a process ID of (pid_t)0 is never a target, and the pro-
  cess with a process ID of (pid_t)1 is	targeted only if the idtype parameter
  is equal to P_PID.  In addition, certain system processes may	not be sig-
  nalled.

  The sigsendset function allows sending to a set of processes that is con-
  structed by a	boolean	logic operation	performed on two sets of potential
  target processes defined as described	above for sigsend.

  For the sigsendset function, the psetp parameter points the procset_t
  structure.  This structure is	described in detail on the procset(4) refer-
  ence page.

RETURN VALUES

  Upon successful completion, both functions return the	value zero (0).	Oth-
  erwise, a value of -1	is returned, and errno is set to indicate the error.

ERRORS

  If any of the	following conditions occur, the	sigsend	or sigsendset func-
  tion sets errno to the corresponding value:

  [EINVAL]
      The value	specified by the idtype	parameter is not valid.

  [EINVAL]
      The value	specified by the sig parameter is not zero and is not a	valid
      signal.

  [EINVAL]
      The sig parameter	is set to SIGKILL, the idtype parameter	is set to
      P_PID, and the id	parameter is set to the	process	ID of a	special	sys-
      tem process.

  [EINVAL]
      The id parameter specifies the process ID	of a special system process.

  [EINVAL]
      Either the id parameter of the sigsend function, or the p_lid or p_rid
      members of the structure pointed at by the psetp parameter for the sig-
      sendset function are out-of-range.

  [EPERM]
      The calling process lacks	sufficient privilege, the real or effective
      user IDs do not match, and this invocation is not	sending	SIGCONT	to a
      process in the same session.

  [ESRCH]
      The processes specified by the id	and idtype, or the psetp parameters
      do not exist.

SEE ALSO

  Functions:  kill(2), setpgid(2), setsid(2), sigaction(2)

  Routines:  sigset(3)

  Files:  procset(4), signal(4)