Mail Archives: djgpp/1999/03/08/19:37:05
Hello again,
sorry, the last patch was not enough. Here's the next try:
*** src/libc/compat/time/select.c.orig Sun Sep 27 15:18:24 1998
--- src/libc/compat/time/select.c Tue Mar 9 00:45:21 1999
***************
*** 47,54 ****
if (fp->_cnt)
return 1;
! /* The `feof' part is only correct in a single-tasked environment. */
! if (ferror (fp) || feof (fp))
return 0;
/* There is nothing in the buffer (perhaps because we read unbuffered).
--- 47,53 ----
if (fp->_cnt)
return 1;
! if (ferror (fp))
return 0;
/* There is nothing in the buffer (perhaps because we read unbuffered).
***************
*** 83,88 ****
--- 82,101 ----
{
__dpmi_regs regs;
+
+ /* If it's a disk file, always return 1, since according to Un*x
+ semantics, select() returns ``ready'' at EOF (and before EOF,
+ anyway). */
+ regs.x.ax = 0x4400;
+ regs.x.bx = fd;
+ __dpmi_int (0x21, ®s);
+ if (regs.x.flags & 1)
+ {
+ errno = __doserr_to_errno (regs.x.ax);
+ return -1;
+ }
+ if (!(regs.x.dx & 0x80))
+ return 1;
regs.x.ax = 0x4406;
regs.x.bx = fd;
- Raw text -