MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / name

Function name

src/thread/prctl.rs:79–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77#[cfg(feature = "alloc")]
78#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
79pub 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
87const PR_SET_NAME: c_int = 15;
88

Callers

nothing calls this directly

Calls 2

prctl_2argsFunction · 0.85
as_mut_ptrMethod · 0.45

Tested by

no test coverage detected