.\"WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
.\"WORD: exceptional condition Îã³°¾õÂÖ
.\"
-.TH SELECT_TUT 2 2009-01-26 "Linux" "Linux Programmer's Manual"
+.TH SELECT_TUT 2 2010-06-10 "Linux" "Linux Programmer's Manual"
.\"O .SH NAME
.SH ̾Á°
.\"O select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \-
.\"O for more details about OOB data.
.\"O (One other less common case where
.\"O .BR select (2)
-.\"O indicates an exceptional condition occurs with pseudo-terminals
+.\"O indicates an exceptional condition occurs with pseudoterminals
.\"O in packet mode; see
.\"O .BR tty_ioctl (4).)
.\"O After
.BR tcp (7)
¤ò»²¾È¤Î¤³¤È¡£
(¤³¤ì°Ê³°¤Ç¤Ï¡¢¤Þ¤ì¤Ê¤³¤È¤À¤¬¡¢
-¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Îµ¼»÷üËö (pseudo-terminals) ¤Ç
+¥Ñ¥±¥Ã¥È¥â¡¼¥É¤Îµ¼»÷üËö (pseudoterminals) ¤Ç
.BR select ()
¤¬Îã³°¾õÂÖ¤ò¼¨¤¹¤³¤È¤¬¤¢¤ë¡£)
.BR select ()
.\"O is that it watches
.\"O multiple descriptors at the same time and properly puts the process to
.\"O sleep if there is no activity.
-.\"O Unix programmers often find
+.\"O UNIX programmers often find
.\"O themselves in a position where they have to handle I/O from more than one
.\"O file descriptor where the data flow may be intermittent.
.\"O If you were to merely create a sequence of
.BR select ()
¤Î½ÅÍפʤȤ³¤í¤Ï¡¢Ê£¿ô¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òƱ»þ¤Ë´Æ»ë¤Ç¤¡¢
¤Ê¤ó¤ÎÆ°¤¤â¤Ê¤±¤ì¤Ð¥×¥í¥»¥¹¤òŬÀڤ˥¹¥ê¡¼¥×¾õÂ֤˰ܹԤ¹¤ë¤È¤³¤í¤Ë¤¢¤ë¤Î¤À¡£
-Unix ¥×¥í¥°¥é¥Þ¤Ï¡¢
+UNIX ¥×¥í¥°¥é¥Þ¤Ï¡¢
Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ÎÆþ½ÐÎϤòƱ»þ¤Ë°·¤ï¤Í¤Ð¤Ê¤é¤º¡¢
¤·¤«¤â¥Ç¡¼¥¿¤Îή¤ì¤Ï´Ö·çŪ¤Ç¤¢¤ë¡¢¤È¤¤¤¦¾õ¶·¤Ë¤è¤¯½Ð²ñ¤¦¡£
ñ¤Ë
select(0, NULL, NULL, NULL, &tv);
.fi
.PP
-.\"O This is only guaranteed to work on Unix systems, however.
-⤷¡¢¤³¤ì¤¬Æ°¤¯¤ÈÊݾڤµ¤ì¤Æ¤¤¤ë¤Î¤Ï Unix ¥·¥¹¥Æ¥à¤Ë¸Â¤é¤ì¤ë¡£
+.\"O This is only guaranteed to work on UNIX systems, however.
+⤷¡¢¤³¤ì¤¬Æ°¤¯¤ÈÊݾڤµ¤ì¤Æ¤¤¤ë¤Î¤Ï UNIX ¥·¥¹¥Æ¥à¤Ë¸Â¤é¤ì¤ë¡£
.\"O .SH RETURN VALUE
.SH ÊÖ¤êÃÍ
.\"O On success,
r = recv(fd2, &c, 1, MSG_OOB);
if (r < 1)
- SHUT_FD1;
+ SHUT_FD2;
else
send(fd1, &c, 1, MSG_OOB);
}