develooper Front page | perl.perl5.porters | Postings from December 2015

[perl #127080] perldoc for waitpid missing description for argumentvalue -1

Thread Previous
From:
Bharat Pahalwani
Date:
December 31, 2015 13:37
Subject:
[perl #127080] perldoc for waitpid missing description for argumentvalue -1
Message ID:
rt-4.0.18-6551-1451459090-395.127080-75-0@perl.org
# New Ticket Created by  Bharat Pahalwani 
# Please include the string:  [perl #127080]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=127080 >


Perl5's documentation for function waitpid (http://perldoc.perl.org/functions/waitpid.html) lacks proper description:

    $kid = waitpid(-1, WNOHANG);

It is not described : 
   1. what's the use of -1
   2. and return value of waitpid(-1, WNOHANG) for different phases of child process

Refer: http://stackoverflow.com/questions/34494242/what-does-1-mean-in-waitpid-1-wnohang

It is described in more detail in c manuals http://linux.die.net/man/2/waitpid
   1) -1 will cause the parent to wait for any child process.
   2) waitpid(): on success, returns the process ID of the child whose state has changed; if WNOHANG was specified and one or more child(ren) specified by pid exist, but have not yet changed state, then 0 is returned. On error, -1 is returned.



-----
Bharat Pahalwani
(If you are able to feel pain of others then u r religious else you are just
following the useless rules which are of no use )


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About