mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-15 17:35:45 +00:00
19 lines
470 B
Nim
19 lines
470 B
Nim
|
import std/os
|
||
|
export os
|
||
|
|
||
|
when defined(windows):
|
||
|
import winlean
|
||
|
else:
|
||
|
import posix
|
||
|
|
||
|
when not declared(getCurrentProcessId):
|
||
|
proc getCurrentProcessId*(): int =
|
||
|
## return current process ID. See also ``osproc.processID(p: Process)``.
|
||
|
when defined(windows):
|
||
|
proc GetCurrentProcessId(): DWORD {.stdcall, dynlib: "kernel32",
|
||
|
importc: "GetCurrentProcessId".}
|
||
|
GetCurrentProcessId().int
|
||
|
else:
|
||
|
getpid()
|
||
|
|