Article View: comp.bugs.2bsd
Article #176Re: select() problems with 2.10 BSD
From: Casey Leedom
Date: Mon, 11 Jan 1988 17:54
Date: Mon, 11 Jan 1988 17:54
64 lines
2299 bytes
2299 bytes
In article <1756@rayssd.RAY.COM> gmp@rayssd.RAY.COM (Gregory M. Paris) writes:
> Is anybody else having problems with select on 2.10 BSD? ... Select
> reports [in inetd] that all are ready for reading, yet none are. This
> causes inetd to hang in accept forever.
Keith posted a fix to selscan which may be causing your problem. Since
the fix was so short I'll repeat it here. (Keith, Do we have an archive site
for 2.10BSD bug postings that people can get to anonymously?)
Casey
This is 2.10BSD bug posting V1/8:
-----
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:
<2722@lll-winken.llnl.gov>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!mcnc!ncsuvx!lll-winken!lll-crg.llnl.gov!caseyReferences:
<1756@rayssd.RAY.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!mcnc!ncsuvx!lll-winken!lll-crg.llnl.gov!casey From: casey@lll-crg.llnl.gov (Casey Leedom) Newsgroups: comp.bugs.2bsd Subject: Re: select() problems with 2.10 BSD Keywords: inetd, select, socket, accept, hang, help! Message-ID: <2722@lll-winken.llnl.gov> Date: 11 Jan 88 17:54:54 GMT References: <1756@rayssd.RAY.COM> Sender: usenet@lll-winken.llnl.gov Reply-To: casey@lll-crg.llnl.gov.UUCP (Casey Leedom) Organization: Lawrence Livermore National Laboratory Lines: 63