explain_kill_or_die(3) Library Functions Manual explain_kill_or_die(3)NAME
explain_kill_or_die - send signal to a process and report errors
SYNOPSIS
#include <libexplain/kill.h>
void explain_kill_or_die(pid_t pid, int sig);
int explain_kill_on_error(pid_t pid, int sig);
DESCRIPTION
The explain_kill_or_die function is used to call the kill(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_kill(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_kill_on_error function is used to call the kill(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_kill(3) function, but still returns to the caller.
pid The pid, exactly as to be passed to the kill(2) system call.
sig The sig, exactly as to be passed to the kill(2) system call.
RETURN VALUE
The explain_kill_or_die function only returns on success, see kill(2) for more information. On failure, prints an explanation and exits, it
does not return.
The explain_kill_on_error function always returns the value return by the wrapped kill(2) system call.
EXAMPLE
The explain_kill_or_die function is intended to be used in a fashion similar to the following example:
explain_kill_or_die(pid, sig);
SEE ALSO kill(2) send signal to a process
explain_kill(3)
explain kill(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_kill_or_die(3)
Check Out this Related Man Page
explain_getpgrp_or_die(3) Library Functions Manual explain_getpgrp_or_die(3)NAME
explain_getpgrp_or_die - get process group and report errors
SYNOPSIS
#include <libexplain/getpgrp.h>
pid_t explain_getpgrp_or_die(pid_t pid);
pid_t explain_getpgrp_on_error(pid_t pid);
DESCRIPTION
The explain_getpgrp_or_die function is used to call the getpgrp(2) system call. On failure an explanation will be printed to stderr,
obtained from the explain_getpgrp(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_getpgrp_on_error function is used to call the getpgrp(2) system call. On failure an explanation will be printed to stderr,
obtained from the explain_getpgrp(3) function, but still returns to the caller.
pid The pid, exactly as to be passed to the getpgrp(2) system call.
API Inconsistencies
Note: the getpgrp(2) function has two implementations. The POSIX.1 version has no arguments, while the BSD version has one argument. For
simplicity of implementation, the argument list seen here includes the pid argument.
The POSIX.1 getpgid() semanatics can be obtained by calling getpgrp(0) on BSD systems, and this is the API for libexplain, even on systems
that do not use the BSD API.
RETURN VALUE
The explain_getpgrp_or_die function only returns on success, see getpgrp(2) for more information. On failure, prints an explanation and
exits, it does not return.
The explain_getpgrp_on_error function always returns the value return by the wrapped getpgrp(2) system call.
EXAMPLE
The explain_getpgrp_or_die function is intended to be used in a fashion similar to the following example:
pid_t result = explain_getpgrp_or_die(pid);
SEE ALSO getpgrp(2)
get process group
explain_getpgrp(3)
explain getpgrp(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2011 Peter Miller
explain_getpgrp_or_die(3)
hi, i kill a process which is topas. then i do a fg of the process itself and got this Signal 15 received.finally, the display went as belows....
root@myhost:/]ksh: ^L^L^Lps: not found.
root@myhost:/] PID TTY TIME CMD
... (4 Replies)
I have a process to terminate, and when keying Control C/ kill -int , it takes 15 minutes to half an hour to terminate the process. I've tried using kill -2, or keying control c twice, however the process seem
to be killed abruptly, without writing into the log file.
So the only way in order to... (8 Replies)
Dear All:
I use sun OS system and write a code in c as folloing
purpose kill textedit program,but i get some error
please give me a great help Thanks.
#include <stdlib.h>
int main()
{
const char cTestPrag=" kill -9 `ps -ef | grep textedit | grep -v "grep"| awk '{print $2}'| xargs` ";
... (6 Replies)
i wanted to kill a process by entering the process name. How am i able to kill the process that allows user to enter the process name and kills it? (5 Replies)
Hi,
On my Linux machine, using Bash, I sometimes run into a situation where doing the following does not seem to work at all.
kermit@fastbox ~ $ ps -A | grep firefox-bin
5375 ? 00:06:57 firefox-bin <defunct>
5624 ? 00:00:00 firefox-bin
kermit@fastbox ~ $ kill 5624... (7 Replies)
hello everybody!
i would like to post a question. If i embed in my C code the command kill(9,pid) inside an if command. Is this command(kill) executed in any way. Both if the if is true and false. Does kill have greater priority than the if command.
thanx in advance! (5 Replies)
I could not able to kill two process which is running in the required port for me.Can any body help me to kill the exiting process.
- 27000908 - - - <exiting>
- 30998528 - - - <exiting> (8 Replies)
Can someone tell my why every time I try to use 7z it freezes my system? I can't move my mouse, I can't type, I can't kill my xsession. I then restart my system and everything returns to normal. When I try to use 7z my system again freezes. (11 Replies)
Hi,
I simply want to kill a running process using a script that read pid from a file and tries to kill it .Getting error as shown below code..
cat $HOME/BackupScript.ksh.run | head -1 | while read pid
do
ps -p $pid > /dev/null 2>&1
if ; then
kill -9 $pid
else
echo "no running $pid... (5 Replies)
hi guys
i had written a shell script Display Information of all the File Systems
i want to find the pid and kill the process after few minutes.how can i obtain the pid and kill it???
sample.sh
df -a >> /tmp/size.log
and my cron to execute every minute every hour every day
* *... (5 Replies)
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)