lkml.org 
[lkml]   [1999]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Bug in kill?
On Thu, Mar 18, 1999 at 04:03:36PM -0800, rich-paul@rich-paul.net wrote:
> There seems to be a bug in kill ... or it's a documentation bug, I'm not
> sure which.
>
> As I undertstand it,
>
> kill(pid,0) should return 0 only if process #pid exists ... however, it
> seems to be returning 0 no matter what ... so one can't use it to test
> the existance of a process. :(
>
> This would be useful when starting a daemon, among other things ... read
> the .pid file, and if kill(pid,0) returns an ESRCH, then just delete the
> file, since the process is no longer running.
>
> Is my reading wrong?

no. your code might be. It certainly does return -1 and sets errno = ESRCH
here. (kernel 2.2.3, glibc2.1).

-- arvind

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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