Pidlock.my_pid: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/daemon/pidlock.bend as Pidlock Lines 34-36 of cswap-bend-cli@0.1.0.0/daemon/pidlock.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/daemon/pidlock.bend&start_line=34&end_line=36 import Base # This process's pid: the parent of a child shell (Bend has no getpid). def my_pid() -> IO(U32): 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): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Process.run https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/daemon/pidlock.bend&name=pid_of