getpid

Returns the process ID of the calling process, which is guaranteed to be unique on the system. This call is always successful.

  1. alias getpid = core.sys.posix.unistd.getpid
    version(Posix)
    alias getpid = core.sys.posix.unistd.getpid
  2. alias getpid = core.sys.windows.winbase.GetCurrentProcessId

Examples

writefln("Current process id: %s", getpid());

Meta