| ... | @@ -95,6 +95,13 @@ pub const SIGLIBRT = 33; | ... | @@ -95,6 +95,13 @@ pub const SIGLIBRT = 33; |
| 95 | pub const SIGRTMIN = 65; | 95 | pub const SIGRTMIN = 65; |
| 96 | pub const SIGRTMAX = 126; | 96 | pub const SIGRTMAX = 126; |
| 97 | | 97 | |
| | 98 | // access function |
| | 99 | pub const F_OK = 0; // test for existence of file |
| | 100 | pub const X_OK = 1; // test for execute or search permission |
| | 101 | pub const W_OK = 2; // test for write permission |
| | 102 | pub const R_OK = 4; // test for read permission |
| | 103 | |
| | 104 | |
| 98 | pub const O_RDONLY = 0o0; | 105 | pub const O_RDONLY = 0o0; |
| 99 | pub const O_WRONLY = 0o1; | 106 | pub const O_WRONLY = 0o1; |
| 100 | pub const O_RDWR = 0o2; | 107 | pub const O_RDWR = 0o2; |
| ... | @@ -554,6 +561,10 @@ pub fn fork() usize { | ... | @@ -554,6 +561,10 @@ pub fn fork() usize { |
| 554 | return arch.syscall0(SYS_fork); | 561 | return arch.syscall0(SYS_fork); |
| 555 | } | 562 | } |
| 556 | | 563 | |
| | 564 | pub fn access(path: [*]const u8, mode: u32) usize { |
| | 565 | return errnoWrap(c.access(path, mode)); |
| | 566 | } |
| | 567 | |
| 557 | pub fn getcwd(buf: [*]u8, size: usize) usize { | 568 | pub fn getcwd(buf: [*]u8, size: usize) usize { |
| 558 | return arch.syscall2(SYS___getcwd, @ptrToInt(buf), size); | 569 | return arch.syscall2(SYS___getcwd, @ptrToInt(buf), size); |
| 559 | } | 570 | } |