diff options
| author | Eli Zaretskii <eliz@gnu.org> | 2020-01-20 18:21:09 +0200 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2020-01-20 18:21:09 +0200 |
| commit | f650d54c6a3620d3b1c264a944023beea15fe394 (patch) | |
| tree | 554a768d3e9fadff2c34bcfba8991ae0f9f315ef /src/w32.c | |
| parent | 215ceadcc8607a0118340181805d7951fa25c979 (diff) | |
| download | emacs-f650d54c6a3620d3b1c264a944023beea15fe394.tar.gz | |
Unbreak the MS-Windows build
* src/w32.c (openat): New function.
* src/w32.h (openat): Add prototype.
Diffstat (limited to 'src/w32.c')
| -rw-r--r-- | src/w32.c | 21 |
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; |
