From: Godmar Back (gback@cs.utah.edu)
Date: Thu Feb 11 1999 - 17:08:57 EST
Tim,
Two things:
First, I don't understand the change you made to jthread.c.
intsDisable();
for (;;) {
r = read(fd, buf, len);
if (r >= 0 || !(errno == EWOULDBLOCK || errno == EINTR
|| errno == EAGAIN)) {
break; /* real error or success */
}
if (errno == EINTR) {
/* ignore */
continue;
}
else if (errno = EAGAIN) {
/* ignore - go back to sleep */
}
else if (haveBlocked) {
errno = EINTR;
break;
}
blockOnFile(fd, TH_READ, timeout);
haveBlocked++;
}
if (r == -1) {
r = errno;
} else {
*out = r;
r = 0;
}
intsRestore();
By doing so, you will not return if you time out and still can't
read any data. Note that on most architectures, EAGAIN == EWOULDBLOCK.
What problem are trying to fix?
Second, the SoTimeout test segfaults for me. I'll check it out.
- Godmar
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:58:06 EDT