8000 bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) · python/cpython@7c72383 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c72383

Browse files
authored
bpo-40094: Enhance os.WIFEXITED documentation (GH-19244)
1 parent 17b4733 commit 7c72383

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

Doc/library/os.rst

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4167,45 +4167,55 @@ used to determine the disposition of a process.
41674167
Return ``True`` if a core dump was generated for the process, otherwise
41684168
return ``False``.
41694169

4170+
This function should be employed only if :func:`WIFSIGNALED` is true.
4171+
41704172
.. availability:: Unix.
41714173

41724174

41734175
.. function:: WIFCONTINUED(status)
41744176

4175-
Return ``True`` if the process has been continued from a job control stop,
4176-
otherwise return ``False``.
4177+
Return ``True`` if a stopped child has been resumed by delivery of
4178+
:data:`~signal.SIGCONT` (if the process has been continued from a job
4179+
control stop), otherwise return ``False``.
4180+
4181+
See :data:`WCONTINUED` option.
41774182

41784183
.. availability:: Unix.
41794184

41804185

41814186
.. function:: WIFSTOPPED(status)
41824187

4183-
Return ``True`` if the process has been stopped, otherwise return
4184-
``False``.
4188+
Return ``True`` if the process was stopped by delivery of a signal,
4189+
otherwise return ``False``.
41854190

4186-
.. availability:: Unix.
4191+
:func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was
4192+
done using :data:`WUNTRACED` option or when the process is being traced (see
4193+
:manpage:`ptrace(2)`).
41874194

4195+
.. availability:: Unix.
41884196

41894197
.. function:: WIFSIGNALED(status)
41904198

4191-
Return ``True`` if the process exited due to a signal, otherwise return
4199+
Return ``True`` if the process was terminated by a signal, otherwise return
41924200
``False``.
41934201

41944202
.. availability:: Unix.
41954203

41964204

41974205
.. function:: WIFEXITED(status)
41984206

4199-
Return ``True`` if the process exited using the :manpage:`exit(2)` system call,
4207+
Return ``True`` if the process exited terminated normally, that is,
4208+
by calling ``exit()`` or ``_exit()``, or by returning from ``main()``;
42004209
otherwise return ``False``.
42014210

42024211
.. availability:: Unix.
42034212

42044213

42054214
.. function:: WEXITSTATUS(status)
42064215

4207-
If ``WIFEXITED(status)`` is true, return the integer parameter to the
4208-
:manpage:`exit(2)` system call. Otherwise, the return value is meaningless.
4216+
Return the process exit status.
4217+
4218+
This function should be employed only if :func:`WIFEXITED` is true.
42094219

42104220
.. availability:: Unix.
42114221

@@ -4214,12 +4224,16 @@ used to determine the disposition of a process.
42144224

42154225
Return the signal which caused the process to stop.
42164226

4227+
This function should be employed only if :func:`WIFSTOPPED` is true.
4228+
42174229
.. availability:: Unix.
42184230

42194231

42204232
.. function:: WTERMSIG(status)
42214233

4222-
Return the signal which caused the process to exit.
4234+
Return the number of the signal that caused the process to terminate.
4235+
4236+
This function should be employed only if :func:`WIFSIGNALED` is true.
42234237

42244238
.. availability:: Unix.
42254239

0 commit comments

Comments
 (0)
0