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

Method mknod

crates/vm/src/stdlib/posix.rs:1071–1088  ·  view source on GitHub ↗
(self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1069
1070 #[cfg(not(target_vendor = "apple"))]
1071 fn mknod(self, vm: &VirtualMachine) -> PyResult<()> {
1072 let ret = match self.dir_fd.raw_opt() {
1073 None => self._mknod(vm)?,
1074 Some(non_default_fd) => unsafe {
1075 libc::mknodat(
1076 non_default_fd,
1077 self.path.clone().into_cstring(vm)?.as_ptr(),
1078 self.mode,
1079 self.device,
1080 )
1081 },
1082 };
1083 if ret != 0 {
1084 Err(vm.new_last_errno_error())
1085 } else {
1086 Ok(())
1087 }
1088 }
1089
1090 #[cfg(target_vendor = "apple")]
1091 fn mknod(self, vm: &VirtualMachine) -> PyResult<()> {

Callers 5

makedevMethod · 0.80
test_mknodMethod · 0.80
test_mknod_dir_fdMethod · 0.80
test_mknodMethod · 0.80
mknodFunction · 0.80

Calls 7

raw_optMethod · 0.80
_mknodMethod · 0.80
into_cstringMethod · 0.80
new_last_errno_errorMethod · 0.80
ErrClass · 0.50
as_ptrMethod · 0.45
cloneMethod · 0.45

Tested by 3

test_mknodMethod · 0.64
test_mknod_dir_fdMethod · 0.64
test_mknodMethod · 0.64