SYS-IOUNIT(2)                                       SYS-IOUNIT(2)

     NAME
          iounit - return size of atomic I/O unit for file descriptor

     SYNOPSIS
          include "sys.m";
          sys := load Sys Sys->PATH;

          iounit:   fn(fd: ref FD): int;

     DESCRIPTION
          Reads and writes of files are transmitted using the 9P
          protocol (see intro(5)) and in general, operations involving
          large amounts of data must be broken into smaller pieces by
          the operating system.  The `I/O unit' associated with each
          file descriptor records the maximum size, in bytes, that may
          be read or written without breaking up the transfer.

          The iounit system call returns the I/O unit size for the
          open file fd. Certain file descriptors, particularly those
          associated with devices, may have no specific I/O unit, in
          which case iounit will return zero.

     SOURCE
          /emu/port/inferno.c
          /os/port/inferno.c

     SEE ALSO
          sys-dup(2), read(5)

     DIAGNOSTICS
          Returns zero if any error occurs or if the I/O unit size of
          the fd is unspecified or unknown.

     Page 1                       Plan 9            (printed 12/22/24)