diff options
author | Jacek Sieka <arnetheduck@gmail.com> | 2017-04-28 03:39:32 +0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-04-27 21:39:32 +0200 |
commit | 0055729755a14020e670d2f564b2f20253ccd28f (patch) | |
tree | e755955368328e08a086552446d9f85d4d6e904e /lib/posix/posix_other.nim | |
parent | 40f79e6cddf63b05843284263dc36013da2ee1b7 (diff) | |
download | Nim-0055729755a14020e670d2f564b2f20253ccd28f.tar.gz |
WIFSIGNALED means process has exited too (with a bang!) (#5678)
Diffstat (limited to 'lib/posix/posix_other.nim')
-rw-r--r-- | lib/posix/posix_other.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/posix/posix_other.nim b/lib/posix/posix_other.nim index 6e1c33605..b1cc244b7 100644 --- a/lib/posix/posix_other.nim +++ b/lib/posix/posix_other.nim @@ -611,3 +611,18 @@ when hasSpawnH: # OR'ing of flags: const POSIX_SPAWN_USEVFORK* = cint(0) +# <sys/wait.h> +proc WEXITSTATUS*(s: cint): cint {.importc, header: "<sys/wait.h>".} + ## Exit code, iff WIFEXITED(s) +proc WTERMSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".} + ## Termination signal, iff WIFSIGNALED(s) +proc WSTOPSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".} + ## Stop signal, iff WIFSTOPPED(s) +proc WIFEXITED*(s: cint): bool {.importc, header: "<sys/wait.h>".} + ## True if child exited normally. +proc WIFSIGNALED*(s: cint): bool {.importc, header: "<sys/wait.h>".} + ## True if child exited due to uncaught signal. +proc WIFSTOPPED*(s: cint): bool {.importc, header: "<sys/wait.h>".} + ## True if child is currently stopped. +proc WIFCONTINUED*(s: cint): bool {.importc, header: "<sys/wait.h>".} + ## True if child has been continued. |