source: trunk/minix/man/man2/kill.2@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 2.5 KB
RevLine 
[9]1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)kill.2 6.5 (Berkeley) 5/14/86
6.\"
7.TH KILL 2 "May 14, 1986"
8.UC 4
9.SH NAME
10kill \- send signal to a process
11.SH SYNOPSIS
12.nf
13.ft B
14#include <sys/types.h>
15#include <signal.h>
16
17int kill(pid_t \fIpid\fP, int \fIsig\fP)
18.ft R
19.fi
20.SH DESCRIPTION
21.B Kill
22sends the signal \fIsig\fP
23to a process, specified by the process number
24.IR pid .
25.I Sig
26may be one of the signals specified in
27.BR sigaction (2),
28or it may be 0, in which case
29error checking is performed but no
30signal is actually sent.
31This can be used to check the validity of
32.IR pid .
33.PP
34The sending and receiving processes must
35have the same effective user ID, otherwise
36this call is restricted to the super-user.
37.ig
38A single exception is the signal SIGCONT, which may always be sent
39to any descendant of the current process.
40..
41.PP
42If the process number is 0,
43the signal is sent to all processes in the
44sender's process group.
45.PP
46If the process number is \-1
47and the user is the super-user,
48the signal is broadcast universally
49except to
50.B init
51and the process sending the signal.
52If the process number is \-1
53and the user is not the super-user,
54the signal is broadcast universally to
55all processes with the same uid as the user
56except the process sending the signal.
57No error is returned if any process could be signaled.
58.PP
59If the process number is negative but not \-1,
60the signal is sent to all processes whose process group ID
61is equal to the absolute value of the process number.
62.PP
63Processes may send signals to themselves.
64.SH "RETURN VALUE
65Upon successful completion, a value of 0 is returned.
66Otherwise, a value of \-1 is returned and
67.B errno
68is set to indicate the error.
69.SH "ERRORS
70.B Kill
71will fail and no signal will be sent if any of the following
72occur:
73.TP 15
74[EINVAL]
75\fISig\fP is not a valid signal number.
76.TP 15
77[ESRCH]
78No process can be found corresponding to that specified by \fIpid\fP.
79.TP 15
80[ESRCH]
81The process id was given as 0
82but the sending process does not have a process group.
83.TP 15
84[EPERM]
85The sending process is not the super-user and its effective
86user id does not match the effective user-id of the receiving process.
87When signaling a process group, this error was returned if any members
88of the group could not be signaled.
89.SH "SEE ALSO"
90.BR getpid (2),
91.BR getpgrp (2),
92.BR sigaction (2),
93.BR raise (3).
Note: See TracBrowser for help on using the repository browser.