mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
freebsd: add access
This commit is contained in:
parent
5ea37f6e8c
commit
0273fbf710
@ -95,6 +95,13 @@ pub const SIGLIBRT = 33;
|
||||
pub const SIGRTMIN = 65;
|
||||
pub const SIGRTMAX = 126;
|
||||
|
||||
// access function
|
||||
pub const F_OK = 0; // test for existence of file
|
||||
pub const X_OK = 1; // test for execute or search permission
|
||||
pub const W_OK = 2; // test for write permission
|
||||
pub const R_OK = 4; // test for read permission
|
||||
|
||||
|
||||
pub const O_RDONLY = 0o0;
|
||||
pub const O_WRONLY = 0o1;
|
||||
pub const O_RDWR = 0o2;
|
||||
@ -554,6 +561,10 @@ pub fn fork() usize {
|
||||
return arch.syscall0(SYS_fork);
|
||||
}
|
||||
|
||||
pub fn access(path: [*]const u8, mode: u32) usize {
|
||||
return errnoWrap(c.access(path, mode));
|
||||
}
|
||||
|
||||
pub fn getcwd(buf: [*]u8, size: usize) usize {
|
||||
return arch.syscall2(SYS___getcwd, @ptrToInt(buf), size);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user