MCPcopy Index your code
hub / github.com/RustPython/RustPython / shm_unlink

Function shm_unlink

crates/stdlib/src/posixshmem.rs:42–51  ·  view source on GitHub ↗
(name: PyUtf8StrRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

40
41 #[pyfunction]
42 fn shm_unlink(name: PyUtf8StrRef, vm: &VirtualMachine) -> PyResult<()> {
43 let name = CString::new(name.as_str()).map_err(|e| e.into_pyexception(vm))?;
44 // SAFETY: `name` is a valid NUL-terminated string and `shm_unlink` only reads it.
45 let ret = unsafe { libc::shm_unlink(name.as_ptr()) };
46 if ret == -1 {
47 Err(errno_io_error().into_pyexception(vm))
48 } else {
49 Ok(())
50 }
51 }
52}

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
errno_io_errorFunction · 0.85
ErrClass · 0.50
as_strMethod · 0.45
into_pyexceptionMethod · 0.45
as_ptrMethod · 0.45

Tested by

no test coverage detected