|
|
@ -229,30 +229,63 @@ struct sockaddr_storage {
|
|
|
|
struct stat {
|
|
|
|
struct stat {
|
|
|
|
dev_t st_dev;
|
|
|
|
dev_t st_dev;
|
|
|
|
ino_t st_ino;
|
|
|
|
ino_t st_ino;
|
|
|
|
|
|
|
|
ulong st_nlink;
|
|
|
|
|
|
|
|
|
|
|
|
mode_t st_mode;
|
|
|
|
mode_t st_mode;
|
|
|
|
off_t st_size;
|
|
|
|
|
|
|
|
dev_t st_rdev;
|
|
|
|
|
|
|
|
uid_t st_uid;
|
|
|
|
uid_t st_uid;
|
|
|
|
|
|
|
|
gid_t st_gid;
|
|
|
|
|
|
|
|
uint32_t _pad0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dev_t st_rdev;
|
|
|
|
|
|
|
|
off_t st_size;
|
|
|
|
|
|
|
|
ulong st_blksize;
|
|
|
|
blkcnt_t st_blocks;
|
|
|
|
blkcnt_t st_blocks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time_t st_atime;
|
|
|
|
|
|
|
|
ulong st_atimensec;
|
|
|
|
time_t st_mtime;
|
|
|
|
time_t st_mtime;
|
|
|
|
ulong st_mtimensec;
|
|
|
|
ulong st_mtimensec;
|
|
|
|
|
|
|
|
time_t st_ctime;
|
|
|
|
|
|
|
|
ulong st_ctimensec;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#define S_IFMT (0xffff0000ul)
|
|
|
|
#define S_IFMT 00170000
|
|
|
|
#define S_IFREG (1ul << 16)
|
|
|
|
#define S_IFSOCK 0140000
|
|
|
|
#define S_IFDIR (2ul << 16)
|
|
|
|
#define S_IFLNK 0120000
|
|
|
|
#define S_IFIFO (3ul << 16)
|
|
|
|
#define S_IFREG 0100000
|
|
|
|
#define S_IFLNK (4ul << 16)
|
|
|
|
#define S_IFBLK 0060000
|
|
|
|
#define S_IFBLK (5ul << 16)
|
|
|
|
#define S_IFDIR 0040000
|
|
|
|
|
|
|
|
#define S_IFCHR 0020000
|
|
|
|
// XXX cleanup modes/dev majors
|
|
|
|
#define S_IFIFO 0010000
|
|
|
|
#define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR)
|
|
|
|
|
|
|
|
#define S_ISDEV(mode) (MAJOR(mode) != 0)
|
|
|
|
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
|
|
|
#define S_ISFIFO(mode) ((mode & S_IFMT) == S_IFIFO)
|
|
|
|
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
|
|
|
#define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG)
|
|
|
|
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
|
|
|
#define S_ISSOCK(mode) (MAJOR(mode) == 2)
|
|
|
|
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
|
|
|
#define S_ISLNK(mode) ((mode & S_IFMT) == S_IFLNK)
|
|
|
|
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
|
|
|
#define S_ISBLK(mode) (MAJOR(mode) == S_IFBLK)
|
|
|
|
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
|
|
|
|
|
|
|
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wrj: S_ISDEV is non-standard. just guess:
|
|
|
|
|
|
|
|
#define S_ISDEV(m) (((m) & S_IFMT) == S_IFBLK \
|
|
|
|
|
|
|
|
|| ((m) & S_IFMT) == S_IFCHR \
|
|
|
|
|
|
|
|
|| ((m) & S_IFMT) == S_IFSOCK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#define S_IFMT (0xffff0000ul)
|
|
|
|
|
|
|
|
//#define S_IFREG (1ul << 16)
|
|
|
|
|
|
|
|
//#define S_IFDIR (2ul << 16)
|
|
|
|
|
|
|
|
//#define S_IFIFO (3ul << 16)
|
|
|
|
|
|
|
|
//#define S_IFLNK (4ul << 16)
|
|
|
|
|
|
|
|
//#define S_IFBLK (5ul << 16)
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//// XXX cleanup modes/dev majors
|
|
|
|
|
|
|
|
//#define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR)
|
|
|
|
|
|
|
|
//#define S_ISDEV(mode) (MAJOR(mode) != 0)
|
|
|
|
|
|
|
|
//#define S_ISFIFO(mode) ((mode & S_IFMT) == S_IFIFO)
|
|
|
|
|
|
|
|
//#define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG)
|
|
|
|
|
|
|
|
//#define S_ISSOCK(mode) (MAJOR(mode) == 2)
|
|
|
|
|
|
|
|
//#define S_ISLNK(mode) ((mode & S_IFMT) == S_IFLNK)
|
|
|
|
|
|
|
|
//#define S_ISBLK(mode) (MAJOR(mode) == S_IFBLK)
|
|
|
|
|
|
|
|
|
|
|
|
// please never use these
|
|
|
|
// please never use these
|
|
|
|
#define S_ISUID (04000)
|
|
|
|
#define S_ISUID (04000)
|
|
|
|