blob: 2dc731dff459213007b2f8d61deb29142130a8b5 [file] [log] [blame] [raw]
#include <windows.h>
#include <errno.h>
int isatty(int fd) {
if(fd == -1) {
errno = EBADF;
return 0;
}
if(GetFileSize((void *)fd, NULL) == 0xffffffff) {
if(GetLastError() == ERROR_INVALID_FUNCTION) {
SetLastError(0);
return 1;
}
return 0;
}
errno = ENOTTY;
return 0;
}