|io_canwrite(3)||Library Functions Manual||io_canwrite(3)|
NAME¶io_canwrite - return a file descriptor that can be written to
DESCRIPTION¶io_canwrite returns the next file descriptor that can be written to. You have to have used io_wantwrite() on the file descriptor earlier, and you have to have called io_wait() or io_waituntil().
These functions then keep an internal data structure on which descriptors were reported writable by the operating system.
Please note that there is no guarantee that you can still write data without blocking to that descriptor, just that you could when io_wait() or io_waituntil() were called. Another process could have written something before you. Look at the result from io_trywrite().
If there are no more descriptors that you can write to without blocking, io_canwrite will return -1. In this case you should call io_wait() or io_waituntil() again.