home *** CD-ROM | disk | FTP | other *** search
- /* H.Stat: Header file for stat call */
-
- #ifndef __sys_stat
- #define __sys_stat
-
- #include <time.h>
-
- /* ARM System time format */
-
- #ifndef __TIME_h
- #define __TIME_h
- typedef struct
- {
- unsigned char t[5]; /* Low byte first - ie. t[0] is low */
- }
- TIME;
- #endif
-
- /* File length/offset type */
-
- #ifndef __off_t_h
- #define __off_t_h
- typedef unsigned int off_t;
- #endif
-
- struct stat
- {
- /* Unix equivalent fields */
- unsigned short st_mode; /* mode bits */
- short st_nlink; /* number of links to file */
- short st_uid; /* user id of owner ( = 0 ) */
- short st_gid; /* group id of owner ( = 0 ) */
- off_t st_size; /* file size in characters */
- time_t st_mtime; /* time file last written or created */
- /* Arm file attribute details */
- unsigned char st_stamp; /* is the file timestamped? */
- unsigned int st_load; /* load address */
- unsigned int st_exec; /* execution address */
- unsigned short st_type; /* file type */
- unsigned char st_attribs; /* file attributes */
- TIME st_time; /* time stamp (Arm format) */
- };
-
- /* Parts of st_mode field */
-
- #define S_IFMT 0170000 /* type of file */
- #define S_IFDIR 0040000 /* directory */
- #define S_IFREG 0100000 /* regular */
- #define S_IREAD 0000400 /* read permission, owner */
- #define S_IWRITE 0000200 /* write permission, owner */
- #define S_IEXEC 0000100 /* execute permission, owner */
-
- /* Parts of st_attribs field */
-
- #define S_AREAD 0x01 /* Read access for user */
- #define S_AWRITE 0x02 /* Write access for user */
- #define S_ALOCK 0x08 /* File is locked */
-
- extern int stat (char *name, struct stat *buf);
- extern int set_stat (char *name, struct stat *buf);
-
- #endif
-