lkml.org 
[lkml]   [1996]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Kill system call
Date
Nick Randell:
> I have a process, which forks off a child. The child process has a
> different EUID to the parent. The child sends the parent a signal to
> check that it is still alive, but the kill system call returns EPERM
> whereas on all the other unix systems the software is running on the
> call returns 0.
>
> I have patched the applications source code to check for EPERM on Linux
> but the reply I got mentioned that the Linux kernel handling is
> incorrect.

It may be better to check for ESRCH - if you get this error, you know
this process doesn't exist. This should work everywhere:

if (kill(pid, 0) == -1 && errno == ESRCH) {
/* process doesn't exist ... */
} else {
/* process exists ... */
}

Marek


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.057 / U:1.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site