newlib: Regenerate autotools files
[newlib-cygwin.git] / libgloss / riscv / semihost-sys_isatty.c
blob02d8e39cbf46777b16f1dae6f79a05f66206a290
1 /*
2 * Copyright (C) 2020 Embecosm Limited
3 * SPDX-License-Identifier: BSD-2-Clause
4 */
5 #include <machine/syscall.h>
6 #include <sys/stat.h>
7 #include "semihost_syscall.h"
8 #include "semihost_fdtable.h"
10 int
11 _isatty (int file)
13 struct fdentry *fd =__get_fdentry (file);
14 long data_block[1];
16 if (fd == NULL)
17 return -1;
19 data_block[0] = fd->handle;
20 return syscall_errno (SEMIHOST_istty, data_block);