diff options
Diffstat (limited to 'jimiocompat.c')
-rw-r--r-- | jimiocompat.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/jimiocompat.c b/jimiocompat.c index 8e7f3f2..1384e61 100644 --- a/jimiocompat.c +++ b/jimiocompat.c @@ -249,3 +249,21 @@ int Jim_OpenForRead(const char *filename) } #endif + +#ifndef HAVE_UMASK +mode_t umask(mode_t mode) { + return 0; +} +#endif + +#ifndef HAVE_ACCESS +/* poor-mans access() - ignore mode and treat everything as F_OK */ +int access(const char *path, int mode) +{ + struct stat sb; + if (Jim_Stat(path, &sb) == 0 && S_ISREG(sb.st_mode)) { + return 0; + } + return -1; +} +#endif |