Assume POSIX 1003.1-1988 or later for fcntl.h.
[bpt/emacs.git] / nt / inc / unistd.h
1 /* Fake unistd.h: config.h already provides most of the relevant things. */
2
3 #ifndef _UNISTD_H
4 #define _UNISTD_H
5
6 /* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX
7 platforms, <unistd.h> does. Every file in Emacs that includes
8 <unistd.h> also includes <stdlib.h>, so there's no need to declare
9 'environ' here. */
10
11 /* Provide prototypes of library functions that are emulated on w32
12 and whose prototypes are usually found in unistd.h on POSIX
13 platforms. */
14 extern ssize_t readlink (const char *, char *, size_t);
15 extern int symlink (char const *, char const *);
16 extern int setpgid (pid_t, pid_t);
17 extern pid_t getpgrp (void);
18 extern pid_t setsid (void);
19 extern pid_t tcgetpgrp (int);
20
21 extern 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
29 /* Here are some more fcntl.h macros that default to gnulib-compatible
30 values. Include <fcntl.h> first, to make sure we don't override
31 its values if any. FIXME: If we know <fcntl.h> does not define
32 O_NOCTTY and O_RDWR, this can be replaced with a simple "#define
33 O_NOCTTY 0" and "#define O_RDWR 2". */
34 #include <fcntl.h>
35 #ifndef O_NOCTTY
36 #define O_NOCTTY 0
37 #endif
38 #ifndef O_RDWR
39 #define O_RDWR 2
40 #endif
41
42 #endif /* _UNISTD_H */