1 /* This is file STAT.H */
3 ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
5 ** This file is distributed under the terms listed in the document
6 ** "copying.dj", available from DJ Delorie at the address above.
7 ** A copy of "copying.dj" should accompany this file; if not, a copy
8 ** should be available from where this file was obtained. This file
9 ** may not be distributed without a verbatim copy of "copying.dj".
11 ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
12 ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 unsigned short st_mode;
26 short st_align_for_word32;
34 #define S_IFMT 0xF000 /* file type mask */
35 #define S_IFDIR 0x4000 /* directory */
36 #define S_IFIFO 0x1000 /* FIFO special */
37 #define S_IFCHR 0x2000 /* character special */
38 #define S_IFBLK 0x3000 /* block special */
39 #define S_IFREG 0x8000 /* or just 0x0000, regular */
40 #define S_IREAD 0x0100 /* owner may read */
41 #define S_IWRITE 0x0080 /* owner may write */
42 #define S_IEXEC 0x0040 /* owner may execute <directory search> */
44 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
45 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
46 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
47 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
48 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
53 int stat(const char *, struct stat *);
54 int fstat(int, struct stat *);
.