1fcloseall(3)               Library Functions Manual               fcloseall(3)
2
3
4

NAME

6       fcloseall - close all open streams
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #define _GNU_SOURCE         /* See feature_test_macros(7) */
13       #include <stdio.h>
14
15       int fcloseall(void);
16

DESCRIPTION

18       The  fcloseall()  function  closes  all  of  the calling process's open
19       streams.  Buffered output for each  stream  is  written  before  it  is
20       closed (as for fflush(3)); buffered input is discarded.
21
22       The standard streams, stdin, stdout, and stderr are also closed.
23

RETURN VALUE

25       This  function  returns 0 if all files were successfully closed; on er‐
26       ror, EOF is returned.
27

ATTRIBUTES

29       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
30       tributes(7).
31
32       ┌─────────────────────────────┬───────────────┬────────────────────────┐
33Interface                    Attribute     Value                  
34       ├─────────────────────────────┼───────────────┼────────────────────────┤
35fcloseall()                  │ Thread safety │ MT-Unsafe race:streams │
36       └─────────────────────────────┴───────────────┴────────────────────────┘
37
38       The  fcloseall()  function  does  not  lock  the  streams, so it is not
39       thread-safe.
40

STANDARDS

42       GNU.
43

SEE ALSO

45       close(2), fclose(3), fflush(3), fopen(3), setbuf(3)
46
47
48
49Linux man-pages 6.05              2023-07-20                      fcloseall(3)
Impressum