1/* Portable <sys/stat.h>
2   Copyright (C) 1995, 2007 Free Software Foundation, Inc.
3
4   This file is part of GDB.
5
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
8   the Free Software Foundation; either version 3 of the License, or
9   (at your option) any later version.
10
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.
15
16   You should have received a copy of the GNU General Public License
17   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18
19#if !defined(GDB_STAT_H)
20#define GDB_STAT_H
21
22#include <sys/types.h>
23#include <sys/stat.h>
24
25#ifdef STAT_MACROS_BROKEN
26#undef S_ISBLK
27#undef S_ISCHR
28#undef S_ISDIR
29#undef S_ISREG
30#undef S_ISFIFO
31#undef S_ISLNK
32#undef S_ISSOCK
33#undef S_ISMPB
34#undef S_ISMPC
35#undef S_ISNWK
36#endif
37
38#if !defined(S_ISBLK) && defined(S_IFBLK)
39#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
40#endif
41#if !defined(S_ISCHR) && defined(S_IFCHR)
42#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
43#endif
44#if !defined(S_ISDIR) && defined(S_IFDIR)
45#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
46#endif
47#if !defined(S_ISREG) && defined(S_IFREG)
48#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
49#endif
50#if !defined(S_ISFIFO) && defined(S_IFIFO)
51#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
52#endif
53#if !defined(S_ISLNK) && defined(S_IFLNK)
54#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
55#endif
56#if !defined(S_ISSOCK) && defined(S_IFSOCK)
57#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
58#endif
59#if !defined(S_ISMPB) && defined(S_IFMPB)	/* V7 */
60#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
61#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
62#endif
63#if !defined(S_ISNWK) && defined(S_IFNWK)	/* HP/UX */
64#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
65#endif
66
67/* Microsoft C's stat.h doesn't define all the POSIX file modes.  */
68#ifndef S_IROTH
69#define S_IROTH	S_IREAD
70#endif
71
72#endif /* !defined(GDB_STAT_H) */
73