doc/ja_JP.eucJP/man/man2/recv.2
Kazuo Horikawa dcac6ef800 Catch up with recent RELENG_4.
Submitted by: OHSAWA Chitoshi <ohsawa@catv1.ccn-net.ne.jp>,
	SUZUKI Koichi <metal@vc-net.ne.jp>,
	kuma@jp.FreeBSD.org
Reviewed by:kuma@jp.FreeBSD.org
2001-04-10 03:16:12 +00:00

285 lines
8.6 KiB
Groff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.\" Copyright (c) 1983, 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)recv.2 8.3 (Berkeley) 2/21/94
.\" %FreeBSD: src/lib/libc/sys/recv.2,v 1.8.2.4 2001/03/06 16:46:06 ru Exp %
.\"
.Dd February 21, 1994
.Dt RECV 2
.Os BSD 4.3r
.Sh ̾¾Î
.Nm recv ,
.Nm recvfrom ,
.Nm recvmsg
.Nd ¥½¥±¥Ã¥È¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë
.Sh ¥é¥¤¥Ö¥é¥ê
.Lb libc
.Sh ½ñ¼°
.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft ssize_t
.Fn recv "int s" "void *buf" "size_t len" "int flags"
.Ft ssize_t
.Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr *from" "socklen_t *fromlen"
.Ft ssize_t
.Fn recvmsg "int s" "struct msghdr *msg" "int flags"
.Sh ²òÀâ
.Fn recvfrom
¤È
.Fn recvmsg
¤Ï¡¢¥½¥±¥Ã¥È¤«¤é¤Î¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
¥½¥±¥Ã¥È¤¬Àܳ»Ø¸þ¤Ç¤¢¤ë¤«¤É¤¦¤«¤Ë¤«¤«¤ï¤é¤º¡¢¥½¥±¥Ã¥È¾å¤Î¥Ç¡¼¥¿¤ò
¼õ¿®¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
.Pp
.Fa from
¤¬ nil ¤Ç¤Ê¤¯¡¢¥½¥±¥Ã¥È¤¬Àܳ»Ø¸þ¤Ç¤Ê¤¤¾ì¹ç¡¢
¤³¤³¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤Î¥½¡¼¥¹¥¢¥É¥ì¥¹¤¬Êݸ¤µ¤ì¤Þ¤¹¡£
.Fa fromlen
¤Ï¡ÖÃÍ - ·ë²Ì¡×¥Ñ¥é¥á¡¼¥¿¤Ç¤¢¤ê¡¢
.Fa from
¤ËÂбþ¤¹¤ë¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ë½é´ü²½¤µ¤ì¡¢
Ìá¤ê»þ¤Ë¤ÏÊݸ¤µ¤ì¤¿¥¢¥É¥ì¥¹¤Î¼ÂºÝ¤Î¥µ¥¤¥º¤ò¼¨¤¹¤è¤¦¤Ë
Êѹ¹¤µ¤ì¤Þ¤¹¡£
.Pp
.Fn recv
¸Æ¤Ó½Ð¤·¤Ï¡¢Ä̾ï
.Em Àܳ¤µ¤ì¤¿
¥½¥±¥Ã¥È¾å¤À¤±¤Ç»ÈÍѤµ¤ì
.Pf ( Xr connect 2
¤ò»²¾È)¡¢
.Fa from
¥Ñ¥é¥á¡¼¥¿¤Ë nil ¤ò»ØÄꤷ¤¿
.Fn recvfrom
¤ÈƱ°ì¤Ç¤¹¡£¤³¤ì¤Ï¾éĹ¤Ê¤Î¤Ç¡¢¾­Íè¤Î¥ê¥ê¡¼¥¹¤Ç¤Ï
¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
.Pp
¤³¤ì¤é 3 ¤Ä¤Î¥ë¡¼¥Á¥ó¤ÏÀµ¾ï¤Ë´°Î»¤¹¤ë¤È¥á¥Ã¥»¡¼¥¸¤ÎŤµ¤òÊÖ¤·¤Þ¤¹¡£
¥á¥Ã¥»¡¼¥¸¤¬Ä¹¤¹¤®¤Æ»ØÄê¤Î¥Ð¥Ã¥Õ¥¡¤Ë¼ý¤Þ¤é¤Ê¤¤¾ì¹ç¡¢
¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤·¤¿¥½¥±¥Ã¥È¤Î¥¿¥¤¥×¤Ë¤è¤Ã¤Æ¤Ï
Ͳáʬ¤Î¥Ð¥¤¥È¤¬ÇË´þ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹
.Pf ( Xr socket 2
¤ò»²¾È)¡£
.Pp
¥½¥±¥Ã¥È¤Ë¥á¥Ã¥»¡¼¥¸¤¬Ìµ¤¤¾ì¹ç¤Ï¡¢¥½¥±¥Ã¥È¤¬Èó¥Ö¥í¥Ã¥­¥ó¥°
.Pf ( Xr fcntl 2
¤ò»²¾È) ¤Î¾ì¹ç¤ò½ü¤­¡¢¸Æ¤Ó½Ð¤·¤Ï¥á¥Ã¥»¡¼¥¸¤¬ÅþÃ夹¤ë¤Î¤òÂÔ¤Á¤Þ¤¹¡£
¥½¥±¥Ã¥È¤¬Èó¥Ö¥í¥Ã¥­¥ó¥°¤Î¾ì¹ç¡¢ÃÍ -1 ¤¬ÊÖ¤µ¤ì¡¢³°ÉôÊÑ¿ô
.Va errno
¤¬
.Er EAGAIN
¤ËÀßÄꤵ¤ì¤Þ¤¹¡£Ä̾¼õ¿®¸Æ¤Ó½Ð¤·¤ÏÍ׵ᤵ¤ì¤¿Î̤ò¼õ¿®¤¹¤ë¤Þ¤ÇÂÔ¤¿¤º¤Ë¡¢
Í׵ᤵ¤ì¤¿Î̤ò¾å¸Â¤È¤·¤ÆÆÀ¤é¤ì¤¿¥Ç¡¼¥¿¤òÊÖ¤·¤Þ¤¹¡£¤³¤Îưºî¤Ï¡¢
.Xr getsockopt 2
¤Ç²òÀ⤵¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥ì¥Ù¥ë¤Î¥ª¥×¥·¥ç¥ó
.Dv SO_RCVLOWAT
¤ª¤è¤Ó
.Dv SO_RCVTIMEO
¤Ë¤è¤Ã¤Æ±Æ¶Á¤ò¼õ¤±¤Þ¤¹¡£
.Pp
¼¡¤Î¥Ç¡¼¥¿¤¬¤¤¤ÄÅþÃ夹¤ë¤«¤òȽÄꤹ¤ë¤Ë¤Ï
.Xr select 2
¸Æ¤Ó½Ð¤·¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
.Pp
recv ¸Æ¤Ó½Ð¤·¤Ø¤Î
.Fa flags
°ú¿ô¤Ï¡¢¼¡¤ÎÃͤΠ1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô¤ÎÏÀÍýÏÂ
.\".Em or Ap ing
.Em ( or )
¤«¤éÀ®¤ê¤Þ¤¹¡£
.Bl -column MSG_WAITALL -offset indent
.It Dv MSG_OOB Ta ¥×¥í¥»¥¹ÂÓ°è³°¥Ç¡¼¥¿
.It Dv MSG_PEEK Ta Ãå¿®¥á¥Ã¥»¡¼¥¸¤ÎÇÁ¤­¸« (peek)
.It Dv MSG_WAITALL Ta Í×µá¤Î´°Á´¤Ê¼Â¹Ô¡¢¤Þ¤¿¤Ï¥¨¥é¡¼¤òÂÔ¤Ä
.El
.Pp
.Dv MSG_OOB
¥Õ¥é¥°¤ÏÂÓ°è³°¥Ç¡¼¥¿¤Î¼õ¿®¤òÍ׵ᤷ¡¢
Ä̾ï¤Î¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤«¤é¤Ï¼õ¿®¤·¤Þ¤»¤ó¡£
µÞÁ÷¥Ç¡¼¥¿¤òÄ̾ï¤Î¥Ç¡¼¥¿ÂÔ¤Á¹ÔÎó¤ÎÀèÆ¬¤ËÇÛÃÖ¤¹¤ë¥×¥í¥È¥³¥ë¤â¤¢¤ê¤Þ¤¹¤¬¡¢
¤³¤Î¥Õ¥é¥°¤Ï¤½¤Î¤è¤¦¤Ê¥×¥í¥È¥³¥ë¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£MSG_PEEK ¥Õ¥é¥°¤Ï
¼õ¿®ÂÔ¤Á¹ÔÎó¤ÎÀèÆ¬¤«¤é¥Ç¡¼¥¿¤ò½üµî¤¹¤ë¤³¤È¤Ê¤¯¡¢¤½¤Î¥Ç¡¼¥¿¤ò
ÊÖ¤·¤Þ¤¹¡£¤·¤¿¤¬¤Ã¤Æ¡¢¸å³¤Î¼õ¿®¸Æ¤Ó½Ð¤·¤ÏƱ¤¸¥Ç¡¼¥¿
¤òÊÖ¤·¤Þ¤¹¡£MSG_WAITALL ¥Õ¥é¥°¤ÏÍ׵᤬´°Á´¤ËËþ¤¿¤µ¤ì¤ë¤Þ¤Ç
¥Ö¥í¥Ã¥¯¤¹¤ë¤è¤¦¤ËÍ׵ᤷ¤Þ¤¹¡£
¤·¤«¤·¡¢¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¾ì¹ç¡¢¥¨¥é¡¼¤Þ¤¿¤ÏÀÚÃǤ¬È¯À¸¤·¤¿¾ì¹ç¡¢
¤Þ¤¿¤Ï¼õ¿®¤¹¤ë¼¡¤Î¥Ç¡¼¥¿¤¬ÊÖ¤µ¤ì¤¿¥¿¥¤¥×¤È°Û¤Ê¤ë
¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¤ÏÍ׵ᤵ¤ì¤¿¤è¤ê¾¯¤Ê¤¤¥Ç¡¼¥¿¤òÊÖ¤¹²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
.Pp
.Fn recvmsg
¸Æ¤Ó½Ð¤·¤Ï¡¢Ä¾Àܤ˻ØÄꤵ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤Î¿ô¤òºÇ¾®¤Ë¤¹¤ë¤¿¤á¤Ë
.Fa msghdr
¹½Â¤ÂΤò»ÈÍѤ·¤Þ¤¹¡£¤³¤Î¹½Â¤ÂΤÏ
.Ao Pa sys/socket.h Ac
¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢¼¡¤Î·Á¼°¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
.Pp
.Bd -literal
struct msghdr {
caddr_t msg_name; /* ¥¢¥É¥ì¥¹(¥ª¥×¥·¥ç¥ó) */
u_int msg_namelen; /* ¥¢¥É¥ì¥¹¤Î¥µ¥¤¥º */
struct iovec *msg_iov; /* ¥¹¥­¥ã¥Ã¥¿/¥®¥ã¥¶¡¼ÇÛÎó */
u_int msg_iovlen; /* msg_iov ¤ÎÍ×ÁÇ¿ô */
caddr_t msg_control; /* Êä½õ¥Ç¡¼¥¿¡¢¸å½Ò */
u_int msg_controllen; /* Êä½õ¥Ç¡¼¥¿¤Î¥Ð¥Ã¥Õ¥¡Ä¹ */
int msg_flags; /* ¼õ¿®¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¾å¤Î¥Õ¥é¥° */
};
.Ed
.Pp
¤³¤³¤Ç
.Fa msg_name
¤È
.Fa msg_namelen
¤Ï¡¢¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢°¸À襢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£
̾Á°¤òÍ׵ᤷ¤Ê¤¤¾ì¹ç¤äɬÍפǤʤ¤¾ì¹ç¡¢
.Fa msg_name
¤Ï NULL ¥Ý¥¤¥ó¥¿¤È¤·¤Æ»ØÄê¤Ç¤­¤Þ¤¹¡£
.Fa msg_iov
¤È
.Fa msg_iovlen
¤Ï
.Xr read 2
¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¥¹¥­¥ã¥Ã¥¿/¥®¥ã¥¶¡¼¤Î¾ì½ê¤òµ­½Ò¤·¤Þ¤¹¡£
.Fa msg_control
¤Ï¡¢Ä¹¤µ¤¬
.Fa msg_controllen
¤Î¡¢Â¾¤Î¥×¥í¥È¥³¥ëÀ©¸æ¤Ë´ØÏ¢¤¹¤ë¥á¥Ã¥»¡¼¥¸¤Þ¤¿¤Ï¤½¤Î¾¤Î
³Æ¼ïÊä½õ¥Ç¡¼¥¿ÍѤΥХåե¡¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¼°¤Ç¤¹¡£
.Bd -literal
struct cmsghdr {
u_int cmsg_len; /* ¥Ç¡¼¥¿¥Ð¥¤¥È¥«¥¦¥ó¥È¡¢hdr ¤ò´Þ¤à */
int cmsg_level; /* ¥á¥Ã¥»¡¼¥¸¤òÀ¸À®¤·¤¿¥×¥í¥È¥³¥ë */
int cmsg_type; /* ¥×¥í¥È¥³¥ë¤Ë¸ÇÍ­¤Î¥¿¥¤¥× */
/* u_char cmsg_data[]; ¤¬¸å¤Ë³¤¯ */
};
.Pp
.Ed
¤¿¤È¤¨¤Ð¡¢¤³¤ì¤ò»ÈÍѤ·¤Æ XNS/SPP ¤Ë¤ª¤¤¤Æ
¥Ç¡¼¥¿¥¹¥È¥ê¡¼¥à¤ÎÊѲ½¤òÃΤ뤳¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢ISO ¤Ë¤ª¤¤¤Æ
.Fn accept
¸Æ¤Ó½Ð¤·¤Îľ¸å¤Ë¡¢¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤òȼ¤ï¤º¤Ë recvmsg ¤òÍ׵ᤷ¤Æ¡¢
¥æ¡¼¥¶ÀܳÍ×µá¥Ç¡¼¥¿¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
.Pp
¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Ï¤³¤ì¤Ç
.Dv AF_UNIX
¥É¥á¥¤¥ó¥½¥±¥Ã¥ÈÍѤÎÊä½õ¥Ç¡¼¥¿¤È¤·¤Æ°ú¤­ÅϤµ¤ì¡¢¤½¤ÎºÝ¡¢
.Fa cmsg_level
¤¬
.Dv SOL_SOCKET
¤ËÀßÄꤵ¤ì¡¢
.Fa cmsg_type
¤¬
.Dv SCM_RIGHTS
¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
.Pp
.Dv SCM_CREDS
¤Î
.Fa cmsg_type
¤ò»ÈÍѤ·¤Æ¡¢¥×¥í¥»¥¹¤Îǧ¾Ú¾ðÊó¤ò
.Dv AF_UNIX
¥É¥á¥¤¥ó¥½¥±¥Ã¥ÈÍѤÎÊä½õ¥Ç¡¼¥¿¤È¤·¤Æ
ÅϤ¹¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¥±¡¼¥¹¤Ç¤Ï¡¢
.Fa cmsg_data
¤Ï¡¢¹½Â¤ÂÎ
.Fa cmsgcred
¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï
¼¡¤Î¤è¤¦¤Ë
.Ao Pa sys/socket.h Ac
Æâ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
.Pp
.Bd -literal
struct cmsgcred {
pid_t cmcred_pid; /* Á÷¿®¥×¥í¥»¥¹¤Î PID */
uid_t cmcred_uid; /* Á÷¿®¥×¥í¥»¥¹¤Î¼Â UID */
uid_t cmcred_euid; /* Á÷¿®¥×¥í¥»¥¹¤Î¼Â¸ú UID */
gid_t cmcred_gid; /* Á÷¿®¥×¥í¥»¥¹¤Î¼Â GID */
short cmcred_ngroups; /* ¥°¥ë¡¼¥×¤Î¿ô */
gid_t cmcred_groups[CMGROUP_MAX]; /* ¥°¥ë¡¼¥× */
};
.Ed
.Pp
¥«¡¼¥Í¥ë¤ÏÁ÷¿®¥×¥í¥»¥¹¤Îǧ¾Ú¾ðÊó¤òµ­Æþ¤·¡¢¤½¤ì¤ò¼õ¿®Â¦¤ØÇÛ¿®¤·¤Þ¤¹¡£
.Pp
.Fa msg_flags
¥Õ¥£¡¼¥ë¥É¤Ï¼õ¿®ºÑ¤ß¥á¥Ã¥»¡¼¥¸¤Ë½¾¤Ã¤ÆÌá¤ê»þ¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
.Dv MSG_EOR
¤Ï end-of-record¡¢¤Ä¤Þ¤êÊÖ¤µ¤ì¤¿¥Ç¡¼¥¿¤Ç¥ì¥³¡¼¥É¤¬
´°·ë¤·¤Æ¤¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹ (°ìÈ̤ˤϡ¢¥¿¥¤¥×
.Dv SOCK_SEQPACKET
¤Î¥½¥±¥Ã¥È¤È¤È¤â¤Ë»ÈÍѤµ¤ì¤Þ¤¹)¡£
.Dv MSG_TRUNC
¤Ï¡¢Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤è¤ê¥Ç¡¼¥¿¥°¥é¥à¤¬Â礭¤«¤Ã¤¿¤Î¤Ç¡¢
¥Ç¡¼¥¿¥°¥é¥à¤Î¸å¤í¤ÎÉôʬ¤¬ÀÚ¤ê¼Î¤Æ¤é¤ì¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£
.Dv MSG_CTRUNC
¤Ï¡¢Êä½õ¥Ç¡¼¥¿ÍѤΥХåե¡Æâ¤Î¶õ´Ö¤ÎÉÔ­¤Î¤¿¤á¤Ë¤¤¤¯¤é¤«¤ÎÀ©¸æ¥Ç¡¼¥¿¤¬
ÀÚ¤ê¼Î¤Æ¤é¤ì¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£
.Dv MSG_OOB
¤Ï¡¢µÞÁ÷¤Þ¤¿¤ÏÂÓ°è³°¥Ç¡¼¥¿¤¬¼õ¿®¤µ¤ì¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£
.Pp
.Sh Ìá¤êÃÍ
¤³¤ì¤é¤Î¸Æ¤Ó½Ð¤·¤Ï¼õ¿®¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤·¡¢¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤Ï -1 ¤òÊÖ¤·¤Þ¤¹¡£
.Sh ¥¨¥é¡¼
¸Æ¤Ó½Ð¤·¤Ï¼¡¤Î¾ì¹ç¤Ë¼ºÇÔ¤·¤Þ¤¹¡£
.Bl -tag -width Er
.It Bq Er EBADF
°ú¿ô
.Fa s
¤¬Í­¸ú¤Êµ­½Ò»Ò¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
.It Bq Er ENOTCONN
¥½¥±¥Ã¥È¤ÏÀܳ»Ø¸þ¥×¥í¥È¥³¥ë¤È·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢Àܳ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó
.Pf ( Xr connect 2
¤È
.Xr accept 2
¤ò»²¾È)¡£
.It Bq Er ENOTSOCK
°ú¿ô
.Fa s
¤Ï¥½¥±¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤Þ¤»¤ó¡£
.It Bq Er EAGAIN
¥½¥±¥Ã¥È¤¬Èó¥Ö¥í¥Ã¥­¥ó¥°¤È¥Þ¡¼¥¯¤µ¤ì¤Æ¤¤¤ë¤È¤­¡¢
¼õ¿®Áàºî¤Ç¥Ö¥í¥Ã¥¯¤·¤Þ¤·¤¿¡£
¤¢¤ë¤¤¤Ï¡¢¼õ¿®¥¿¥¤¥à¥¢¥¦¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¡¢
¥Ç¡¼¥¿¤¬¼õ¿®¤µ¤ì¤ëÁ°¤Ë¥¿¥¤¥à¥¢¥¦¥È¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
.It Bq Er EINTR
¥Ç¡¼¥¿¤¬¼õ¿®²Äǽ¤Ë¤Ê¤ëÁ°¤Ë¡¢¼õ¿®¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¹þ¤Þ¤ì¤Þ¤·¤¿¡£
.It Bq Er EFAULT
¼õ¿®¥Ð¥Ã¥Õ¥¡¥Ý¥¤¥ó¥¿¤¬¡¢¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö¤Î
Èϰϳ°¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£
.El
.Sh ´ØÏ¢¹àÌÜ
.Xr fcntl 2 ,
.Xr getsockopt 2 ,
.Xr read 2 ,
.Xr select 2 ,
.Xr socket 2
.Sh Îò»Ë
.Fn recv
´Ø¿ô¤Ï
.Bx 4.2
¤ÇÅо줷¤Þ¤·¤¿¡£