home *** CD-ROM | disk | FTP | other *** search
- #include "amiga.h"
- #include "fibstat.h"
- #include <sys/types.h>
- #include <sys/stat.h>
-
- #undef access
-
- int __access(const char *name, int mode)
- {
- int ret = -1;
- struct stat sbuf;
-
- chkabort();
- if (_fibstat(name, &sbuf) == 0)
- {
- int fmode = (sbuf.st_mode & (S_IREAD | S_IEXEC)) >> 6 |
- (sbuf.st_mode & (S_IWRITE >> 3)) >> 3;
-
- if ((fmode & mode) == mode) ret = 0;
- else errno = EACCES;
- }
- return ret;
- }
-
- int access(const char *name, int mode)
- {
- return __access(name, mode);
- }
-
-