()
| 77 | #[cfg(feature = "alloc")] |
| 78 | #[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] |
| 79 | pub fn name() -> io::Result<CString> { |
| 80 | let mut buffer = [0_u8; 16]; |
| 81 | unsafe { prctl_2args(PR_GET_NAME, buffer.as_mut_ptr().cast())? }; |
| 82 | |
| 83 | let len = buffer.iter().position(|&x| x == 0_u8).unwrap_or(0); |
| 84 | CString::new(&buffer[..len]).map_err(|_r| io::Errno::ILSEQ) |
| 85 | } |
| 86 | |
| 87 | const PR_SET_NAME: c_int = 15; |
| 88 |
nothing calls this directly
no test coverage detected