Fixes parallel build on FreeBSD
This commit is contained in:
parent
67e489d4e5
commit
601b262a8d
2 changed files with 12 additions and 9 deletions
|
|
@ -1405,14 +1405,6 @@ var
|
||||||
## Report status of stopped child process.
|
## Report status of stopped child process.
|
||||||
WEXITSTATUS* {.importc, header: "<sys/wait.h>".}: cint
|
WEXITSTATUS* {.importc, header: "<sys/wait.h>".}: cint
|
||||||
## Return exit status.
|
## Return exit status.
|
||||||
WIFCONTINUED* {.importc, header: "<sys/wait.h>".}: cint
|
|
||||||
## True if child has been continued.
|
|
||||||
WIFEXITED* {.importc, header: "<sys/wait.h>".}: cint
|
|
||||||
## True if child exited normally.
|
|
||||||
WIFSIGNALED* {.importc, header: "<sys/wait.h>".}: cint
|
|
||||||
## True if child exited due to uncaught signal.
|
|
||||||
WIFSTOPPED* {.importc, header: "<sys/wait.h>".}: cint
|
|
||||||
## True if child is currently stopped.
|
|
||||||
WSTOPSIG* {.importc, header: "<sys/wait.h>".}: cint
|
WSTOPSIG* {.importc, header: "<sys/wait.h>".}: cint
|
||||||
## Return signal number that caused process to stop.
|
## Return signal number that caused process to stop.
|
||||||
WTERMSIG* {.importc, header: "<sys/wait.h>".}: cint
|
WTERMSIG* {.importc, header: "<sys/wait.h>".}: cint
|
||||||
|
|
@ -1559,6 +1551,14 @@ var
|
||||||
MSG_OOB* {.importc, header: "<sys/socket.h>".}: cint
|
MSG_OOB* {.importc, header: "<sys/socket.h>".}: cint
|
||||||
## Out-of-band data.
|
## Out-of-band data.
|
||||||
|
|
||||||
|
proc WIFCONTINUED*(s:cint) : bool {.importc, header: "<sys/wait.h>".}
|
||||||
|
## True if child has been continued.
|
||||||
|
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.
|
||||||
|
|
||||||
when defined(linux):
|
when defined(linux):
|
||||||
var
|
var
|
||||||
|
|
|
||||||
|
|
@ -848,7 +848,10 @@ elif not defined(useNimRtl):
|
||||||
if kill(p.id, SIGCONT) != 0'i32: raiseOsError(osLastError())
|
if kill(p.id, SIGCONT) != 0'i32: raiseOsError(osLastError())
|
||||||
|
|
||||||
proc running(p: Process): bool =
|
proc running(p: Process): bool =
|
||||||
var ret = waitpid(p.id, p.exitCode, WNOHANG)
|
var status : cint
|
||||||
|
var ret = waitpid(p.id, status, WNOHANG)
|
||||||
|
if WIFEXITED(status):
|
||||||
|
p.exitCode = status
|
||||||
if ret == 0: return true # Can't establish status. Assume running.
|
if ret == 0: return true # Can't establish status. Assume running.
|
||||||
result = ret == int(p.id)
|
result = ret == int(p.id)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue