blob: 08e477d62d1e2219fed0ef01bfb0f5b7fcfe81b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/*
* FILE: stat.h
* AUTH: mcc
* DESC:
* DATE: Fri Mar 13 23:10:46 1998
*/
#pragma once
/* Kernel and user header (via symlink) */
typedef struct stat
{
int st_mode;
int st_ino;
int st_dev;
int st_rdev;
int st_nlink;
int st_uid;
int st_gid;
int st_size;
int st_atime;
int st_mtime;
int st_ctime;
int st_blksize;
int st_blocks;
} stat_t;
/* vnode vn_mode masks */
#define S_IFCHR 0x0100 /* character special */
#define S_IFDIR 0x0200 /* directory */
#define S_IFBLK 0x0400 /* block special */
#define S_IFREG 0x0800 /* regular */
#define S_IFLNK 0x1000 /* symlink */
#define S_IFIFO 0x2000 /* fifo/pipe */
#define _S_TYPE(m) ((m)&0xFF00)
#define S_ISCHR(m) (_S_TYPE(m) == S_IFCHR)
#define S_ISDIR(m) (_S_TYPE(m) == S_IFDIR)
#define S_ISBLK(m) (_S_TYPE(m) == S_IFBLK)
#define S_ISREG(m) (_S_TYPE(m) == S_IFREG)
#define S_ISLNK(m) (_S_TYPE(m) == S_IFLNK)
#define S_ISFIFO(m) (_S_TYPE(m) == S_IFIFO)
|