Don't call ReadArgs() if started from WB.
[tangerine.git] / compiler / clib / fclose.c
blob4c3abdd5ee8ad702be43b765f5ac6ddbb80e6434
1 /*
2 Copyright © 1995-2003, 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 <errno.h>
13 #include "__errno.h"
14 #include "__stdio.h"
17 /*****************************************************************************
19 NAME */
20 #include <stdio.h>
22 int fclose (
24 /* SYNOPSIS */
25 FILE * stream)
27 /* FUNCTION
28 Closes a stream.
30 INPUTS
31 stream - Stream to close.
33 RESULT
34 Upon successful completion 0 is returned. Otherwise, EOF is
35 returned and the global variable errno is set to indicate the
36 error. In either case no further access to the stream is possible.
38 NOTES
39 This function must not be used in a shared library or
40 in a threaded application.
42 EXAMPLE
44 BUGS
46 SEE ALSO
47 fopen(), open(), close()
49 INTERNALS
51 ******************************************************************************/
53 FILENODE * fn;
54 AROS_GET_SYSBASE_OK
56 if (close(stream->fd) == -1)
57 return EOF;
59 fn = FILE2FILENODE (stream);
60 Remove ((struct Node *)fn);
62 free(fn);
64 return 0;
65 } /* fclose */