f1763a0f848dbe2085255775232341316b12a826
[platform/upstream/groff.git] / src / include / posix.h
1 // -*- C++ -*-
2 /* Copyright (C) 1992-2014  Free Software Foundation, Inc.
3      Written by James Clark (jjc@jclark.com)
4
5 This file is part of groff.
6
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 #include <sys/types.h>
21 #include <sys/stat.h>
22
23 #ifdef HAVE_CC_OSFCN_H
24 #include <osfcn.h>
25 #else
26 #include <fcntl.h>
27 #ifdef HAVE_UNISTD_H
28 #include <unistd.h>
29 #endif
30 #endif
31
32 #ifndef S_IRUSR
33 #define S_IRUSR 0400
34 #endif
35
36 #ifndef S_IRGRP
37 #define S_IRGRP 0040
38 #endif
39
40 #ifndef S_IROTH
41 #define S_IROTH 0004
42 #endif
43
44 #ifndef S_IWUSR
45 #define S_IWUSR 0200
46 #endif
47
48 #ifndef S_IXUSR
49 #define S_IXUSR 0100
50 #endif
51
52 #ifndef S_ISREG
53 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
54 #endif
55
56 #ifndef O_RDONLY
57 #define O_RDONLY 0
58 #endif
59
60 #ifndef F_OK
61 #define F_OK 0
62 #endif
63
64 #ifndef HAVE_ISATTY
65 #define isatty(n) (1)
66 #endif