Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Portable <sys/stat.h> |
28e7fd62 | 2 | Copyright (C) 1995-2013 Free Software Foundation, Inc. |
c906108c | 3 | |
c5aa993b | 4 | This file is part of GDB. |
c906108c | 5 | |
c5aa993b JM |
6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 8 | the Free Software Foundation; either version 3 of the License, or |
c5aa993b | 9 | (at your option) any later version. |
c906108c | 10 | |
c5aa993b JM |
11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
c906108c | 15 | |
c5aa993b | 16 | You should have received a copy of the GNU General Public License |
a9762ec7 | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
c906108c SS |
18 | |
19 | #if !defined(GDB_STAT_H) | |
20 | #define GDB_STAT_H | |
21 | ||
22 | #include <sys/types.h> | |
23 | #include <sys/stat.h> | |
24 | ||
c906108c SS |
25 | #if !defined(S_ISBLK) && defined(S_IFBLK) |
26 | #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) | |
27 | #endif | |
28 | #if !defined(S_ISCHR) && defined(S_IFCHR) | |
29 | #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) | |
30 | #endif | |
31 | #if !defined(S_ISDIR) && defined(S_IFDIR) | |
32 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) | |
33 | #endif | |
34 | #if !defined(S_ISREG) && defined(S_IFREG) | |
35 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) | |
36 | #endif | |
37 | #if !defined(S_ISFIFO) && defined(S_IFIFO) | |
38 | #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) | |
39 | #endif | |
40 | #if !defined(S_ISLNK) && defined(S_IFLNK) | |
41 | #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) | |
42 | #endif | |
43 | #if !defined(S_ISSOCK) && defined(S_IFSOCK) | |
44 | #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) | |
45 | #endif | |
c5aa993b | 46 | #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ |
c906108c SS |
47 | #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) |
48 | #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) | |
49 | #endif | |
c5aa993b | 50 | #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ |
c906108c SS |
51 | #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) |
52 | #endif | |
53 | ||
ba79cc81 C |
54 | /* Microsoft C's stat.h doesn't define all the POSIX file modes. */ |
55 | #ifndef S_IROTH | |
56 | #define S_IROTH S_IREAD | |
57 | #endif | |
58 | ||
c5aa993b | 59 | #endif /* !defined(GDB_STAT_H) */ |