File tree 1 file changed +25
-0
lines changed
crates/wasi-common/yanix/src
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ bitflags! {
31
31
}
32
32
}
33
33
34
+ bitflags ! {
35
+ pub struct Access : libc:: c_int {
36
+ const R_OK = libc:: R_OK ;
37
+ const W_OK = libc:: W_OK ;
38
+ const X_OK = libc:: X_OK ;
39
+ const F_OK = libc:: F_OK ;
40
+ }
41
+ }
42
+
34
43
bitflags ! {
35
44
pub struct AtFlags : libc:: c_int {
36
45
const REMOVEDIR = libc:: AT_REMOVEDIR ;
@@ -315,6 +324,22 @@ pub unsafe fn fstat(fd: RawFd) -> Result<stat> {
315
324
Ok ( filestat. assume_init ( ) )
316
325
}
317
326
327
+ pub unsafe fn faccessat < P : AsRef < Path > > (
328
+ dirfd : RawFd ,
329
+ path : P ,
330
+ access : Access ,
331
+ flags : AtFlags ,
332
+ ) -> Result < ( ) > {
333
+ let path = cstr ( path) ?;
334
+ from_result ( libc:: faccessat (
335
+ dirfd as libc:: c_int ,
336
+ path. as_ptr ( ) ,
337
+ access. bits ( ) ,
338
+ flags. bits ( ) ,
339
+ ) ) ?;
340
+ Ok ( ( ) )
341
+ }
342
+
318
343
/// `fionread()` function, equivalent to `ioctl(fd, FIONREAD, *bytes)`.
319
344
pub unsafe fn fionread ( fd : RawFd ) -> Result < u32 > {
320
345
let mut nread: libc:: c_int = 0 ;
You can’t perform that action at this time.
0 commit comments