@@ -12,11 +12,18 @@ module unix_unistd
1212 integer (kind= c_int), parameter , public :: STDOUT_FILENO = 1
1313 integer (kind= c_int), parameter , public :: STDERR_FILENO = 2
1414
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
1521 public :: c_chdir
1622 public :: c_close
1723 public :: c_dup
1824 public :: c_dup2
1925 public :: c_execl
26+ public :: c_faccessat
2027 public :: c_fork
2128 public :: c_getpid
2229 public :: c_pipe
@@ -27,6 +34,15 @@ module unix_unistd
2734 public :: c_write
2835
2936 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+
3046 ! int chdir(const char *path)
3147 function c_chdir (path ) bind(c, name= ' chdir' )
3248 import :: c_int, c_char
@@ -72,6 +88,17 @@ function c_execl(path, arg1, arg2, arg3, ptr) bind(c, name='c_execl')
7288 integer (kind= c_int) :: c_execl
7389 end function c_execl
7490
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+
75102 ! pid_t fork(void)
76103 function c_fork () bind(c, name= ' fork' )
77104 import :: c_pid_t
0 commit comments