Date: Tue, 19 Mar 1996 13:27:02 +1030 From: Michael Smith <msmith@atrad.adelaide.edu.au> To: FreeBSD-gnats-submit@freebsd.org Subject: docs/1089: stat manpage unclear about st_mtime & friends Message-ID: <199603190257.NAA28024@genesis.atrad.adelaide.edu.au> Resent-Message-ID: <199603190340.TAA29196@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 1089
>Category: docs
>Synopsis: stat manpage unclear about st_mtime & friends
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 18 19:40:02 PST 1996
>Last-Modified:
>Originator: Michael Smith
>Organization:
Genesis Software
>Release: FreeBSD 2.1-STABLE i386 (and all up to -current)
>Environment:
stat(2) manpage.
>Description:
Consider this portion of the stat(2) manapage (trimmed):
struct stat {
...
struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */
struct timespec st_ctimespec; /* time of last file status change */
...
};
The time-related fields of struct stat are as follows:
st_atime Time when file data last accessed. Changed by the mknod(2),
...
st_mtime Time when file data last modified. Changed by the mknod(2),
...
st_ctime Time when file status was last changed (inode data modifica-
...
It should be mentioned that the names 'st_atime' 'st_mtime' and 'st_ctime'
are compatability macros which referece the ts_sec fields in the timespec
structs for each of the three.
>How-To-Repeat:
None
>Fix:
The time-related fields of struct stat are as follows:
st_atimespec Time when file data last accessed. Changed by the mknod(2),
utimes(2) and read(2) system calls.
st_mtimespec Time when file data last modified. Changed by the mknod(2),
utimes(2) and write(2) system calls.
st_ctimespec Time when file status was last changed (inode data modifica-
tion). Changed by the chmod(2), chown(2), link(2),
mknod(2), rename(2), unlink(2), utimes(2) and write(2)
system calls.
The names 'st_atime', 'st_mtime' and 'st_ctime' are supported for
compatability's sake via preprocessor macros which reference the
ts_sec fields of the corresponding timestruct.
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603190257.NAA28024>
