MCPcopy Create free account
hub / github.com/bwt-dev/bwt / fd_readiness_notification

Function fd_readiness_notification

src/util/mod.rs:186–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184/// See https://skarnet.org/software/s6/notifywhenup.html
185#[cfg(all(unix, feature = "cli"))]
186pub fn fd_readiness_notification() {
187 use std::os::unix::io::FromRawFd;
188 use std::{env, fs::File, io::Write};
189 if let Ok(fd_number) = env::var("NOTIFY_FD") {
190 if let Ok(fd_number) = fd_number.parse::<u32>() {
191 let mut f = unsafe { File::from_raw_fd(fd_number as i32) };
192 write!(f, "\n").ok();
193 }
194 }
195}
196#[cfg(not(all(unix, feature = "cli")))]
197pub fn fd_readiness_notification() {}

Callers 1

bootMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected