OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man2 / recvmmsg.2
1 .\" Copyright (C) 2011 by Andi Kleen <andi@firstfloor.org>
2 .\" and Copyright (c) 2011 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\" FIXME: This page could be improved with an example program.
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .TH RECVMMSG 2 2011\-10\-04 Linux "Linux Programmer's Manual"
32 .SH 名前
33 recvmmsg \- receive multiple messages on a socket
34 .SH 書式
35 .nf
36 \fB#define _GNU_SOURCE\fP
37 \fB#include <sys/socket.h>\fP
38
39 \fBint recvmmsg(int \fP\fIsockfd\fP\fB, struct mmsghdr *\fP\fImsgvec\fP\fB, unsigned int \fP\fIvlen\fP\fB,\fP
40 .br
41 \fB             unsigned int \fP\fIflags\fP\fB, struct timespec *\fP\fItimeout\fP\fB);\fP
42 .fi
43 .SH 説明
44 The \fBrecvmmsg\fP()  system call is an extension of \fBrecvmsg\fP(2)  that allows
45 the caller to receive multiple messages from a socket using a single system
46 call.  (This has performance benefits for some applications.)  A further
47 extension over \fBrecvmsg\fP(2)  is support for a timeout on the receive
48 operation.
49
50 The \fIsockfd\fP argument is the file descriptor of the socket to receive data
51 from.
52
53 The \fImsgvec\fP argument is a pointer to an array of \fImmsghdr\fP structures.
54 The size of this array is specified in \fIvlen\fP.
55
56 The \fImmsghdr\fP structure is defined in \fI<sys/socket.h>\fP as:
57
58 .in +4n
59 .nf
60 struct mmsghdr {
61     struct msghdr msg_hdr;  /* Message header */
62     unsigned int  msg_len;  /* Number of received bytes for header */
63 };
64 .fi
65 .in
66 .PP
67 The \fImsg_hdr\fP field is a \fImsghdr\fP structure, as described in
68 \fBrecvmsg\fP(2).  The \fImsg_len\fP field is the number of bytes returned for the
69 message in the entry.  This field has the same value as the return value of
70 a single \fBrecvmsg\fP(2)  on the header.
71
72 The \fIflags\fP argument contains flags ORed together.  The flags are the same
73 as documented for \fBrecvmsg\fP(2), with the following addition:
74 .TP 
75 \fBMSG_WAITFORONE\fP
76 Turns on \fBMSG_DONTWAIT\fP after the first message has been received.
77 .PP
78 The \fItimeout\fP argument points to a \fIstruct timespec\fP (see
79 \fBclock_gettime\fP(2))  defining a timeout (seconds plus nanoseconds) for the
80 receive operation.  If \fItimeout\fP is \fINULL\fP then the operation blocks
81 indefinitely.
82
83 A blocking \fBrecvmmsg\fP()  call blocks until \fIvlen\fP messages have been
84 received or until the timeout expires.  A nonblocking call reads as many
85 messages as are available (up to the limit specified by \fIvlen\fP)  and
86 returns immediately.
87
88 On return from \fBrecvmmsg\fP(), successive elements of \fImsgvec\fP are updated
89 to contain information about each received message: \fImsg_len\fP contains the
90 size of the received message; the subfields of \fImsg_hdr\fP are updated as
91 described in \fBrecvmsg\fP(2).  The return value of the call indicates the
92 number of elements of \fImsgvec\fP that have been updated.
93 .SH 返り値
94 On success, \fBrecvmmsg\fP()  returns the number of messages received in
95 \fImsgvec\fP; on error, \-1 is returned, and \fIerrno\fP is set to indicate the
96 error.
97 .SH エラー
98 Errors are as for \fBrecvmsg\fP(2).  In addition, the following error can
99 occur:
100 .TP 
101 \fBEINVAL\fP
102 \fItimeout\fP is invalid.
103 .SH バージョン
104 The \fBrecvmmsg\fP()  system call was added in Linux 2.6.32.  Support in glibc
105 was added in version 2.12.
106 .SH 準拠
107 \fBrecvmmsg\fP()  is Linux\-specific.
108 .SH 関連項目
109 \fBclock_gettime\fP(2), \fBrecvmsg\fP(2), \fBsendmmsg\fP(2), \fBsendmsg\fP(2),
110 \fBsocket\fP(2), \fBsocket\fP(7)