summaryrefslogtreecommitdiff
path: root/static/inferno/man2/sys-iounit.2
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/sys-iounit.2
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/inferno/man2/sys-iounit.2')
-rw-r--r--static/inferno/man2/sys-iounit.235
1 files changed, 35 insertions, 0 deletions
diff --git a/static/inferno/man2/sys-iounit.2 b/static/inferno/man2/sys-iounit.2
new file mode 100644
index 00000000..b4727411
--- /dev/null
+++ b/static/inferno/man2/sys-iounit.2
@@ -0,0 +1,35 @@
+.TH SYS-IOUNIT 2
+.SH NAME
+iounit \- return size of atomic I/O unit for file descriptor
+.SH SYNOPSIS
+.EX
+include "sys.m";
+sys := load Sys Sys->PATH;
+
+iounit: fn(fd: ref FD): int;
+.EE
+.SH DESCRIPTION
+Reads and writes of files are transmitted using the 9P protocol (see
+.IR 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.
+.PP
+The
+.B iounit
+system call returns the I/O unit size for the open file
+.IR fd .
+Certain file descriptors, particularly those associated with devices, may
+have no specific I/O unit, in which case
+.B iounit
+will return zero.
+.SH SOURCE
+.B /emu/port/inferno.c
+.br
+.B /os/port/inferno.c
+.SH SEE ALSO
+.IR sys-dup (2),
+.IR read (5)
+.SH DIAGNOSTICS
+Returns zero if any error occurs or if the I/O unit size of the fd is unspecified or unknown.