2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include "__arosc_privdata.h"
17 #include <exec/lists.h>
19 #include <proto/exec.h>
20 #include <proto/dos.h>
21 #include <aros/symbolsets.h>
22 #include <aros/debug.h>
26 int __smode2oflags(const char *mode
)
38 ret
= O_WRONLY
| O_CREAT
| O_TRUNC
;
42 ret
= O_WRONLY
| O_CREAT
| O_APPEND
;
58 ret
= O_RDWR
| (ret
& ~O_ACCMODE
);
62 if (*mode
== 'b' && !theresb
)
76 int __oflags2sflags(int omode
)
80 switch (omode
& O_ACCMODE
)
91 ret
= _STDIO_READ
| _STDIO_WRITE
;
100 ret
|= _STDIO_APPEND
;
105 int __init_stdio(void)
107 NEWLIST(&__stdio_files
);
111 !(stdin
= fdopen(STDIN_FILENO
, NULL
)) ||
112 !(stdout
= fdopen(STDOUT_FILENO
, NULL
)) ||
113 !(stderr
= fdopen(STDERR_FILENO
, NULL
))
116 SetIoErr(ERROR_NO_FREE_STORE
);
123 ADD2INIT(__init_stdio
, 5);