<s>
A	O
close	O
system	B-Operating_System
call	I-Operating_System
is	O
a	O
system	B-Operating_System
call	I-Operating_System
used	O
to	O
close	O
a	O
file	B-Application
descriptor	I-Application
by	O
the	O
kernel	B-Operating_System
.	O
</s>
<s>
For	O
most	O
file	B-Application
systems	I-Application
,	O
a	O
program	B-Application
terminates	O
access	O
to	O
a	O
file	B-Operating_System
in	O
a	O
filesystem	B-Application
using	O
the	O
close	O
system	B-Operating_System
call	I-Operating_System
.	O
</s>
<s>
This	O
flushes	O
file	B-Operating_System
buffers	O
,	O
updates	O
file	B-Operating_System
metadata	O
,	O
which	O
may	O
include	O
and	O
end-of-file	B-Language
indicator	O
in	O
the	O
data	O
;	O
de-allocates	O
resources	O
associated	O
with	O
the	O
file	B-Operating_System
(	O
including	O
the	O
file	B-Application
descriptor	I-Application
)	O
and	O
updates	O
the	O
system	O
wide	O
table	O
of	O
files	O
in	O
use	O
.	O
</s>
<s>
Some	O
programming	O
languages	O
maintain	O
a	O
data	B-General_Concept
structure	I-General_Concept
of	O
files	O
opened	O
by	O
their	O
runtime	B-Library
library	I-Library
and	O
may	O
close	O
when	O
the	O
program	B-Application
terminates	O
.	O
</s>
<s>
This	O
practice	O
is	O
known	O
as	O
resource	B-Application
acquisition	I-Application
is	I-Application
initialization	I-Application
(	O
RAII	B-Application
)	O
.	O
</s>
<s>
Some	O
operating	O
systems	O
will	O
invoke	O
the	O
close	O
on	O
files	O
held	O
by	O
a	O
program	B-Application
if	O
it	O
terminates	O
.	O
</s>
<s>
Some	O
operating	O
systems	O
will	O
invoke	O
the	O
close	O
syscall	B-Operating_System
as	O
part	O
of	O
an	O
operating	O
system	O
recovery	O
as	O
a	O
result	O
of	O
a	O
system	O
failure	O
.	O
</s>
<s>
The	O
function	O
returns	O
zero	O
to	O
indicate	O
the	O
file	B-Operating_System
was	O
closed	O
successfully	O
.	O
</s>
