DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

killpg(S)


killpg -- send signal to a process group

Syntax

cc . . . -lc
#include <signal.h>

int killpg(pid_t pgrp, int sig);

Description

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

If pgrp is greater than 1, the following calls are equivalent:

   killpg(pgrp, sig);
   

kill(-pgrp, sig);

Return values

Upon successful completion, a value of 0 is returned. Otherwise, it returns -1 and errno is set to indicate the error.

Diagnostics

killpg will fail and no signal will be sent if any of the following occur:

[EINVAL]
sig is an invalid or unsupported signal number.

[EPERM]
The effective user ID of the sending process is not that of a 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 process group was found to correspond with the value of pgrp.

See also

getpgid(S), getpid(S), kill(S), siginfo(FP), raise(S)

Standards conformance

killpg is conformant with:

X/Open Portability Guide Issue 4, Version 2 (Spec-1170).


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003