authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2022-06-18 16:00:40-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-05 15:04:31-04:00
log93ac87c1bdc40e6cc11bcad1948d767af3725018
treeb414bcfe2e45d03a034bce83975da5af8bf8f5dd
parent86570b3e2c58da76d7e94531c1aa8017012b0521

Mark fstype argument to mount as optional

The fstype argument to the mount system call can be null. To see an example run "strace -e trace=mount unshare -m": ``` mount("none", "/", NULL, MS_REC|MS_PRIVATE, NULL) = 0 ... ```

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/os/linux.zig+1-1
...@@ -376,7 +376,7 @@ pub fn mknodat(dirfd: i32, path: [*:0]const u8, mode: u32, dev: u32) usize {...@@ -376,7 +376,7 @@ pub fn mknodat(dirfd: i32, path: [*:0]const u8, mode: u32, dev: u32) usize {
376 return syscall4(.mknodat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, dev);376 return syscall4(.mknodat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, dev);
377}377}
378378
379pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: [*:0]const u8, flags: u32, data: usize) usize {379pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: ?[*:0]const u8, flags: u32, data: usize) usize {
380 return syscall5(.mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data);380 return syscall5(.mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data);
381}381}
382382