Description: Supported in GLIBC and in Solaris libc Index: icon/ipl/cfuncs/fpoll.c =================================================================== --- icon.orig/ipl/cfuncs/fpoll.c 2013-01-28 19:02:21.859991668 +0000 +++ icon/ipl/cfuncs/fpoll.c 2013-01-28 19:07:16.982669113 +0000 @@ -29,6 +29,7 @@ */ #include +#include #include /* for memset call from FD_ZERO (solaris gcc) */ #include #include @@ -58,21 +59,8 @@ msec = IntegerVal(argv[2]); } - /* check for data already in buffer */ - /* there's no legal way to do this in C; we cheat */ -#if defined(__GLIBC__) && defined(_STDIO_USES_IOSTREAM) /* new GCC library */ - if (f->_IO_read_ptr < f->_IO_read_end) + if (__fpending(f)) RetArg(1); -#elif defined(__GLIBC__) /* old GCC library */ - if (f->__bufp < f->__get_limit) - RetArg(1); -#elif defined(_FSTDIO) /* new BSD library */ - if (f->_r > 0) - RetArg(1); -#else /* old AT&T library */ - if (f->_cnt > 0) - RetArg(1); -#endif /* set up select(2) structure */ FD_ZERO(&fds); /* clear file bits */