1io_fd_canwrite(3)          Library Functions Manual          io_fd_canwrite(3)
2
3
4

NAME

6       io_fd_canwrite - prepare descriptor for io_wait
7

SYNTAX

9       #include <io.h>
10
11       int io_fd(int64 fd); int io_fd_canwrite(int64 fd);
12

DESCRIPTION

14       io_fd_canwrite  is just like io_fd, except that it assumes the descrip‐
15       tor is writable, which may save a syscall or two.  This  assumption  is
16       true  in  most  cases,  because  the kernel buffers writes.  Noteworthy
17       cases in which you need to use  io_fd  instead  of  io_fd_canwrite  are
18       unconnected  sockets, i.e. when you queued a non-blocking connect() and
19       want to ask for writability to get notified when it went through.
20
21       It is OK to call this function on a descriptor that io_fd() has already
22       been called on.
23

RETURN VALUE

25       io_fd_canwrite returns 1 on success, 0 on error.
26

SEE ALSO

28       io_wait(3),   io_wantread(3),   io_canread(3),   io_eagain(3),  io_non‐
29       block(3), io_fd(3)
30
31
32
33                                                             io_fd_canwrite(3)
Impressum