os: Add OS_STD*_FILENO constants

This commit is contained in:
ZyX 2017-07-04 17:12:00 +03:00
parent 72b3fd9664
commit f0b3029ad3
2 changed files with 17 additions and 0 deletions

View File

@ -13,6 +13,13 @@
# include "nvim/os/unix_defs.h"
#endif
/// File descriptor number used for standard IO streams
enum {
OS_STDIN_FILENO = STDIN_FILENO,
OS_STDOUT_FILENO = STDOUT_FILENO,
OS_STDERR_FILENO = STDERR_FILENO,
};
#define BASENAMELEN (NAME_MAX - 5)
// Use the system path length if it makes sense.

View File

@ -91,4 +91,14 @@ typedef SSIZE_T ssize_t;
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
#ifndef STDIN_FILENO
# define STDIN_FILENO 0
#endif
#ifndef STDOUT_FILENO
# define STDOUT_FILENO 1
#endif
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
#endif // NVIM_OS_WIN_DEFS_H