io_fd_canwrite(3)

io_fd_canwrite3

Prepare descriptor for io_wait

Usage

#include <libowfat/io.h>

int io_fd(int64 fd); int io_fd_canwrite(int64 fd);

Overview

io_fd_canwrite is just like io_fd, except that it 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.

Return value

io_fd_canwrite returns 1 on success, 0 on error.

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8
  2. 9–11
  3. 12–13

From libowfat-dev 0.32-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.