unistd.h 1.21 KB
Newer Older
Geoff Voelker's avatar
Geoff Voelker committed
1
/* Fake unistd.h: config.h already provides most of the relevant things. */
Miles Bader's avatar
Miles Bader committed
2

3 4 5
#ifndef _UNISTD_H
#define _UNISTD_H

6 7 8 9 10
/* 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.  */

Juanma Barranquero's avatar
Juanma Barranquero committed
11 12
/* Provide prototypes of library functions that are emulated on w32
   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 ssize_t readlinkat (int, const char *, char *, size_t);
16
extern int symlink (char const *, char const *);
17 18
extern int setpgid (pid_t, pid_t);
extern pid_t getpgrp (void);
19 20
extern pid_t setsid (void);
extern pid_t tcgetpgrp (int);
21

22 23 24 25 26 27 28 29
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

30
#define O_NOCTTY 0
31
#define O_IGNORE_CTTY 0
32

33 34 35
/* This is normally on stdlib.h, but we don't override that header.  */
extern int unsetenv (const char *);

36
#endif	/* _UNISTD_H */