mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 14:59:14 +00:00
linux: add mknod and mknodat syscalls
This commit is contained in:
parent
f5d9d739d7
commit
15bec20b00
@ -253,6 +253,18 @@ pub fn mkdirat(dirfd: i32, path: [*:0]const u8, mode: u32) usize {
|
||||
return syscall3(.mkdirat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode);
|
||||
}
|
||||
|
||||
pub fn mknod(path: [*:0]const u8, mode: u32, dev: u32) usize {
|
||||
if (@hasField(SYS, "mknod")) {
|
||||
return syscall3(.mknod, @ptrToInt(path), mode, dev);
|
||||
} else {
|
||||
return mknodat(AT_FDCWD, path, mode, dev);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn mknodat(dirfd: i32, path: [*:0]const u8, mode: u32, dev: u32) usize {
|
||||
return syscall4(.mknodat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, dev);
|
||||
}
|
||||
|
||||
pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: [*:0]const u8, flags: u32, data: usize) usize {
|
||||
return syscall5(.mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user