Rev 1787 | Rev 1872 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 1866 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | * @{ |
31 | * @{ |
32 | */ |
32 | */ |
33 | /** @file |
33 | /** @file |
34 | */ |
34 | */ |
35 | 35 | ||
36 | - | ||
37 | #include <io/io.h> |
36 | #include <io/io.h> |
38 | #include <io/stream.h> |
37 | #include <io/stream.h> |
39 | #include <string.h> |
38 | #include <string.h> |
40 | #include <malloc.h> |
39 | #include <malloc.h> |
41 | #include <libc.h> |
40 | #include <libc.h> |
Line 86... | Line 85... | ||
86 | async_msg(streams[1].phone, CONSOLE_PUTCHAR, ((const char *) buf)[i]); |
85 | async_msg(streams[1].phone, CONSOLE_PUTCHAR, ((const char *) buf)[i]); |
87 | 86 | ||
88 | return count; |
87 | return count; |
89 | } |
88 | } |
90 | 89 | ||
91 | - | ||
92 | static stream_t open_stdin(void) |
90 | static stream_t open_stdin(void) |
93 | { |
91 | { |
94 | stream_t stream; |
92 | stream_t stream; |
95 | 93 | ||
96 | if (console_phone < 0) { |
94 | if (console_phone < 0) { |
Line 128... | Line 126... | ||
128 | static ssize_t write_null(void *param, const void *buf, size_t count) |
126 | static ssize_t write_null(void *param, const void *buf, size_t count) |
129 | { |
127 | { |
130 | return count; |
128 | return count; |
131 | } |
129 | } |
132 | 130 | ||
133 | - | ||
134 | fd_t open(const char *fname, int flags) |
131 | fd_t open(const char *fname, int flags) |
135 | { |
132 | { |
136 | int c = 0; |
133 | int c = 0; |
137 | 134 | ||
138 | while (((streams[c].w) || (streams[c].r)) && (c < FDS)) |
135 | while (((streams[c].w) || (streams[c].r)) && (c < FDS)) |
Line 188... | Line 185... | ||
188 | if (fd >= FDS || fd < 0) |
185 | if (fd >= FDS || fd < 0) |
189 | return -1; |
186 | return -1; |
190 | return streams[fd].phone; |
187 | return streams[fd].phone; |
191 | } |
188 | } |
192 | 189 | ||
193 | - | ||
194 | /** @} |
190 | /** @} |
195 | */ |
191 | */ |