summaryrefslogtreecommitdiff
path: root/src/w32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 62c53fd7711..a3b9a5683ad 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -4592,6 +4592,27 @@ sys_open (const char * path, int oflag, int mode)
}
int
+openat (int fd, const char * path, int oflag, int mode)
+{
+ /* Rely on a hack: an open directory is modeled as file descriptor 0,
+ as in fstatat. FIXME: Add proper support for openat. */
+ char fullname[MAX_UTF8_PATH];
+
+ if (fd != AT_FDCWD)
+ {
+ if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, path)
+ < 0)
+ {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ path = fullname;
+ }
+
+ return sys_open (path, oflag, mode);
+}
+
+int
fchmod (int fd, mode_t mode)
{
return 0;