TimedIO: module { PATH: con "/dis/lib/timedio.dis"; TIMEOUT: con -6; read: fn( fd: ref Sys->FD, buf: array of byte, nbytes: int, timeout: int) :int; write: fn( fd: ref Sys->FD, buf: array of byte, nbytes: int, timeout: int) :int; };
read: fn( fd: ref Sys->FD, buf: array of byte, nbytes: int, timeout: int) :int;The read function reads nbytes from an open file descriptor fd into buf. If the read is not completed in timeout milliseconds, the return value is timeout.
If the read operation completes before timeout milliseconds, the return value is that of sys->read (number of bytes read, or 0 for end-of-file).
write: fn( fd: ref Sys->FD, buf: array of byte, nbytes: int, timeout: int) :int;The write function write nbytes from buf into an open file descriptor fd. If the write is not completed in timeout milliseconds, the return value is timeout.
If the write operation completes before timeout milliseconds, the return value is that of sys->write (number of bytes written).