1 .\" Copyright (c) 1990, 1991, 1993 The Regents of the University of California.
2 .\" Copyright (c) 2015 Mariusz Zaborski <oshogbo@FreeBSD.org>
3 .\" All rights reserved.
5 .\" This code is derived from software contributed to Berkeley by
6 .\" Chris Torek and the American National Standards Committee X3,
7 .\" on Information Processing Systems.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" @(#)fclose.3 8.1 (Berkeley) 6/4/93
49 .Fn fclose "FILE *stream"
51 .Fn fdclose "FILE *stream" "int *fdp"
60 from its underlying file or set of functions.
61 If the stream was being used for output, any buffered data is written
67 function is equivalent to
69 except that it does not close the underlying file descriptor.
74 the file descriptor will be written to it.
77 argument will be different then NULL the file descriptor will be returned in it,
78 If the stream does not have an associated file descriptor,
81 This type of stream is created with functions such as
85 .Xr open_memstream 3 .
94 does not return a value.
96 Upon successful completion the
103 is returned and the global variable
105 is set to indicate the error.
111 The stream does not have an associated file descriptor.
118 functions may also fail and set
120 for any of the errors specified for
125 function may also fail and set errno for any of the errors specified for
132 functions do not handle NULL arguments in the
134 variable; this will result in a segmentation violation.
136 It makes it easier to make sure programs written under
139 This behaviour is an implementation detail, and programs should not
155 function first appeared in
160 function first appeared in