1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00
emacs/nt/inc/unistd.h
Eli Zaretskii 14f207289c 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
2012-11-14 19:22:55 +02:00

30 lines
1.0 KiB
C

/* Fake unistd.h: config.h already provides most of the relevant things. */
#ifndef _UNISTD_H
#define _UNISTD_H
/* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX
platforms, <unistd.h> does. Every file in Emacs that includes
<unistd.h> also includes <stdlib.h>, so there's no need to declare
'environ' here. */
/* Provide prototypes of library functions that are emulated on w32
and whose prototypes are usually found in unistd.h on POSIX
platforms. */
extern ssize_t readlink (const char *, char *, size_t);
extern int symlink (char const *, char const *);
extern int setpgid (pid_t, pid_t);
extern pid_t getpgrp (void);
extern pid_t setsid (void);
extern pid_t tcgetpgrp (int);
extern int faccessat (int, char const *, int, int);
/* These are normally on fcntl.h, but we don't override that header. */
/* Use values compatible with gnulib, as there's no reason to differ. */
#define AT_FDCWD (-3041965)
#define AT_EACCESS 4
#define AT_SYMLINK_NOFOLLOW 4096
#endif /* _UNISTD_H */