xref: /illumos-gate/usr/src/man/man3c/killpg.3c (revision 14d44f2248cc2a54490db7f7caa4da5968f90837)
te
Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
KILLPG 3C "Jul 24, 2002"
NAME
killpg - send signal to a process group
SYNOPSIS

#include <signal.h>

int killpg(pid_t pgrp, int sig);
DESCRIPTION

The killpg() function sends the signal sig to the process group pgrp. See signal.h(3HEAD) for a list of signals.

The real or effective user ID of the sending process must match the real or saved set-user ID of the receiving process, unless the effective user ID of the sending process is the privileged user. A single exception is the signal SIGCONT, which may always be sent to any descendant of the current process.

RETURN VALUES

Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.

ERRORS

The killpg() function will fail and no signal will be sent if: EINVAL

The sig argument is not a valid signal number.

EPERM

The effective user ID of the sending process is not privileged user, and neither its real nor effective user ID matches the real or saved set-user ID of one or more of the target processes.

ESRCH

No processes were found in the specified process group.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Standard
MT-Level MT-Safe
SEE ALSO

kill(2), setpgrp(2), sigaction(2), signal.h(3HEAD), attributes(5), standards(5)