int select(int nfd, fd_set *rfd, fd_set *wfd, fd_set *efd, struct timeval *timeout)
{
- long long int ltimeout = 0, *ltimeoutp = NULL;
+ int64_t ltimeout = 0, *ltimeoutp = NULL;
if( timeout )
{
ltimeout = timeout->tv_sec*1000 + timeout->tv_usec / 1000;
return ENOTIMPL;
}
+
+int isatty(int fd)
+{
+ if( fd < 0 ) {
+ errno = EBADF;
+ return 0;
+ }
+
+ int type = _SysIOCtl(fd, DRV_IOCTL_TYPE, NULL);
+ if( type == -1 )
+ return 0;
+ if( type != DRV_TYPE_TERMINAL ) {
+ errno = ENOTTY;
+ // NOTE: Pre POSIX 2001, EINVAL was returned
+ return 0;
+ }
+ return 1;
+}