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:
Evgeniy Paltsev 2021-08-05 19:41:37 +03:00 committed by Kumar Gala
commit b84a0fe9c3

View file

@ -10,6 +10,7 @@
#include <syscall_handler.h> #include <syscall_handler.h>
#include <string.h> #include <string.h>
#include <sys/errno_private.h> #include <sys/errno_private.h>
#include <unistd.h>
#include <errno.h> #include <errno.h>
static int _stdout_hook_default(int c) static int _stdout_hook_default(int c)
@ -58,6 +59,19 @@ int _write(int fd, const char *buf, unsigned int nbytes)
} }
#endif #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) int *___errno(void)
{ {
return z_errno(); return z_errno();