2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 ANSI function freopen().
13 /*****************************************************************************
27 Opens the file whose name is the string pointed to by path and
28 associates the stream pointed to by stream with it.
31 path - the file to open
32 mode - The mode of the stream (same as with fopen()) must be com
33 patible with the mode of the file descriptor. The file
34 position indicator of the new stream is set to that
35 belonging to fildes, and the error and end-of-file indica
36 tors are cleared. Modes "w" or "w+" do not cause trunca
37 tion of the file. The file descriptor is not dup'ed, and
38 will be closed when the stream created by fdopen is
40 stream - the stream to wich the file will be associated.
43 NULL on error or stream.
52 open(), fclose(), fileno()
56 ******************************************************************************/
60 if (!(path
&& mode
&& stream
))
66 oflags
= __smode2oflags(mode
);
67 fd
= __open(stream
->fd
, path
, oflags
, 644);
72 stream
->flags
= __oflags2sflags(oflags
);