Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/sys_generic.c
Show First 20 Lines • Show All 1,788 Lines • ▼ Show 20 Lines | selsocket(struct socket *so, int events, struct timeval *tvp, struct thread *td) | ||||
} else | } else | ||||
asbt = -1; | asbt = -1; | ||||
seltdinit(td); | seltdinit(td); | ||||
/* | /* | ||||
* Iterate until the timeout expires or the socket becomes ready. | * Iterate until the timeout expires or the socket becomes ready. | ||||
*/ | */ | ||||
for (;;) { | for (;;) { | ||||
selfdalloc(td, NULL); | selfdalloc(td, NULL); | ||||
error = sopoll(so, events, NULL, td); | if (sopoll(so, events, NULL, td) != 0) { | ||||
/* error here is actually the ready events. */ | error = 0; | ||||
if (error) | break; | ||||
return (0); | } | ||||
error = seltdwait(td, asbt, precision); | error = seltdwait(td, asbt, precision); | ||||
if (error) | if (error) | ||||
break; | break; | ||||
} | } | ||||
seltdclear(td); | seltdclear(td); | ||||
/* XXX Duplicates ncp/smb behavior. */ | /* XXX Duplicates ncp/smb behavior. */ | ||||
if (error == ERESTART) | if (error == ERESTART) | ||||
error = 0; | error = 0; | ||||
▲ Show 20 Lines • Show All 271 Lines • Show Last 20 Lines |