summaryrefslogtreecommitdiffstats
path: root/src/info.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-08 01:06:15 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-08 01:06:15 -0500
commit49c8dadc0c44a3000d2a3f53dd3e06539e797747 (patch)
treef82bc4570d7a825ceff4986613e78be1753a288f /src/info.rs
parent9f7e4412f334dca01f19d275af6a3eaa5b449dba (diff)
downloadnbsh-49c8dadc0c44a3000d2a3f53dd3e06539e797747.tar.gz
nbsh-49c8dadc0c44a3000d2a3f53dd3e06539e797747.zip
add support for special env vars
Diffstat (limited to 'src/info.rs')
-rw-r--r--src/info.rs4
1 files changed, 4 insertions, 0 deletions
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<String> {
))
}
+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/:
//