xref: /freebsd/lib/libc/stdio/fcloseall.c (revision 559a218c9b257775fb249b67945fe4a05b7a6b9f)
1b62c955cSDaniel Eischen /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3d915a14eSPedro F. Giffuni  *
4b62c955cSDaniel Eischen  * Copyright (C) 2006 Daniel M. Eischen.  All rights reserved.
5b62c955cSDaniel Eischen  *
6b62c955cSDaniel Eischen  * Redistribution and use in source and binary forms, with or without
7b62c955cSDaniel Eischen  * modification, are permitted provided that the following conditions
8b62c955cSDaniel Eischen  * are met:
9b62c955cSDaniel Eischen  * 1. Redistributions of source code must retain the above copyright
10b62c955cSDaniel Eischen  *    notice, this list of conditions and the following disclaimer.
11b62c955cSDaniel Eischen  * 2. Redistributions in binary form must reproduce the above copyright
12b62c955cSDaniel Eischen  *    notice, this list of conditions and the following disclaimer in the
13b62c955cSDaniel Eischen  *    documentation and/or other materials provided with the distribution.
14b62c955cSDaniel Eischen  *
15b62c955cSDaniel Eischen  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16b62c955cSDaniel Eischen  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17b62c955cSDaniel Eischen  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18b62c955cSDaniel Eischen  * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
19b62c955cSDaniel Eischen  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20b62c955cSDaniel Eischen  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21b62c955cSDaniel Eischen  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22b62c955cSDaniel Eischen  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23b62c955cSDaniel Eischen  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24b62c955cSDaniel Eischen  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25b62c955cSDaniel Eischen  * SUCH DAMAGE.
26b62c955cSDaniel Eischen  */
27b62c955cSDaniel Eischen 
28b62c955cSDaniel Eischen #include <stdio.h>
29b62c955cSDaniel Eischen #include "local.h"
30b62c955cSDaniel Eischen 
31babd6608SDaniel Eischen __weak_reference(__fcloseall, fcloseall);
32b62c955cSDaniel Eischen 
33b62c955cSDaniel Eischen void
__fcloseall(void)34b62c955cSDaniel Eischen __fcloseall(void)
35b62c955cSDaniel Eischen {
36b62c955cSDaniel Eischen 
37b62c955cSDaniel Eischen 	(void)_fwalk(fclose);
38b62c955cSDaniel Eischen }
39