OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man2 / recvmmsg.2
diff --git a/draft/man2/recvmmsg.2 b/draft/man2/recvmmsg.2
new file mode 100644 (file)
index 0000000..386008a
--- /dev/null
@@ -0,0 +1,110 @@
+.\" Copyright (C) 2011 by Andi Kleen <andi@firstfloor.org>
+.\" and Copyright (c) 2011 by Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" 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.
+.\"
+.\" Permission is granted to copy and distribute modified versions of this
+.\" manual under the conditions for verbatim copying, provided that the
+.\" entire resulting derived work is distributed under the terms of a
+.\" permission notice identical to this one.
+.\"
+.\" Since the Linux kernel and libraries are constantly changing, this
+.\" manual page may be incorrect or out-of-date.  The author(s) assume no
+.\" responsibility for errors or omissions, or for damages resulting from
+.\" the use of the information contained herein.  The author(s) may not
+.\" have taken the same level of care in the production of this manual,
+.\" which is licensed free of charge, as they might when working
+.\" professionally.
+.\"
+.\" Formatted or processed versions of this manual, if unaccompanied by
+.\" the source, must acknowledge the copyright and authors of this work.
+.\"
+.\" FIXME: This page could be improved with an example program.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH RECVMMSG 2 2011\-10\-04 Linux "Linux Programmer's Manual"
+.SH 名前
+recvmmsg \- receive multiple messages on a socket
+.SH 書式
+.nf
+\fB#define _GNU_SOURCE\fP
+\fB#include <sys/socket.h>\fP
+
+\fBint recvmmsg(int \fP\fIsockfd\fP\fB, struct mmsghdr *\fP\fImsgvec\fP\fB, unsigned int \fP\fIvlen\fP\fB,\fP
+.br
+\fB             unsigned int \fP\fIflags\fP\fB, struct timespec *\fP\fItimeout\fP\fB);\fP
+.fi
+.SH 説明
+The \fBrecvmmsg\fP()  system call is an extension of \fBrecvmsg\fP(2)  that allows
+the caller to receive multiple messages from a socket using a single system
+call.  (This has performance benefits for some applications.)  A further
+extension over \fBrecvmsg\fP(2)  is support for a timeout on the receive
+operation.
+
+The \fIsockfd\fP argument is the file descriptor of the socket to receive data
+from.
+
+The \fImsgvec\fP argument is a pointer to an array of \fImmsghdr\fP structures.
+The size of this array is specified in \fIvlen\fP.
+
+The \fImmsghdr\fP structure is defined in \fI<sys/socket.h>\fP as:
+
+.in +4n
+.nf
+struct mmsghdr {
+    struct msghdr msg_hdr;  /* Message header */
+    unsigned int  msg_len;  /* Number of received bytes for header */
+};
+.fi
+.in
+.PP
+The \fImsg_hdr\fP field is a \fImsghdr\fP structure, as described in
+\fBrecvmsg\fP(2).  The \fImsg_len\fP field is the number of bytes returned for the
+message in the entry.  This field has the same value as the return value of
+a single \fBrecvmsg\fP(2)  on the header.
+
+The \fIflags\fP argument contains flags ORed together.  The flags are the same
+as documented for \fBrecvmsg\fP(2), with the following addition:
+.TP 
+\fBMSG_WAITFORONE\fP
+Turns on \fBMSG_DONTWAIT\fP after the first message has been received.
+.PP
+The \fItimeout\fP argument points to a \fIstruct timespec\fP (see
+\fBclock_gettime\fP(2))  defining a timeout (seconds plus nanoseconds) for the
+receive operation.  If \fItimeout\fP is \fINULL\fP then the operation blocks
+indefinitely.
+
+A blocking \fBrecvmmsg\fP()  call blocks until \fIvlen\fP messages have been
+received or until the timeout expires.  A nonblocking call reads as many
+messages as are available (up to the limit specified by \fIvlen\fP)  and
+returns immediately.
+
+On return from \fBrecvmmsg\fP(), successive elements of \fImsgvec\fP are updated
+to contain information about each received message: \fImsg_len\fP contains the
+size of the received message; the subfields of \fImsg_hdr\fP are updated as
+described in \fBrecvmsg\fP(2).  The return value of the call indicates the
+number of elements of \fImsgvec\fP that have been updated.
+.SH 返り値
+On success, \fBrecvmmsg\fP()  returns the number of messages received in
+\fImsgvec\fP; on error, \-1 is returned, and \fIerrno\fP is set to indicate the
+error.
+.SH エラー
+Errors are as for \fBrecvmsg\fP(2).  In addition, the following error can
+occur:
+.TP 
+\fBEINVAL\fP
+\fItimeout\fP is invalid.
+.SH バージョン
+The \fBrecvmmsg\fP()  system call was added in Linux 2.6.32.  Support in glibc
+was added in version 2.12.
+.SH 準拠
+\fBrecvmmsg\fP()  is Linux\-specific.
+.SH 関連項目
+\fBclock_gettime\fP(2), \fBrecvmsg\fP(2), \fBsendmmsg\fP(2), \fBsendmsg\fP(2),
+\fBsocket\fP(2), \fBsocket\fP(7)