ARC: MWDT: LIB: implement _istty hook
Implement _istty hook as it is required for proper setup of STDIN/STDOUT/STDERR buffering. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
parent
cfed6428f4
commit
b84a0fe9c3
1 changed files with 14 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <syscall_handler.h>
|
||||
#include <string.h>
|
||||
#include <sys/errno_private.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
static int _stdout_hook_default(int c)
|
||||
|
@ -58,6 +59,19 @@ int _write(int fd, const char *buf, unsigned int nbytes)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* It's require to implement _isatty to have STDIN/STDOUT/STDERR buffered
|
||||
* properly.
|
||||
*/
|
||||
int _isatty(int file)
|
||||
{
|
||||
if (file == STDIN_FILENO || file == STDOUT_FILENO || file == STDERR_FILENO) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int *___errno(void)
|
||||
{
|
||||
return z_errno();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue