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
;
55 else if (*mode
== 't')
57 // Silently ignore 't' (=text).
58 // It's deprecated, but it's still in some sources,
59 // and on other platforms they can compiled without problems.
65 ret
= O_RDWR
| (ret
& ~O_ACCMODE
);
69 if (*mode
== 'b' && !theresb
)
83 int __oflags2sflags(int omode
)
87 switch (omode
& O_ACCMODE
)
98 ret
= _STDIO_READ
| _STDIO_WRITE
;
106 if (omode
& O_APPEND
)
107 ret
|= _STDIO_APPEND
;
112 int __init_stdio(void)
114 NEWLIST(&__stdio_files
);
118 !(stdin
= fdopen(STDIN_FILENO
, NULL
)) ||
119 !(stdout
= fdopen(STDOUT_FILENO
, NULL
)) ||
120 !(stderr
= fdopen(STDERR_FILENO
, NULL
))
123 SetIoErr(ERROR_NO_FREE_STORE
);
130 ADD2INIT(__init_stdio
, 5);