4 #include <msp/core/systemerror.h>
6 #include "handle_private.h"
11 void sys_set_blocking(Handle &handle, bool b)
13 int flags = fcntl(*handle, F_GETFL);
14 fcntl(*handle, F_SETFL, (flags&~O_NONBLOCK)|(b?0:O_NONBLOCK));
17 unsigned sys_read(Handle &handle, char *buf, unsigned size)
19 int ret = read(*handle, buf, size);
25 throw system_error("read");
31 unsigned sys_write(Handle &handle, const char *buf, unsigned size)
33 int ret = write(*handle, buf, size);
39 throw system_error("write");
45 void sys_close(Handle &handle)
50 *handle = INVALID_HANDLE_VALUE;