 |
» |
|
|
 |
NAMEstat: stat.h — data returned by the stat() function DESCRIPTIONThe
<sys/stat.h>
header defines the structure of the
data returned by the functions
fstat(),
lstat(),
and
stat().
The structure
stat
contains at least the following members: File serial number and device ID taken together
uniquely identify the file within the system. The
dev_t,
ino_t,
mode_t,
nlink_t,
uid_t,
gid_t,
off_t,
and
time_t
types are defined as described in
<sys/types.h>.
Times are given in seconds since the Epoch. The following symbolic names for the values of
st_mode
are also defined: File type File mode bits The bits defined by
S_IRUSR,
S_IWUSR,
S_IXUSR,
S_IRGRP,
S_IWGRP,
S_IXGRP,
S_IROTH,
S_IWOTH,
S_IXOTH,
S_ISUID,
S_ISGlD
and
S_ISVTX
are unique.
S_IRWXU
is the bitwise OR of
S_IRUSR,
S_IWUSR,
and
S_IXUSR.
S_IRWXG
is the bitwise OR of
S_IRGRP,
S_IWGRP,
and
S_IXGRP.
S_IRWXO
is the bitwise OR of
S_IROTH,
S_IWOTH,
and
S_IXOTH. Implementations may OR other implementation-dependent bits into
S_IRWXU,
S_IRWXG,
and
S_IRWXO,
but they will not overlap any of the other bits
defined in this document. The file permission bits
are defined to be those corresponding to the bitwise
inclusive OR of
S_IRWXU,
S_IRWXG,
and
S_IRWXO. The following macros will test whether a file is of
the specified type. The value
m
supplied to the macros is the value of
st_mode
from a
stat
structure. The macro evaluates to a non-zero value
if the test is true, 0 if the test is false. The following are declared as functions and may also
be defined as macros: APPLICATION USAGEUse of the macros is recommended for determining the type of a file. CHANGE HISTORYFirst released in Issue 1. Derived from Issue 1 of the SVID. Issue 4The following changes are incorporated for alignment with the
ISO POSIX-1 standard:
The function declarations in this header are expanded to full
ISO C prototypes. The DESCRIPTION section is expanded to indicate (a) how files
are uniquely identified within the system, (b) that times are given
in units of seconds since the Epoch, (c) rules governing
the definition and use of the file mode bits,
and (d) usage of the file type test macros.
Other changes are incorporated as follows:
Reference to the header
<sys/types.h>
is added for the definitions of
dev_t,
ino_t,
mode_t,
nlink_t,
uid_t,
gid_t,
off_t,
and
time_t.
This has been marked as an extension. References to the
S_IREAD,
S_IWRITE,
S_IEXEC
file and
S_ISVTX
modes are removed. The descriptions of the members of the
stat
structure in the
DESCRIPTION
section are corrected.
Issue 4, Version 2The following changes are incorporated for X/OPEN UNIX conformance:
The
st_blksize
and
st_blocks
members are added to the
stat
structure. The
S_IFLINK
value of
S_IFMT
is defined. The
S_ISVTX
file mode bit and the
S_ISLNK
file type test macro is defined. The
fchmod(),
lstat(),
and
mknod()
functions are added to the list of functions declared in this header.
NAME (HP-UX)stat.h - file-specific information DESCRIPTIONThe contents of the
stat
structure include the following members: - ushort st_fstype;
/*Type of filesystem this file */ /* is in; see vfsmount(2) */ - dev_t#st_realdev;
/* Real device number of device */ /* containing the inode for this file */
The following symbolic names for the values of the
st_mode
field are defined as indicated: File type File mode bits: miscellaneous File mode bits: permissions File mode bits: obsolete permission names File type test macros SEE ALSOchmod(2),
chown(2),
link(2),
mkdir(2),
mknod(2),
stat(2),
symlink(2),
umask(2),
utime(2),
mkfifo(3C),
types(5). STANDARDS CONFORMANCE<sys/stat.h>: AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
|