mirror of
https://github.com/status-im/nim-stew.git
synced 2025-02-27 11:20:29 +00:00
18 lines
430 B
Nim
18 lines
430 B
Nim
import os
|
|
export os
|
|
|
|
when defined(windows):
|
|
import winlean
|
|
else:
|
|
import posix
|
|
|
|
proc getCurrentProcessId*(): int =
|
|
## return current process ID. See also ``osproc.processID(p: Process)``.
|
|
when defined(windows):
|
|
proc GetCurrentProcessId(): DWORD {.stdcall, dynlib: "kernel32",
|
|
importc: "GetCurrentProcessId".}
|
|
result = GetCurrentProcessId().int
|
|
else:
|
|
result = getpid()
|
|
|