()
| 184 | /// See https://skarnet.org/software/s6/notifywhenup.html |
| 185 | #[cfg(all(unix, feature = "cli"))] |
| 186 | pub 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")))] |
| 197 | pub fn fd_readiness_notification() {} |