initial import
[glibc.git] / sysdeps / stub / defs.c
blob56d1871e52ea5e2ac23cec2f2c555db39d958708
1 /* Definitions of global stdio data structures.
3 Copyright (C) 1991 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If
18 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19 Cambridge, MA 02139, USA. */
21 #include <ansidecl.h>
22 #include <stdio.h>
24 /* This file should define the following
25 variables as appropriate for the system. */
27 FILE *stdin, *stdout, *stderr;
29 /* Pointer to the first stream in the list. */
30 FILE *__stdio_head;
32 /* This function MUST be in this file!
33 This is because we want _cleanup to go into the __libc_atexit set
34 when any stdio code is used (and to use any stdio code, one must reference
35 something defined in this file), and since only local symbols can be made
36 set elements, having the set element stab entry here and _cleanup elsewhere
37 loses; and having them both elsewhere loses because there is no reference
38 to cause _cleanup to be linked in. */
40 void
41 DEFUN_VOID(_cleanup)
43 (void) fclose((FILE *) NULL);
47 #ifdef HAVE_GNU_LD
48 #include <gnu-stabs.h>
50 text_set_element(__libc_atexit, _cleanup);
51 #endif