Sync with CSRG.

This commit is contained in:
mycroft 1994-12-14 11:43:27 +00:00
parent 271a90d5c0
commit 43051b1cc6
1 changed files with 31 additions and 29 deletions

View File

@ -1,5 +1,3 @@
/* $NetBSD: stat.h,v 1.13 1994/06/30 08:05:54 cgd Exp $ */
/*- /*-
* Copyright (c) 1982, 1986, 1989, 1993 * Copyright (c) 1982, 1986, 1989, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -37,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)stat.h 8.6 (Berkeley) 3/8/94 * @(#)stat.h 8.9 (Berkeley) 8/17/94
*/ */
#ifndef _SYS_STAT_H_ #ifndef _SYS_STAT_H_
@ -47,42 +45,42 @@
#ifndef _POSIX_SOURCE #ifndef _POSIX_SOURCE
struct ostat { struct ostat {
unsigned short st_dev; /* inode's device */ u_int16_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */ ino_t st_ino; /* inode's number */
mode_t st_mode; /* inode protection mode */ mode_t st_mode; /* inode protection mode */
nlink_t st_nlink; /* number of hard links */ nlink_t st_nlink; /* number of hard links */
unsigned short st_uid; /* user ID of the file's owner */ u_int16_t st_uid; /* user ID of the file's owner */
unsigned short st_gid; /* group ID of the file's group */ u_int16_t st_gid; /* group ID of the file's group */
unsigned short st_rdev; /* device type */ u_int16_t st_rdev; /* device type */
long st_size; /* file size, in bytes */ int32_t st_size; /* file size, in bytes */
struct timespec st_atimespec; /* time of last access */ struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_mtimespec; /* time of last data modification */
struct timespec st_ctimespec; /* time of last file status change */ struct timespec st_ctimespec; /* time of last file status change */
long st_blksize; /* optimal blocksize for I/O */ int32_t st_blksize; /* optimal blocksize for I/O */
long st_blocks; /* blocks allocated for file */ int32_t st_blocks; /* blocks allocated for file */
unsigned long st_flags; /* user defined flags for file */ u_int32_t st_flags; /* user defined flags for file */
unsigned long st_gen; /* file generation number */ u_int32_t st_gen; /* file generation number */
}; };
#endif /* !_POSIX_SOURCE */ #endif /* !_POSIX_SOURCE */
struct stat { struct stat {
dev_t st_dev; /* inode's device */ dev_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */ ino_t st_ino; /* inode's number */
mode_t st_mode; /* inode protection mode */ mode_t st_mode; /* inode protection mode */
nlink_t st_nlink; /* number of hard links */ nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of the file's owner */ uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */ gid_t st_gid; /* group ID of the file's group */
dev_t st_rdev; /* device type */ dev_t st_rdev; /* device type */
struct timespec st_atimespec; /* time of last access */ struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_mtimespec; /* time of last data modification */
struct timespec st_ctimespec; /* time of last file status change */ struct timespec st_ctimespec; /* time of last file status change */
off_t st_size; /* file size, in bytes */ off_t st_size; /* file size, in bytes */
quad_t st_blocks; /* blocks allocated for file */ int64_t st_blocks; /* blocks allocated for file */
unsigned long st_blksize; /* optimal blocksize for I/O */ u_int32_t st_blksize; /* optimal blocksize for I/O */
unsigned long st_flags; /* user defined flags for file */ u_int32_t st_flags; /* user defined flags for file */
unsigned long st_gen; /* file generation number */ u_int32_t st_gen; /* file generation number */
long st_lspare; int32_t st_lspare;
quad_t st_qspare[2]; int64_t st_qspare[2];
}; };
#define st_atime st_atimespec.ts_sec #define st_atime st_atimespec.ts_sec
#define st_mtime st_mtimespec.ts_sec #define st_mtime st_mtimespec.ts_sec
@ -124,6 +122,7 @@ struct stat {
#define S_IFREG 0100000 /* regular */ #define S_IFREG 0100000 /* regular */
#define S_IFLNK 0120000 /* symbolic link */ #define S_IFLNK 0120000 /* symbolic link */
#define S_IFSOCK 0140000 /* socket */ #define S_IFSOCK 0140000 /* socket */
#define S_IFWHT 0160000 /* whiteout */
#define S_ISVTX 0001000 /* save swapped text even after use */ #define S_ISVTX 0001000 /* save swapped text even after use */
#endif #endif
@ -137,6 +136,7 @@ struct stat {
#define S_ISLNK(m) ((m & 0170000) == 0120000) /* symbolic link */ #define S_ISLNK(m) ((m & 0170000) == 0120000) /* symbolic link */
#define S_ISSOCK(m) ((m & 0170000) == 0010000 || \ #define S_ISSOCK(m) ((m & 0170000) == 0010000 || \
(m & 0170000) == 0140000) /* fifo or socket */ (m & 0170000) == 0140000) /* fifo or socket */
#define S_ISWHT(m) ((m & 0170000) == 0160000) /* whiteout */
#endif #endif
#ifndef _POSIX_SOURCE #ifndef _POSIX_SOURCE
@ -157,6 +157,7 @@ struct stat {
#define UF_NODUMP 0x00000001 /* do not dump file */ #define UF_NODUMP 0x00000001 /* do not dump file */
#define UF_IMMUTABLE 0x00000002 /* file may not be changed */ #define UF_IMMUTABLE 0x00000002 /* file may not be changed */
#define UF_APPEND 0x00000004 /* writes to file may only append */ #define UF_APPEND 0x00000004 /* writes to file may only append */
#define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */
/* /*
* Super-user changeable flags. * Super-user changeable flags.
*/ */
@ -169,6 +170,7 @@ struct stat {
/* /*
* Shorthand abbreviations of above. * Shorthand abbreviations of above.
*/ */
#define OPAQUE (UF_OPAQUE)
#define APPEND (UF_APPEND | SF_APPEND) #define APPEND (UF_APPEND | SF_APPEND)
#define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE) #define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE)
#endif #endif