#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; | |
} |