-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" This manpage is Copyright (C) 2006 Jens Axboe
-.\" and Copyright (C) 2006 Michael Kerrisk <mtk-manpages@gmx.net>
+.\" and Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
-.TH VMSPLICE 2 2006-04-28 "Linux 2.6.17" "Linux Programmer's Manual"
+.TH VMSPLICE 2 2012-05-04 "Linux" "Linux Programmer's Manual"
.SH NAME
vmsplice \- splice user pages into a pipe
.SH SYNOPSIS
.nf
-.B #define _GNU_SOURCE
+.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <fcntl.h>
.B #include <sys/uio.h>
-.BI "long vmsplice(int " fd ", const struct iovec *" iov ,
-.BI " unsigned long " nr_segs ", unsigned int " flags );
+.BI "ssize_t vmsplice(int " fd ", const struct iovec *" iov ,
+.BI " unsigned long " nr_segs ", unsigned int " flags );
.fi
+.\" Return type was long before glibc 2.7
.SH DESCRIPTION
.\" Linus: vmsplice() system call to basically do a "write to
.\" the buffer", but using the reference counting and VM traversal
.\" to actually fill the buffer. This means that the user needs to
-.\" be careful not to re-use the user-space buffer it spliced into
+.\" be careful not to reuse the user-space buffer it spliced into
.\" the kernel-space one (contrast this to "write()", which copies
-.\" the actual data, and you can thus re-use the buffer immediately
+.\" the actual data, and you can thus reuse the buffer immediately
.\" after a successful write), but that is often easy to do.
The
.BR vmsplice ()
structures as defined in
.IR <sys/uio.h> :
-.in +0.25i
+.in +4n
.nf
struct iovec {
void *iov_base; /* Starting address */
size_t iov_len; /* Number of bytes */
};
-.in -0.25i
+.in
.fi
The
.B EINVAL
.I nr_segs
is 0 or greater than
-.BR IOV_MAX;
+.BR IOV_MAX ;
or memory not aligned if
.B SPLICE_F_GIFT
set.
.TP
.B ENOMEM
Out of memory.
+.SH VERSIONS
+The
+.BR vmsplice ()
+system call first appeared in Linux 2.6.17;
+library support was added to glibc in version 2.5.
+.SH CONFORMING TO
+This system call is Linux-specific.
.SH NOTES
.BR vmsplice ()
follows the other vectorized read/write type functions when it comes to
as defined in
.IR <limits.h> .
At the time of this writing, that limit is 1024.
-.SH VERSIONS
-The
-.BR vmsplice (2)
-system call first appeared in Linux-2.6.17.
-.SH "CONFORMING TO"
-This system call is Linux specific.
.SH SEE ALSO
.BR splice (2),
-.BR tee (2),
-.BR feature_test_macros (7)
+.BR tee (2)