From: ts Date: 2002-01-31T01:25:40+09:00 Subject: Re: popen3 and buffering >>>>> "P" == Paul Brannan writes: P> Curious as to how to get around the problem, I started to dig into io.c. P> Both read() and sysread() call READ_DATA_PENDING, which is a macro that P> expands to ReadDataPending. But where is ReadDataPending defined? It depend of your system #ifdef _STDIO_USES_IOSTREAM /* GNU libc */ # ifdef _IO_fpos_t # define READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end) # else # define READ_DATA_PENDING(fp) ((fp)->_gptr < (fp)->_egptr) # endif #elif defined(FILE_COUNT) # define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0) #elif defined(__BEOS__) # define READ_DATA_PENDING(fp) (fp->_state._eof == 0) #else /* requires systems own version of the ReadDataPending() */ extern int ReadDataPending(); # define READ_DATA_PENDING(fp) ReadDataPending(fp) #endif Guy Decoux