@@ -12,11 +12,18 @@ module unix_unistd
12
12
integer (kind= c_int), parameter , public :: STDOUT_FILENO = 1
13
13
integer (kind= c_int), parameter , public :: STDERR_FILENO = 2
14
14
15
+ integer (kind= c_int), parameter , public :: F_OK = 0 ! Test for existence of file.
16
+ integer (kind= c_int), parameter , public :: X_OK = int (z' 01' ) ! Test for execute or search permission.
17
+ integer (kind= c_int), parameter , public :: W_OK = int (z' 02' ) ! Test for write permission.
18
+ integer (kind= c_int), parameter , public :: R_OK = int (z' 04' ) ! Test for read permission.
19
+
20
+ public :: c_access
15
21
public :: c_chdir
16
22
public :: c_close
17
23
public :: c_dup
18
24
public :: c_dup2
19
25
public :: c_execl
26
+ public :: c_faccessat
20
27
public :: c_fork
21
28
public :: c_getpid
22
29
public :: c_pipe
@@ -27,6 +34,15 @@ module unix_unistd
27
34
public :: c_write
28
35
29
36
interface
37
+ ! int access(const char *path, int mode)
38
+ function c_access (path , mode ) bind(c, name= ' access' )
39
+ import :: c_char, c_int
40
+ implicit none
41
+ character (kind= c_char), intent (in ) :: path
42
+ integer (kind= c_int), intent (in ), value :: mode
43
+ integer (kind= c_int) :: c_access
44
+ end function c_access
45
+
30
46
! int chdir(const char *path)
31
47
function c_chdir (path ) bind(c, name= ' chdir' )
32
48
import :: c_int, c_char
@@ -72,6 +88,17 @@ function c_execl(path, arg1, arg2, arg3, ptr) bind(c, name='c_execl')
72
88
integer (kind= c_int) :: c_execl
73
89
end function c_execl
74
90
91
+ ! int faccessat(int dirfd, const char *path, int mode, int flags)
92
+ function c_faccessat (dirfd , path , mode , flags ) bind(c, name= ' faccessat' )
93
+ import :: c_char, c_int
94
+ implicit none
95
+ integer (kind= c_int), intent (in ), value :: dirfd
96
+ character (kind= c_char), intent (in ) :: path
97
+ integer (kind= c_int), intent (in ), value :: mode
98
+ integer (kind= c_int), intent (in ), value :: flags
99
+ integer (kind= c_int) :: c_faccessat
100
+ end function c_faccessat
101
+
75
102
! pid_t fork(void)
76
103
function c_fork () bind(c, name= ' fork' )
77
104
import :: c_pid_t
0 commit comments