Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
850 B

.TH io_fd_canwrite 3
io_fd_canwrite \- prepare descriptor for io_wait
.B #include <io.h>
int \fBio_fd\fP(int64 fd);
int \fBio_fd_canwrite\fP(int64 fd);
io_fd_canwrite is just like io_fd, except that assumes the descriptor
is writable, which may save a syscall or two. This assumption is true
in most cases, because the kernel buffers writes. Noteworthy cases in
which you need to use io_fd instead of io_fd_canwrite are unconnected
sockets, i.e. when you queued a non-blocking connect() and want to ask
for writability to get notified when it went through.
It is OK to call this function on a descriptor that io_fd() has already
been called on.
io_fd_canwrite returns 1 on success, 0 on error.
io_wait(3), io_wantread(3), io_canread(3), io_eagain(3), io_nonblock(3), io_fd(3)