Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
kill(2)			      System Calls Manual		       kill(2)

NAME
       kill(), raise() - send a	signal to a process or a group of processes

SYNOPSIS
DESCRIPTION
       The system call sends a signal to a process or a	group of processes, as
       specified by pid.  The signal to	be sent	is specified by	sig and	is ei-
       ther one	from the list given in signal(2), or

       The system call sends a signal to the executing program.	 The signal to
       be sent is specified by sig and is either one from the  list  given  in
       signal(2), or

       If  sig is (the null signal), error checking is performed but no	signal
       is actually sent.  This can be used to check the	validity of pid.

       The real	or effective user ID of	the sending  process  must  match  the
       real  or	 saved	user  ID of the	receiving process unless the effective
       user ID of the sending process is a user	 who  has  appropriate	privi-
       leges.

       As  a  single  special  case,  the  continue  signal can	be sent	to any
       process that is a member	of the same session as the sending process.

       The value is defined in the file	and is guaranteed not to be the	ID  of
       any  process  in	the system or the negation of the ID of	any process in
       the system.

       If pid is greater than zero and not equal to sig	is sent	to the process
       whose process ID	is equal to pid.  pid can equal	unless sig is or

       If  pid	is  sig	is sent	to all processes excluding special system pro-
       cesses whose process group ID is	equal to the process group ID  of  the
       sender.

       If pid is and the effective user	ID of the sender is not	a user who has
       appropriate privileges.	sig is sent to all processes excluding special
       system  processes  whose	 real or saved user ID is equal	to the real or
       effective user ID of the	sender.

       If pid is and the effective user	ID of the sender is a user who has ap-
       propriate  privileges,  sig  is sent to all processes excluding special
       system processes.

       If pid is behaves much as when pid is equal to except that sig  is  not
       sent to the calling process.

       If  pid	is negative but	not or sig is sent to all processes (excluding
       special system processes) whose process group ID	is equal to the	 abso-
       lute  value  of	pid, and whose real and/or effective user ID meets the
       constraints described above for matching	user IDs.

RETURN VALUE
       Upon successful completion, a value of is returned.  Otherwise, a value
       of is returned and is set to indicate the error.

ERRORS
       If fails, no signal is sent.  is	set to one of the following values.

	      [EINVAL]	     sig is neither a valid signal number nor zero.

	      [EINVAL]	     sig is or and pid is (process 1).

	      [EPERM]	     The  user ID of the sending process is not	a user
			     who has appropriate privileges and	 its  real  or
			     effective	user  ID  does	not  match the real or
			     saved user	ID of the receiving process.

	      [EPERM]	     The sending and receiving processes  are  not  in
			     the  same	session	and the	real or	effective user
			     ID	does not match the real	or saved  user	ID  of
			     the receiving process.

	      [ESRCH]	     No	 process  or process group can be found	corre-
			     sponding to that specified	by pid.

       If fails, no signal is sent.  is	set to one of the following values.

	      [EINVAL]	     sig is neither a valid signal number nor zero.

APPLICATION USAGE
   Threads Considerations
       can be used to post signals to another process but cannot  be  used  to
       post  signals to	a specific thread in another process.  For information
       on posting signals to specific threads within  the  same	 process,  see
       pthread_kill(3T).

   LWP (Lightweight Processes) Considerations
       Signals cannot be posted	to specific LWPs in another process.

AUTHOR
       was developed by	HP, AT&T, and the University of	California, Berkeley.

SEE ALSO
       kill(1),	     getpid(2),	    setsid(2),	   signal(2),	  sigqueue(2),
       pthread_kill(3T).

STANDARDS CONFORMANCE
								       kill(2)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | APPLICATION USAGE | AUTHOR | SEE ALSO | STANDARDS CONFORMANCE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=kill&sektion=2&manpath=HP-UX+11.22>

home | help