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