Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

killpg(2) [freebsd man page]

KILLPG(2)						      BSD System Calls Manual							 KILLPG(2)

NAME
killpg -- send signal to a process group LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <signal.h> int killpg(pid_t pgrp, int sig); DESCRIPTION
The killpg() function sends the signal sig to the process group pgrp. See sigaction(2) for a list of signals. If pgrp is 0, killpg() sends the signal to the sending process's process group. The sending process must be able to kill() at least one process in the receiving process group. RETURN VALUES
The killpg() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable 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. [ESRCH] No process can be found in the process group specified by pgrp. [EPERM] kill() returns EPERM for all processes in the process group. SEE ALSO
getpgrp(2), kill(2), sigaction(2) HISTORY
The killpg() function appeared in 4.0BSD. BSD
March 15, 2012 BSD

Check Out this Related Man Page

KILLPG(2)						     Linux Programmer's Manual							 KILLPG(2)

NAME
killpg - send signal to a process group SYNOPSIS
#include <signal.h> int killpg(int pgrp, int sig); DESCRIPTION
Killpg sends the signal sig to the process group pgrp. See sigaction(2) for a list of signals. If pgrp is 0, killpg sends the signal to the sending process's process group. The sending process and members of the process group must have the same effective user ID, or the sender must be the super-user. As a sin- gle special case the continue signal SIGCONT may be sent to any process that is a descendant of the current process. RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
EINVAL Sig is not a valid signal number. ESRCH No process can be found in the process group specified by pgrp. ESRCH The process group was given as 0 but the sending process does not have a process group. EPERM The sending process is not the super-user and one or more of the target processes has an effective user ID different from that of the sending process. CONFORMING TO
SVr4, 4.4BSD (The killpg function call first appeared in 4.0BSD). SEE ALSO
kill(2), getpgrp(2), signal(2) BSD Man Page 1993-07-23 KILLPG(2)
Man Page

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finding process id

is there a way to find the process id of a process because i have same process invoked several times. when i need to kill them, i get confused with the id. Thanks, sskb :( (8 Replies)
Discussion started by: sskb
8 Replies

2. Programming

allowing members of a group to kill a process

I've written a python program where I want to allow members of a specific group the ability to kill it, and I'm not sure how to do it. I've been looking at the setuid() and setgid() and similar functions in the os module, but haven't been able to get them to work. I can't seem to change the uid or... (1 Reply)
Discussion started by: vastcharade
1 Replies

3. HP-UX

abnormal process HPUX

i am using HP-UX and i have this process called HPUX childwrapper taking about 99% cpu.i want to know what the process does? and if i should kill it (4 Replies)
Discussion started by: tomjones
4 Replies

4. Shell Programming and Scripting

kill a process if grep match is found

Hi, I need something unusual, I guess. I need to start a process, and if that process displays a specific error message, I need to kill that process and restart it. Something like: startprocess | grep -i "This is the specific error message" && kill $pidof(startprocess) Explanation, I need... (4 Replies)
Discussion started by: burek
4 Replies

5. Shell Programming and Scripting

Cancel process running for more than 5 days

Hello Group, We want to create a script in order to filter process in the system with more than five days (STIME) and then kill them under Solaris 10. How can we filter these kind of process ? ps -efa Thanks in advance for your help (4 Replies)
Discussion started by: csierra
4 Replies

6. Red Hat

Orphaned process "D" state

Hello, How can we clear the D state (orphaned) process? I have tried to kill it with kill -9 but not work. The server is critical, so is there anyway to clear the D process without rebooting the server? (9 Replies)
Discussion started by: Phat
9 Replies