mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-15 19:09:58 +08:00
8ee939ea9f
* libc/sys/linux/bits/dirent.h: New header file. * libc/sys/linux/sys/dirent.h: Include <bits/dirent.h> instead of <linux/dirent.h>. * libc/posix/Makefile.am: Remove reallocf. * libc/posix/Makefile.in: Regenerated. * libc/posix/reallocf.c: Moved to... * libc/stdlib/reallocf.c: Here * libc/stdlib/malloc.c: Add reallocf documentation. * libc/include/stdlib.h: Add reallocf and _reallocf_r prototypes. * libc/stdlib/Makefile.am: Add reallocf. * libc/stdlib/Makefile.in: Regenerated. * libc/posix/_isatty.c: Set errno.
22 lines
315 B
C
22 lines
315 B
C
/* isatty.c */
|
|
|
|
/* Dumb implementation so programs will at least run. */
|
|
|
|
#include <sys/stat.h>
|
|
#include <errno.h>
|
|
|
|
int
|
|
_DEFUN(_isatty, (fd), int fd)
|
|
{
|
|
struct stat buf;
|
|
|
|
if (fstat (fd, &buf) < 0) {
|
|
errno = EBADF;
|
|
return 0;
|
|
}
|
|
if (S_ISCHR (buf.st_mode))
|
|
return 1;
|
|
errno = ENOTTY;
|
|
return 0;
|
|
}
|