<s>
is	O
a	O
Unix	B-Application
system	I-Application
call	O
that	O
returns	O
file	B-Application
attributes	I-Application
about	O
an	O
inode	B-Application
.	O
</s>
<s>
The	O
semantics	O
of	O
vary	O
between	O
operating	B-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
As	O
an	O
example	O
,	O
Unix	B-Application
command	O
uses	O
this	O
system	B-Operating_System
call	I-Operating_System
to	O
retrieve	O
information	O
on	O
files	O
that	O
includes	O
:	O
</s>
<s>
stat	B-Language
appeared	O
in	O
Version	O
1	O
Unix	B-Application
.	O
</s>
<s>
It	O
is	O
among	O
the	O
few	O
original	O
Unix	B-Application
system	I-Application
calls	O
to	O
change	O
,	O
with	O
Version	O
4	O
's	O
addition	O
of	O
group	O
permissions	O
and	O
larger	O
file	B-General_Concept
size	I-General_Concept
.	O
</s>
<s>
The	O
C	B-Language
POSIX	I-Language
library	I-Language
header	O
,	O
found	O
on	O
POSIX	O
and	O
other	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
declares	O
the	O
stat( )	O
functions	O
,	O
as	O
well	O
as	O
related	O
functions	O
called	O
fstat( )	O
and	O
lstat( )	O
.	O
</s>
<s>
The	O
functions	O
take	O
a	O
struct	O
stat	B-Language
buffer	O
argument	O
,	O
which	O
is	O
used	O
to	O
return	O
the	O
file	B-Application
attributes	I-Application
.	O
</s>
<s>
On	O
success	O
,	O
the	O
functions	O
return	O
zero	O
,	O
and	O
on	O
error	O
,	O
−1	O
is	O
returned	O
and	O
errno	B-Error_Name
is	O
set	O
appropriately	O
.	O
</s>
<s>
The	O
stat( )	O
and	O
lstat( )	O
functions	O
take	O
a	O
filename	B-Device
argument	O
.	O
</s>
<s>
If	O
the	O
file	O
is	O
a	O
symbolic	B-Application
link	I-Application
,	O
stat( )	O
returns	O
attributes	O
of	O
the	O
eventual	O
target	O
of	O
the	O
link	O
,	O
while	O
lstat( )	O
returns	O
attributes	O
of	O
the	O
link	O
itself	O
.	O
</s>
<s>
The	O
fstat( )	O
function	O
takes	O
a	O
file	B-Application
descriptor	I-Application
argument	O
instead	O
,	O
and	O
returns	O
attributes	O
of	O
the	O
file	O
that	O
it	O
identifies	O
.	O
</s>
<s>
The	O
family	O
of	O
functions	O
was	O
extended	O
to	O
implement	O
large	B-Application
file	I-Application
support	I-Application
.	O
</s>
<s>
Functions	O
named	O
stat64( )	O
,	O
lstat64( )	O
and	O
fstat64( )	O
return	O
attributes	O
in	O
a	O
struct	O
stat64	O
structure	O
,	O
which	O
represents	O
file	B-General_Concept
sizes	I-General_Concept
with	O
a	O
64-bit	O
type	O
,	O
allowing	O
the	O
functions	O
to	O
work	O
on	O
files	O
2GiB	O
and	O
larger	O
(	O
up	O
to	O
8EiB	O
)	O
.	O
</s>
<s>
When	O
the	O
_FILE_OFFSET_BITS	O
macro	B-Language
is	O
defined	O
to	O
64	O
,	O
these	O
64-bit	O
functions	O
are	O
available	O
under	O
the	O
original	O
names	O
.	O
</s>
<s>
POSIX.1	O
does	O
not	O
require	O
st_rdev	O
,	O
st_blocks	O
and	O
st_blksize	O
members	O
;	O
these	O
fields	O
are	O
defined	O
as	O
part	O
of	O
XSI	O
option	O
in	O
the	O
Single	O
Unix	B-Application
Specification	O
.	O
</s>
<s>
The	O
struct	O
stat	B-Language
structure	O
includes	O
at	O
least	O
the	O
following	O
members	O
:	O
</s>
<s>
It	O
combines	O
the	O
file	O
access	O
modes	O
and	O
also	O
indicates	O
any	O
special	B-Application
file	I-Application
type	I-Application
.	O
</s>
<s>
Linux	B-Operating_System
kernel	I-Operating_System
developer	O
Ingo	O
Molnár	O
publicly	O
criticized	O
the	O
concept	O
and	O
performance	O
impact	O
of	O
atime	O
in	O
2007	O
,	O
and	O
in	O
2009	O
,	O
the	O
mount	B-Device
option	O
had	O
become	O
the	O
default	O
,	O
which	O
addresses	O
this	O
criticism	O
.	O
</s>
<s>
The	O
behavior	O
behind	O
the	O
mount	B-Device
option	O
offers	O
sufficient	O
performance	O
for	O
most	O
purposes	O
and	O
should	O
not	O
break	O
any	O
significant	O
applications	O
,	O
as	O
it	O
has	O
been	O
extensively	O
discussed	O
.	O
</s>
<s>
Current	O
versions	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
support	O
four	O
mount	B-Device
options	O
,	O
which	O
can	O
be	O
specified	O
in	O
fstab	B-Protocol
:	O
</s>
<s>
Current	O
versions	O
of	O
Linux	B-Application
,	O
macOS	B-Application
,	O
Solaris	B-Application
,	O
FreeBSD	B-Operating_System
,	O
and	O
NetBSD	B-Device
support	O
a	O
mount	B-Device
option	O
in	O
/etc/fstab	B-Protocol
,	O
which	O
causes	O
the	O
atime	O
field	O
never	O
to	O
be	O
updated	O
.	O
</s>
<s>
Turning	O
off	O
atime	O
updating	O
breaks	O
POSIX	O
compliance	O
,	O
and	O
some	O
applications	O
,	O
such	O
as	O
mbox-driven	O
"	O
new	O
mail	O
"	O
notifications	O
,	O
and	O
some	O
file	O
usage	O
watching	O
utilities	O
,	O
notably	O
tmpwatch	O
.	O
</s>
<s>
The	O
option	O
on	O
OpenBSD	B-Operating_System
behaves	O
more	O
like	O
Linux	B-Application
.	O
</s>
<s>
Version	O
4.0	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
mainline	O
,	O
which	O
was	O
released	O
on	O
April	O
12	O
,	O
2015	O
,	O
introduced	O
the	O
new	O
mount	B-Device
option	O
.	O
</s>
<s>
It	O
allows	O
POSIX-style	O
atime	O
updates	O
to	O
be	O
performed	O
in-memory	O
and	O
flushed	O
to	O
disk	O
together	O
with	O
some	O
non-time-related	O
I/O	O
operations	O
on	O
the	O
same	O
file	O
;	O
atime	O
updates	O
are	O
also	O
flushed	O
to	O
disk	O
when	O
some	O
of	O
the	O
sync	B-Language
system	B-Operating_System
calls	I-Operating_System
are	O
executed	O
,	O
or	O
before	O
the	O
file	O
's	O
in-memory	O
inode	B-Application
is	O
evicted	O
from	O
the	O
filesystem	O
cache	O
.	O
</s>
<s>
It	O
is	O
tempting	O
to	O
believe	O
that	O
originally	O
meant	O
creation	O
time	O
;	O
however	O
,	O
while	O
early	O
Unix	B-Application
did	O
have	O
modification	O
and	O
creation	O
times	O
,	O
the	O
latter	O
was	O
changed	O
to	O
be	O
access	O
time	O
before	O
there	O
was	O
any	O
C	O
structure	O
in	O
which	O
to	O
call	O
anything	O
.	O
</s>
<s>
The	O
file	O
systems	O
retained	O
just	O
the	O
access	O
time	O
(	O
)	O
and	O
modification	O
time	O
(	O
)	O
through	O
6th	O
edition	O
Unix	B-Application
.	O
</s>
<s>
The	O
timestamp	O
was	O
added	O
in	O
the	O
file	O
system	O
restructuring	O
that	O
occurred	O
with	O
7th	O
edition	O
Unix	B-Application
,	O
and	O
has	O
always	O
referred	O
to	O
inode	B-Application
change	O
time	O
.	O
</s>
<s>
It	O
is	O
updated	O
any	O
time	O
file	O
metadata	O
stored	O
in	O
the	O
inode	B-Application
changes	O
,	O
such	O
as	O
file	B-Application
permissions	I-Application
,	O
file	B-Device
ownership	I-Device
,	O
and	O
creation	B-Application
and	I-Application
deletion	I-Application
of	I-Application
hard	I-Application
links	I-Application
.	O
</s>
<s>
In	O
some	O
implementations	O
,	O
is	O
affected	O
by	O
renaming	O
a	O
file	O
:	O
Both	O
original	O
Unix	B-Application
,	O
which	O
implemented	O
a	O
renaming	O
by	O
making	O
a	O
link	O
(	O
updating	O
)	O
and	O
then	O
unlinking	O
the	O
old	O
name	O
(	O
updating	O
again	O
)	O
and	O
modern	O
Linux	B-Application
tend	O
to	O
do	O
this	O
.	O
</s>
<s>
Solaris	B-Application
2.1	O
introduced	O
a	O
microsecond	O
resolution	O
with	O
UFS	O
in	O
1992	O
and	O
a	O
nanosecond	O
resolution	O
with	O
ZFS	O
.	O
</s>
<s>
In	O
Linux	B-Operating_System
kernels	I-Operating_System
2.5.48	O
and	O
above	O
,	O
the	O
stat	B-Language
structure	O
supports	O
nanosecond	O
resolution	O
for	O
the	O
three	O
file	O
timestamp	O
fields	O
.	O
</s>
<s>
These	O
are	O
exposed	O
as	O
additional	O
fields	O
in	O
the	O
stat	B-Language
structure	O
.	O
</s>
<s>
The	O
resolution	O
of	O
create	O
time	O
on	O
FAT	B-Application
filesystem	I-Application
is	O
10milliseconds	O
,	O
while	O
resolution	O
of	O
its	O
write	O
time	O
is	O
two	O
seconds	O
,	O
and	O
access	O
time	O
has	O
a	O
resolution	O
of	O
one	O
day	O
thus	O
it	O
acts	O
as	O
the	O
access	O
date	O
.	O
</s>
