def my_pid

cswap-bend-cli@0.1.0.0 · daemon/pidlock.bend:34

import cswap-bend-cli@0.1.0.0/daemon/pidlock.bend as Pidlock
import Base

34# This process's pid: the parent of a child shell (Bend has no getpid).
35def my_pid() -> IO(U32):
36  IO.bind(Result<&1, &1, U32 & String, U32 & (String & String)>, U32, Process.run("/bin/sh", ["-c", "echo $PPID"], "", 64, 5000), r => IO.pure(U32, pid_of(r)))

Uses (10)

Used by (2)