Merge pull request #1162 from armink/fix_libc
[libc] Add libc_stdio_get_console .
This commit is contained in:
commit
15e7342745
|
@ -31,6 +31,7 @@
|
|||
int libc_system_init(void);
|
||||
|
||||
int libc_stdio_set_console(const char* device_name, int mode);
|
||||
int libc_stdio_get_console(void);
|
||||
int libc_stdio_read (void *buffer, size_t size);
|
||||
int libc_stdio_write(const void *buffer, size_t size);
|
||||
|
||||
|
|
|
@ -58,6 +58,11 @@ int libc_stdio_set_console(const char* device_name, int mode)
|
|||
return std_fd;
|
||||
}
|
||||
|
||||
int libc_stdio_get_console(void)
|
||||
{
|
||||
return std_fd;
|
||||
}
|
||||
|
||||
int libc_stdio_read(void *buffer, size_t size)
|
||||
{
|
||||
return read(std_fd, buffer, size);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
int libc_system_init(void);
|
||||
|
||||
int libc_stdio_set_console(const char* device_name, int mode);
|
||||
int libc_stdio_get_console(void);
|
||||
int libc_stdio_read (void *buffer, size_t size);
|
||||
int libc_stdio_write(const void *buffer, size_t size);
|
||||
|
||||
|
|
|
@ -58,6 +58,10 @@ int libc_stdio_set_console(const char* device_name, int mode)
|
|||
return std_fd;
|
||||
}
|
||||
|
||||
int libc_stdio_get_console(void) {
|
||||
return std_fd;
|
||||
}
|
||||
|
||||
int libc_stdio_read(void *buffer, size_t size)
|
||||
{
|
||||
return read(std_fd, buffer, size);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
int libc_system_init(void);
|
||||
int libc_stdio_set_console(const char* device_name, int mode);
|
||||
int libc_stdio_get_console(void);
|
||||
|
||||
/* some time related function */
|
||||
int libc_set_time(const struct timespec *time);
|
||||
|
|
|
@ -83,3 +83,10 @@ int libc_stdio_set_console(const char* device_name, int mode)
|
|||
|
||||
return fileno(std_console);
|
||||
}
|
||||
|
||||
int libc_stdio_get_console(void) {
|
||||
if (std_console)
|
||||
return fileno(std_console);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue