Search
lxdream.org :: lxdream/test/include/sys/stat-dj.h
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/sys/stat-dj.h
changeset 185:6755a04c447f
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (15 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
nkeynes@185
     1
/* This is file STAT.H */
nkeynes@185
     2
/*
nkeynes@185
     3
** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
nkeynes@185
     4
**
nkeynes@185
     5
** This file is distributed under the terms listed in the document
nkeynes@185
     6
** "copying.dj", available from DJ Delorie at the address above.
nkeynes@185
     7
** A copy of "copying.dj" should accompany this file; if not, a copy
nkeynes@185
     8
** should be available from where this file was obtained.  This file
nkeynes@185
     9
** may not be distributed without a verbatim copy of "copying.dj".
nkeynes@185
    10
**
nkeynes@185
    11
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
nkeynes@185
    12
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
nkeynes@185
    13
*/
nkeynes@185
    14
nkeynes@185
    15
#ifndef _STAT_H_
nkeynes@185
    16
#define _STAT_H_
nkeynes@185
    17
nkeynes@185
    18
struct	stat {
nkeynes@185
    19
	short st_dev;
nkeynes@185
    20
	short st_ino;
nkeynes@185
    21
	unsigned short st_mode;
nkeynes@185
    22
	short st_nlink;
nkeynes@185
    23
	short st_uid;
nkeynes@185
    24
	short st_gid;
nkeynes@185
    25
	short st_rdev;
nkeynes@185
    26
	short st_align_for_word32;
nkeynes@185
    27
	long  st_size;
nkeynes@185
    28
	long  st_atime;
nkeynes@185
    29
	long  st_mtime;
nkeynes@185
    30
	long  st_ctime;
nkeynes@185
    31
	long  st_blksize;
nkeynes@185
    32
};
nkeynes@185
    33
nkeynes@185
    34
#define S_IFMT	0xF000	/* file type mask */
nkeynes@185
    35
#define S_IFDIR	0x4000	/* directory */
nkeynes@185
    36
#define S_IFIFO	0x1000	/* FIFO special */
nkeynes@185
    37
#define S_IFCHR	0x2000	/* character special */
nkeynes@185
    38
#define S_IFBLK	0x3000	/* block special */
nkeynes@185
    39
#define S_IFREG	0x8000	/* or just 0x0000, regular */
nkeynes@185
    40
#define S_IREAD	0x0100	/* owner may read */
nkeynes@185
    41
#define S_IWRITE 0x0080	/* owner may write */
nkeynes@185
    42
#define S_IEXEC	0x0040	/* owner may execute <directory search> */
nkeynes@185
    43
nkeynes@185
    44
#define	S_ISBLK(m)	(((m) & S_IFMT) == S_IFBLK)
nkeynes@185
    45
#define	S_ISCHR(m)	(((m) & S_IFMT) == S_IFCHR)
nkeynes@185
    46
#define	S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
nkeynes@185
    47
#define	S_ISFIFO(m)	(((m) & S_IFMT) == S_IFIFO)
nkeynes@185
    48
#define	S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
nkeynes@185
    49
nkeynes@185
    50
#ifdef __cplusplus
nkeynes@185
    51
extern "C" {
nkeynes@185
    52
#endif
nkeynes@185
    53
int stat(const char *, struct stat *);
nkeynes@185
    54
int fstat(int, struct stat *);
nkeynes@185
    55
#ifdef __cplusplus
nkeynes@185
    56
}
nkeynes@185
    57
#endif
nkeynes@185
    58
nkeynes@185
    59
#endif
.