This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davin
Recipients davin, docs@python, eradman
Date 2015-04-27.17:02:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430154163.16.0.527436485875.issue21791@psf.upfronthosting.co.za>
In-reply-to
Content
The man pages for waitpid on OpenBSD 5.x do not suggest any meaningful value will be returned in status when WNOHANG is requested and no child processes have anything to report.

The following session attempts to exercise os.waitpid using Python 2.7.9 on an OpenBSD 5.3 i386 system:
>>> import os
>>> os.spawnl(os.P_NOWAIT, '/bin/sleep', 'sleep', '10')
19491
>>> os.waitpid(-1, os.WNOHANG)
(0, 0)
>>> os.waitpid(-1, os.WNOHANG)   # wait a few seconds, try again
(0, 0)
>>> os.waitpid(-1, os.WNOHANG)   # waited long enough for sleep to exit
(19491, 0)
>>> os.waitpid(-1, os.WNOHANG)   # at this point, no children remain
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 10] No child processes


Can you provide any further information, like:
* OpenBSD docs that explain that we should expect non-zero values for status coming from waitpid?
* Example Python code to provoke the behavior originally described?
* Other suggestion of why OpenBSD's waitpid, which itself depends upon wait4, when called (the way Python calls it) with an already initialized status=0 and WNOHANG should return a modified value for status when the child had nothing to report?
History
Date User Action Args
2015-04-27 17:02:43davinsetrecipients: + davin, docs@python, eradman
2015-04-27 17:02:43davinsetmessageid: <1430154163.16.0.527436485875.issue21791@psf.upfronthosting.co.za>
2015-04-27 17:02:43davinlinkissue21791 messages
2015-04-27 17:02:42davincreate