Article View: comp.bugs.2bsd
Article #163V1.8 (selscan routine is wrong)
From: Keith Bostic
Date: Sat, 17 Oct 1987 23:33
Date: Sat, 17 Oct 1987 23:33
51 lines
1762 bytes
1762 bytes
Subject: selscan routine is wrong
Index: sys/sys_generic.c 2.10BSD
Description:
The selscan routine works erratically, at best, if UCB_NET
is defined.
Repeat-By:
Use the select(2) call.
Fix:
Apply the following patch to sys_generic.c.
*** sys_generic.c.old Sat Oct 17 15:56:15 1987
--- sys_generic.c Sat Oct 17 16:14:29 1987
***************
*** 326,338 ****
int flag;
struct file *fp;
int n = 0;
! int (*selroutine)();
!
#ifdef UCB_NET
! int soo_select(), ino_select();
! selroutine = (fp->f_type == DTYPE_SOCKET) ? soo_select : ino_select;
#else
- int ino_select();
selroutine = ino_select;
#endif
for (which = 0; which < 3; which++) {
--- 326,335 ----
int flag;
struct file *fp;
int n = 0;
! int (*selroutine)(), ino_select();
#ifdef UCB_NET
! int soo_select();
#else
selroutine = ino_select;
#endif
for (which = 0; which < 3; which++) {
***************
*** 356,361 ****
--- 353,361 ----
u.u_error = EBADF;
break;
}
+ #ifdef UCB_NET
+ selroutine = (fp->f_type == DTYPE_SOCKET) ? soo_select : ino_select;
+ #endif
if ((*selroutine)(fp, flag)) {
FD_SET(i + j, &obits[which]);
n++;
Technical Details
Message-ID:
<8710172333.AA05157@okeeffe.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!sun!decwrl!labrea!jade!ucbvax!OKEEFFE.BERKELEY.EDU!bosticShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!sun!decwrl!labrea!jade!ucbvax!OKEEFFE.BERKELEY.EDU!bostic From: bostic@OKEEFFE.BERKELEY.EDU (Keith Bostic) Newsgroups: comp.bugs.2bsd Subject: V1.8 (selscan routine is wrong) Message-ID: <8710172333.AA05157@okeeffe.Berkeley.EDU> Date: Sat, 17-Oct-87 19:33:36 EDT Article-I.D.: okeeffe.8710172333.AA05157 Posted: Sat Oct 17 19:33:36 1987 Date-Received: Sun, 18-Oct-87 22:37:17 EDT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 51