Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
This commit is contained in:
commit
dfeb0e8432
3 changed files with 17 additions and 4 deletions
|
|
@ -168,6 +168,9 @@ proc processID*(p: PProcess): int {.rtl, extern: "nosp$1".} =
|
|||
proc waitForExit*(p: PProcess, timeout: int = -1): int {.rtl,
|
||||
extern: "nosp$1", tags: [].}
|
||||
## waits for the process to finish and returns `p`'s error code.
|
||||
##
|
||||
## **Warning**: Be careful when using waitForExit for processes created without
|
||||
## poParentStreams because they may fill output buffers, causing deadlock.
|
||||
|
||||
proc peekExitCode*(p: PProcess): int {.tags: [].}
|
||||
## return -1 if the process is still running. Otherwise the process' exit code
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ when hostos == "solaris":
|
|||
|
||||
when defined(Windows):
|
||||
import winlean
|
||||
export ioctlsocket
|
||||
else:
|
||||
import posix
|
||||
export fcntl, F_GETFL, O_NONBLOCK, F_SETFL
|
||||
|
|
@ -66,6 +65,16 @@ type
|
|||
when defined(windows):
|
||||
let
|
||||
osInvalidSocket* = winlean.INVALID_SOCKET
|
||||
|
||||
const
|
||||
IOCPARM_MASK* = 127
|
||||
IOC_IN* = int(-2147483648)
|
||||
FIONBIO* = IOC_IN.int32 or ((sizeof(int32) and IOCPARM_MASK) shl 16) or
|
||||
(102 shl 8) or 126
|
||||
|
||||
proc ioctlsocket*(s: TSocketHandle, cmd: clong,
|
||||
argptr: ptr clong): cint {.
|
||||
stdcall, importc: "ioctlsocket", dynlib: "ws2_32.dll".}
|
||||
else:
|
||||
let
|
||||
osInvalidSocket* = posix.INVALID_SOCKET
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue