summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/write.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/write.2')
-rw-r--r--lib/libc/sys/write.243
1 files changed, 30 insertions, 13 deletions
diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2
index 11929c72c71..81f2068d30e 100644
--- a/lib/libc/sys/write.2
+++ b/lib/libc/sys/write.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: write.2,v 1.36 2013/03/09 21:05:29 tedu Exp $
+.\" $OpenBSD: write.2,v 1.37 2013/04/08 06:26:12 guenther 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: March 9 2013 $
+.Dd $Mdocdate: April 8 2013 $
.Dt WRITE 2
.Os
.Sh NAME
@@ -40,18 +40,17 @@
.Nm pwritev
.Nd write output
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <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/types.h>
.Fd #include <sys/uio.h>
-.Fd #include <unistd.h>
.Ft ssize_t
.Fn writev "int d" "const struct iovec *iov" "int iovcnt"
+.Fd #include <sys/types.h>
+.Fd #include <sys/uio.h>
.Ft ssize_t
.Fn pwritev "int d" "const struct iovec *iov" "int iovcnt" "off_t offset"
.Sh DESCRIPTION
@@ -173,6 +172,11 @@ There is no free space remaining on the file system containing the file.
.It Bq Er EDQUOT
The user's quota of disk blocks on the file system containing the file
has been exhausted.
+.It Bq Er EINTR
+A write to a slow device
+(i.e. one that might block for an arbitrary amount of time)
+was interrupted by the delivery of a signal
+before any data could be written.
.It Bq Er EIO
An I/O error occurred while reading from or writing to the file system.
.It Bq Er EFAULT
@@ -185,7 +189,7 @@ In addition,
.Fn write
and
.Fn writev
-may return the following error:
+may return the following errors:
.Bl -tag -width Er
.It Bq Er EPIPE
An attempt is made to write to a pipe that is not open
@@ -197,12 +201,27 @@ that is not connected to a peer socket.
.It Bq Er EAGAIN
The file was marked for non-blocking I/O, and no data could be
written immediately.
+.It Bq Er ENETDOWN
+The destination address specified a network that is down.
.It Bq Er EDESTADDRREQ
The destination is no longer available when writing to a
.Ux Ns -domain
datagram socket on which
.Xr connect 2
had been used to set a destination address.
+.It Bq Er EIO
+The process is a member of a background process attempting to write
+to its controlling terminal,
+.Dv TOSTOP is set on the terminal,
+the process isn't ignoring the
+.Dv SIGTTOUT
+signal and the thread isn't blocking the
+.Dv SIGTTOUT
+signal,
+and either the process was created with
+.Xr vfork 2
+and hasn't successfully executed one of the exec functions or
+the process group is orphaned.
.El
.Pp
.Fn write
@@ -258,18 +277,16 @@ The system lacked sufficient buffer space or a queue was full.
.Xr open 2 ,
.Xr pipe 2 ,
.Xr poll 2 ,
-.Xr select 2
+.Xr select 2 ,
+.Xr termios 4
.Sh STANDARDS
The
-.Fn write
-function conforms to
-.St -p1003.1-90 .
-The
-.Fn writev
+.Fn write ,
+.Fn writev ,
and
.Fn pwrite
functions conform to
-.St -xpg4.2 .
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn pwritev