aboutsummaryrefslogtreecommitdiffstats
path: root/nt
diff options
context:
space:
mode:
authorEli Zaretskii2012-11-14 19:22:55 +0200
committerEli Zaretskii2012-11-14 19:22:55 +0200
commit14f207289c224b3ad12fc8704c2183ef8fbcab28 (patch)
tree762793d11e03d384ff44353bdfde59c302cda66d /nt
parentc62792e7dfa403db8c36cb92f32fb69258a199ef (diff)
downloademacs-14f207289c224b3ad12fc8704c2183ef8fbcab28.tar.gz
emacs-14f207289c224b3ad12fc8704c2183ef8fbcab28.zip
MS-Windows followup for 2012-11-14T04:55:41Z!eggert@cs.ucla.edu, regarding faccessat.
nt/inc/unistd.h (faccessat): Add prototype. (AT_FDCWD, AT_EACCESS, AT_SYMLINK_NOFOLLOW): New macros; the first 2 moved from ms-w32.h. nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS, faccessat): Remove macros. src/w32.c (faccessat): Rename from sys_faccessat. (No need to use a different name, as the MS runtime does not have such a function, and probably never will.) All callers changed. Ignore DIRFD value if PATH is an absolute file name, to match Posix spec better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve symlinks. Fixes: debbugs:12632
Diffstat (limited to 'nt')
-rw-r--r--nt/ChangeLog8
-rw-r--r--nt/inc/ms-w32.h5
-rw-r--r--nt/inc/unistd.h8
3 files changed, 16 insertions, 5 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 320c9e6366e..685e291e272 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,11 @@
12012-11-14 Eli Zaretskii <eliz@gnu.org>
2
3 * inc/unistd.h (faccessat): Add prototype.
4 (AT_FDCWD, AT_EACCESS, AT_SYMLINK_NOFOLLOW): New macros; the first
5 2 moved from ms-w32.h.
6
7 * inc/ms-w32.h (AT_FDCWD, AT_EACCESS, faccessat): Remove macros.
8
12012-11-14 Paul Eggert <eggert@cs.ucla.edu> 92012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2 10
3 Use faccessat, not access, when checking file permissions (Bug#12632). 11 Use faccessat, not access, when checking file permissions (Bug#12632).
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 0f6b51d3915..1b2a309e1be 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -124,10 +124,6 @@ extern char *getenv ();
124#define MAXPATHLEN _MAX_PATH 124#define MAXPATHLEN _MAX_PATH
125#endif 125#endif
126 126
127/* Use values compatible with gnulib, as there's no reason to differ. */
128#define AT_FDCWD (-3041965)
129#define AT_EACCESS 4
130
131#ifdef HAVE_NTGUI 127#ifdef HAVE_NTGUI
132#define HAVE_WINDOW_SYSTEM 1 128#define HAVE_WINDOW_SYSTEM 1
133#define HAVE_MENUS 1 129#define HAVE_MENUS 1
@@ -163,7 +159,6 @@ extern char *getenv ();
163#define dup sys_dup 159#define dup sys_dup
164#undef dup2 160#undef dup2
165#define dup2 sys_dup2 161#define dup2 sys_dup2
166#define faccessat sys_faccessat
167#define fopen sys_fopen 162#define fopen sys_fopen
168#define link sys_link 163#define link sys_link
169#define localtime sys_localtime 164#define localtime sys_localtime
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h
index 4c5f7d4c124..b0f3092cafb 100644
--- a/nt/inc/unistd.h
+++ b/nt/inc/unistd.h
@@ -18,4 +18,12 @@ extern pid_t getpgrp (void);
18extern pid_t setsid (void); 18extern pid_t setsid (void);
19extern pid_t tcgetpgrp (int); 19extern pid_t tcgetpgrp (int);
20 20
21extern int faccessat (int, char const *, int, int);
22
23/* These are normally on fcntl.h, but we don't override that header. */
24/* Use values compatible with gnulib, as there's no reason to differ. */
25#define AT_FDCWD (-3041965)
26#define AT_EACCESS 4
27#define AT_SYMLINK_NOFOLLOW 4096
28
21#endif /* _UNISTD_H */ 29#endif /* _UNISTD_H */