From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/read.html | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 man/man3/read.html (limited to 'man/man3/read.html') diff --git a/man/man3/read.html b/man/man3/read.html new file mode 100644 index 00000000..515c3f77 --- /dev/null +++ b/man/man3/read.html @@ -0,0 +1,109 @@ + +read(3) - Plan 9 from User Space + + + + +
+
+
READ(3)READ(3) +
+
+

NAME
+ +
+ + read, readn, write, pread, pwrite – read or write file
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h> +
+
+ long read(int fd, void *buf, long nbytes) +
+
+ long readn(int fd, void *buf, long nbytes) +
+
+ long write(int fd, void *buf, long nbytes) +
+
+ long pread(int fd, void *buf, long nbytes, vlong offset) +
+
+ long pwrite(int fd, void *buf, long nbytes, vlong offset)
+
+
+

DESCRIPTION
+ +
+ + Read reads nbytes bytes of data from the offset in the file associated + with fd into memory at buf. The offset is advanced by the number + of bytes read. It is not guaranteed that all nbytes bytes will + be read; for example if the file refers to the console, at most + one line will be returned. In any event the number of bytes + read is returned. A return value of 0 is conventionally interpreted + as end of file. +
+ + Readn is just like read, but does successive read calls until + nbytes have been read, or a read system call returns a non-positive + count. +
+ + Write writes nbytes bytes of data starting at buf to the file + associated with fd at the file offset. The offset is advanced + by the number of bytes written. The number of characters actually + written is returned. It should be regarded as an error if this + is not the same as requested. +
+ + Pread and Pwrite equivalent to a seek(3) to offset followed by + a read or write. By combining the operations in a single atomic + call, they more closely match the 9P protocol (see intro(9p)) + and, more important, permit multiprocess programs to execute multiple + concurrent read and write operations on the same file + descriptor without interference.
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/lib9/readn.c
+
+
+

SEE ALSO
+ +
+ + intro(3), open(3), dup(3), pipe(3)
+ +
+

DIAGNOSTICS
+ +
+ + These functions set errstr.
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3