diff options
| author | Eli Zaretskii | 2020-01-20 18:21:09 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2020-01-20 18:21:09 +0200 |
| commit | f650d54c6a3620d3b1c264a944023beea15fe394 (patch) | |
| tree | 554a768d3e9fadff2c34bcfba8991ae0f9f315ef /src | |
| parent | 215ceadcc8607a0118340181805d7951fa25c979 (diff) | |
| download | emacs-f650d54c6a3620d3b1c264a944023beea15fe394.tar.gz emacs-f650d54c6a3620d3b1c264a944023beea15fe394.zip | |
Unbreak the MS-Windows build
* src/w32.c (openat): New function.
* src/w32.h (openat): Add prototype.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 21 | ||||
| -rw-r--r-- | src/w32.h | 1 |
2 files changed, 22 insertions, 0 deletions
| @@ -4592,6 +4592,27 @@ sys_open (const char * path, int oflag, int mode) | |||
| 4592 | } | 4592 | } |
| 4593 | 4593 | ||
| 4594 | int | 4594 | int |
| 4595 | openat (int fd, const char * path, int oflag, int mode) | ||
| 4596 | { | ||
| 4597 | /* Rely on a hack: an open directory is modeled as file descriptor 0, | ||
| 4598 | as in fstatat. FIXME: Add proper support for openat. */ | ||
| 4599 | char fullname[MAX_UTF8_PATH]; | ||
| 4600 | |||
| 4601 | if (fd != AT_FDCWD) | ||
| 4602 | { | ||
| 4603 | if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, path) | ||
| 4604 | < 0) | ||
| 4605 | { | ||
| 4606 | errno = ENAMETOOLONG; | ||
| 4607 | return -1; | ||
| 4608 | } | ||
| 4609 | path = fullname; | ||
| 4610 | } | ||
| 4611 | |||
| 4612 | return sys_open (path, oflag, mode); | ||
| 4613 | } | ||
| 4614 | |||
| 4615 | int | ||
| 4595 | fchmod (int fd, mode_t mode) | 4616 | fchmod (int fd, mode_t mode) |
| 4596 | { | 4617 | { |
| 4597 | return 0; | 4618 | return 0; |
| @@ -221,6 +221,7 @@ extern void register_child (pid_t, int); | |||
| 221 | 221 | ||
| 222 | extern void sys_sleep (int); | 222 | extern void sys_sleep (int); |
| 223 | extern int sys_link (const char *, const char *); | 223 | extern int sys_link (const char *, const char *); |
| 224 | extern int openat (int, const char *, int, int); | ||
| 224 | 225 | ||
| 225 | /* Return total and free memory info. */ | 226 | /* Return total and free memory info. */ |
| 226 | extern int w32_memory_info (unsigned long long *, unsigned long long *, | 227 | extern int w32_memory_info (unsigned long long *, unsigned long long *, |