summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/write.2
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-02-05 02:33:09 +0000
committerschwarze <schwarze@openbsd.org>2015-02-05 02:33:09 +0000
commit0e5e29b0acdc0ee4e690553a6bc8d573b5e26335 (patch)
treed03e470c7096ed54c1a9f6122a297cc536a42908 /lib/libc/sys/write.2
parentfix handling of empty .An macros (diff)
downloadwireguard-openbsd-0e5e29b0acdc0ee4e690553a6bc8d573b5e26335.tar.xz
wireguard-openbsd-0e5e29b0acdc0ee4e690553a6bc8d573b5e26335.zip
macro fixes from Kaspars at Bankovskis dot net;
also fixing one typo in fts(3) while here
Diffstat (limited to 'lib/libc/sys/write.2')
-rw-r--r--lib/libc/sys/write.224
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2
index 930e445c1a1..60463ee05b0 100644
--- a/lib/libc/sys/write.2
+++ b/lib/libc/sys/write.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: write.2,v 1.38 2013/04/08 07:39:17 jmc Exp $
+.\" $OpenBSD: write.2,v 1.39 2015/02/05 02:33:09 schwarze Exp $
.\" $NetBSD: write.2,v 1.6 1995/02/27 12:39:43 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)write.2 8.5 (Berkeley) 4/2/94
.\"
-.Dd $Mdocdate: April 8 2013 $
+.Dd $Mdocdate: February 5 2015 $
.Dt WRITE 2
.Os
.Sh NAME
@@ -40,17 +40,17 @@
.Nm pwritev
.Nd write output
.Sh SYNOPSIS
-.Fd #include <unistd.h>
+.In unistd.h
.Ft ssize_t
.Fn write "int d" "const void *buf" "size_t nbytes"
.Ft ssize_t
.Fn pwrite "int d" "const void *buf" "size_t nbytes" "off_t offset"
.Pp
-.Fd #include <sys/uio.h>
+.In sys/uio.h
.Ft ssize_t
.Fn writev "int d" "const struct iovec *iov" "int iovcnt"
-.Fd #include <sys/types.h>
-.Fd #include <sys/uio.h>
+.In sys/types.h
+.In sys/uio.h
.Ft ssize_t
.Fn pwritev "int d" "const struct iovec *iov" "int iovcnt" "off_t offset"
.Sh DESCRIPTION
@@ -79,7 +79,7 @@ For
and
.Fn pwritev ,
the
-.Fa iovec
+.Vt iovec
structure is defined as:
.Bd -literal -offset indent
struct iovec {
@@ -89,7 +89,7 @@ struct iovec {
.Ed
.Pp
Each
-.Fa iovec
+.Vt iovec
entry specifies the base address and length of an area
in memory from which data should be written.
.Fn writev
@@ -106,7 +106,9 @@ starts at a position given by the pointer associated with
Upon return from
.Fn write ,
the pointer is incremented by the number of bytes which were written.
-If a file was opened with the O_APPEND flag (see
+If a file was opened with the
+.Dv O_APPEND
+flag (see
.Xr open 2 ) ,
calls to
.Fn write
@@ -264,7 +266,7 @@ The sum of the
values in the
.Fa iov
array overflowed an
-.Em ssize_t .
+.Vt ssize_t .
.It Bq Er EFAULT
Part of
.Fa iov
@@ -313,7 +315,7 @@ while ((nr = write(fd, buf, sizeof(buf))) > 0)
.Ed
.Pp
is not maximally portable, as some platforms allow for
-.Va nbytes
+.Fa nbytes
to range between
.Dv SSIZE_MAX
and