119370Spst/* Portable <sys/stat.h> 219370Spst Copyright 1995 Free Software Foundation, Inc. 319370Spst 498944Sobrien This file is part of GDB. 519370Spst 698944Sobrien This program is free software; you can redistribute it and/or modify 798944Sobrien it under the terms of the GNU General Public License as published by 898944Sobrien the Free Software Foundation; either version 2 of the License, or 998944Sobrien (at your option) any later version. 1019370Spst 1198944Sobrien This program is distributed in the hope that it will be useful, 1298944Sobrien but WITHOUT ANY WARRANTY; without even the implied warranty of 1398944Sobrien MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1498944Sobrien GNU General Public License for more details. 1519370Spst 1698944Sobrien You should have received a copy of the GNU General Public License 1798944Sobrien along with this program; if not, write to the Free Software 1898944Sobrien Foundation, Inc., 59 Temple Place - Suite 330, 1998944Sobrien Boston, MA 02111-1307, USA. */ 2019370Spst 2119370Spst#if !defined(GDB_STAT_H) 2219370Spst#define GDB_STAT_H 2319370Spst 2419370Spst#include <sys/types.h> 2519370Spst#include <sys/stat.h> 2619370Spst 2719370Spst#ifdef STAT_MACROS_BROKEN 2819370Spst#undef S_ISBLK 2919370Spst#undef S_ISCHR 3019370Spst#undef S_ISDIR 3119370Spst#undef S_ISREG 3219370Spst#undef S_ISFIFO 3319370Spst#undef S_ISLNK 3419370Spst#undef S_ISSOCK 3519370Spst#undef S_ISMPB 3619370Spst#undef S_ISMPC 3719370Spst#undef S_ISNWK 3819370Spst#endif 3919370Spst 4019370Spst#if !defined(S_ISBLK) && defined(S_IFBLK) 4119370Spst#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) 4219370Spst#endif 4319370Spst#if !defined(S_ISCHR) && defined(S_IFCHR) 4419370Spst#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) 4519370Spst#endif 4619370Spst#if !defined(S_ISDIR) && defined(S_IFDIR) 4719370Spst#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 4819370Spst#endif 4919370Spst#if !defined(S_ISREG) && defined(S_IFREG) 5019370Spst#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 5119370Spst#endif 5219370Spst#if !defined(S_ISFIFO) && defined(S_IFIFO) 5319370Spst#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) 5419370Spst#endif 5519370Spst#if !defined(S_ISLNK) && defined(S_IFLNK) 5619370Spst#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) 5719370Spst#endif 5819370Spst#if !defined(S_ISSOCK) && defined(S_IFSOCK) 5919370Spst#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) 6019370Spst#endif 6198944Sobrien#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ 6219370Spst#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) 6319370Spst#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) 6419370Spst#endif 6598944Sobrien#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ 6619370Spst#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) 6719370Spst#endif 6819370Spst 6998944Sobrien/* Microsoft C's stat.h doesn't define all the POSIX file modes. */ 7098944Sobrien#ifndef S_IROTH 7198944Sobrien#define S_IROTH S_IREAD 7298944Sobrien#endif 7398944Sobrien 7498944Sobrien#endif /* !defined(GDB_STAT_H) */ 75