Nonblocking sockets no longer raise a continuable exception when a

read or write operation would block.  Instead, they are schedules
with an event handler that `selects' on the pending file descriptors
and dispatches the appropriate callback.
This commit is contained in:
Abdulaziz Ghuloum
2008-03-23 02:14:00 -04:00
parent 6e599c4c72
commit 9aaf306f16
4 changed files with 127 additions and 23 deletions
+12
View File
@@ -201,6 +201,18 @@ ikrt_make_fd_nonblocking(ikptr fdptr, ikpcb* pcb){
return 0;
}
ikptr
ikrt_select(ikptr fds, ikptr rfds, ikptr wfds, ikptr xfds, ikpcb* pcb){
int rv = select(unfix(fds),
(fd_set*)(rfds + off_bytevector_data),
(fd_set*)(wfds + off_bytevector_data),
(fd_set*)(xfds + off_bytevector_data),
NULL);
if(rv < 0){
return ikrt_io_error();
}
return fix(rv);
}
ikptr
ikrt_file_ctime(ikptr filename, ikptr res){