DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

killpg(S-osr5)


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-osr5), getpid(S-osr5), kill(S-osr5), siginfo(FP), raise(S-osr5)

Standards conformance

killpg is conformant with:

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


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005