DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

killpg(S)


killpg -- send signal to a process group

Synopsis

   #include <signal.h>
   
   int killpg(pid_t pgrp, int sig);

Description

killpg sends the signal sig to the process group pgrp. See signal(M) 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 calling process has appropriate privilege.

A single exception is the signal SIGCONT, which may always be sent to any descendant of the current process.

Return values

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

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


EINVAL
The value of the sig argument is an invalid or unsupported signal number.

EPERM
The process does not have permission to send the signal to any receiving process. That is, the sending process does not have appropriate privilege, 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 or process group can be found corresponding to that specified by pid.

References

getpid(S), kill(S), raise(S), setpgrp(S), sigaction(S), signal(M)

Standards conformance

This routine conforms to X/Open System Interfaces and Headers, Issue 4, Version 2.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005