aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2020-01-20 18:21:09 +0200
committerEli Zaretskii2020-01-20 18:21:09 +0200
commitf650d54c6a3620d3b1c264a944023beea15fe394 (patch)
tree554a768d3e9fadff2c34bcfba8991ae0f9f315ef /src
parent215ceadcc8607a0118340181805d7951fa25c979 (diff)
downloademacs-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.c21
-rw-r--r--src/w32.h1
2 files changed, 22 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)
4592} 4592}
4593 4593
4594int 4594int
4595openat (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
4615int
4595fchmod (int fd, mode_t mode) 4616fchmod (int fd, mode_t mode)
4596{ 4617{
4597 return 0; 4618 return 0;
diff --git a/src/w32.h b/src/w32.h
index b8655ec788c..f301b3836ca 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -221,6 +221,7 @@ extern void register_child (pid_t, int);
221 221
222extern void sys_sleep (int); 222extern void sys_sleep (int);
223extern int sys_link (const char *, const char *); 223extern int sys_link (const char *, const char *);
224extern int openat (int, const char *, int, int);
224 225
225/* Return total and free memory info. */ 226/* Return total and free memory info. */
226extern int w32_memory_info (unsigned long long *, unsigned long long *, 227extern int w32_memory_info (unsigned long long *, unsigned long long *,