compiler/clib: Removed unused arosc_init.h file.
[AROS.git] / compiler / clib / fclose.c
blob4fe2351330456a07eea689c50d878b9e3f90c885
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function fclose().
6 */
8 #include <proto/exec.h>
9 #include <proto/dos.h>
10 #include <stdlib.h>
11 #include <unistd.h>
12 #include "__stdio.h"
15 /*****************************************************************************
17 NAME */
18 #include <stdio.h>
20 int fclose (
22 /* SYNOPSIS */
23 FILE * stream)
25 /* FUNCTION
26 Closes a stream.
28 INPUTS
29 stream - Stream to close.
31 RESULT
32 Upon successful completion 0 is returned. Otherwise, EOF is
33 returned and the global variable errno is set to indicate the
34 error. In either case no further access to the stream is possible.
36 NOTES
37 This function must not be used in a shared library or
38 in a threaded application.
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 fopen(), open(), close()
47 INTERNALS
49 ******************************************************************************/
51 FILENODE * fn;
53 if (close(stream->fd) == -1)
54 return EOF;
56 fn = FILE2FILENODE (stream);
57 Remove ((struct Node *)fn);
59 free(fn);
61 return 0;
62 } /* fclose */