From 49c8dadc0c44a3000d2a3f53dd3e06539e797747 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 8 Jan 2022 01:06:15 -0500 Subject: add support for special env vars --- src/info.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/info.rs') diff --git a/src/info.rs b/src/info.rs index e441b16..bd94205 100644 --- a/src/info.rs +++ b/src/info.rs @@ -29,6 +29,10 @@ pub fn time(offset: time::UtcOffset) -> anyhow::Result { )) } +pub fn pid() -> String { + nix::unistd::getpid().to_string() +} + // the time crate is currently unable to get the local offset on unix due to // soundness concerns, so we have to do it manually/: // -- cgit v1.2.3-54-g00ecf