summaryrefslogtreecommitdiff
path: root/static/plan9-4e/man2/readv.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/plan9-4e/man2/readv.2
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/plan9-4e/man2/readv.2')
-rw-r--r--static/plan9-4e/man2/readv.282
1 files changed, 82 insertions, 0 deletions
diff --git a/static/plan9-4e/man2/readv.2 b/static/plan9-4e/man2/readv.2
new file mode 100644
index 00000000..31dcb884
--- /dev/null
+++ b/static/plan9-4e/man2/readv.2
@@ -0,0 +1,82 @@
+.TH READV 2
+.SH NAME
+readv, writev, preadv, pwritev \- scatter/gather read and write
+.SH SYNOPSIS
+.B #include <u.h>
+.br
+.B #include <libc.h>
+.PP
+.nf
+.ft L
+typedef
+struct IOchunk
+{
+ void *addr;
+ ulong len;
+} IOchunk;
+.fi
+.PP
+.B
+long readv(int fd, IOchunk *io, int nio)
+.PP
+.B
+long preadv(int fd, IOchunk *io, int nio, vlong off)
+.PP
+.B
+long writev(int fd, IOchunk *io, int nio)
+.PP
+.B
+long pwritev(int fd, IOchunk *io, int nio, vlong off)
+.SH DESCRIPTION
+These functions supplement the standard read and write operations of
+.IR read (2)
+with facilities for scatter/gather I/O.
+The set of I/O buffers is collected into an array of
+.B IOchunk
+structures passed as an argument.
+.PP
+.I Readv
+reads data from
+.I fd
+and returns the total number of bytes received.
+The received data is stored in the successive
+.I nio
+elements of the
+.B IOchunk
+array, storing
+.IB io [0].len
+bytes at
+.IB io [0].addr\f1,
+the next
+.IB io [1].len
+at
+.IB io [1].addr\f1,
+and so on.
+.I Preadv
+does the same, but implicitly seeks to I/O offset
+.I off
+by analogy with
+.IR readv .
+.PP
+.I Writev
+and
+.I pwritev
+are the analogous write routines.
+.SH SOURCE
+.B /sys/src/libc/9sys/readv.c
+.br
+.B /sys/src/libc/9sys/writev.c
+.SH SEE ALSO
+.IR intro (2),
+.IR read (2)
+.SH DIAGNOSTICS
+These functions set
+.IR errstr .
+.SH BUGS
+The implementations use
+.IR malloc (2)
+to build a single buffer for a standard call to
+.B read
+or
+.BR write .
+They are placeholders for possible future system calls.