OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / release / man3 / sockatmark.3
1 .\" Copyright (c) 2006, Michael Kerrisk (mtk.manpages@gmail.com)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2006 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated 2006-08-01 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.36
26 .\"
27 .TH SOCKATMARK 3 2008-12-03 "Linux" "Linux Programmer's Manual"
28 .SH Ì¾Á°
29 sockatmark \- ¤É¤Î¥½¥±¥Ã¥È¤ËÂÓ°è³° (out-of-band) ¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë
30 .SH ½ñ¼°
31 .B #include <sys/socket.h>
32 .sp
33 .BI "int sockatmark(int " sockfd );
34 .sp
35 .in -4n
36 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
37 .RB ( feature_test_macros (7)
38 »²¾È):
39 .in
40 .sp
41 .ad l
42 .BR sockatmark ():
43 _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
44 .ad b
45 .SH ÀâÌÀ
46 .BR sockatmark ()
47 ¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
48 .I sockfd
49 ¤Ç»²¾È¤µ¤ì¤ë¥½¥±¥Ã¥È¤ËÂÓ°è³°¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¤«Èݤ«¤òÊÖ¤¹¡£
50 ¥½¥±¥Ã¥È¤Ë¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢1 ¤¬ÊÖ¤µ¤ì¤ë¡£
51 ¥½¥±¥Ã¥È¤Ë¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢0 ¤¬ÊÖ¤µ¤ì¤ë¡£
52 ¤³¤Î´Ø¿ô¤ÏÂÓ°è³°¥Þ¡¼¥¯¤òºï½ü¤·¤Ê¤¤¡£
53 .SH ÊÖ¤êÃÍ
54 .BR sockatmark ()
55 ¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¾ì¹ç¡¢¥½¥±¥Ã¥È¤ËÂÓ°è³°¥Þ¡¼¥¯¤¬
56 ÉÕ¤±¤é¤ì¤Æ¤¤¤ì¤Ð 1 ¤òÊÖ¤·¡¢ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð 0 ¤òÊÖ¤¹¡£
57 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢¥¨¥é¡¼¤òɽ¤¹ \fIerrno\fP ¤¬ÀßÄꤵ¤ì¤ë¡£
58 .SH ¥¨¥é¡¼
59 .TP
60 .B EBADF
61 .I sockfd
62 ¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
63 .TP
64 .B EINVAL
65 .\" POSIX.1 says ENOTTY for this case
66 .I sockfd
67 ¤Ï
68 .BR sockatmark ()
69 ¤¬Å¬ÍѤǤ­¤Ê¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£
70 .SH ¥Ð¡¼¥¸¥ç¥ó
71 .BR sockatmark ()
72 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2.4 ¤ÇÄɲ䵤줿¡£
73 .SH ½àµò
74 POSIX.1-2001.
75 .SH Ãí°Õ
76 .BR sockatmark ()
77 ¤¬ 1 ¤òÊÖ¤¹¾ì¹ç¡¢ÂÓ°è³°¥Ç¡¼¥¿¤Ï
78 .B MSG_OOB
79 ¤ò»ØÄꤷ¤¿
80 .BR recv (2)
81 ¤ÇÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£
82
83 ÂÓ°è³°¥Ç¡¼¥¿¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥¹¥È¥ê¡¼¥à¥½¥±¥Ã¥È¥×¥í¥È¥³¥ë¤Ç¤·¤«
84 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
85
86 .BR sockatmark ()
87 ¤Ï
88 .B SIGURG
89 ¥·¥°¥Ê¥ë¤Î¥Ï¥ó¥É¥é¤«¤é°ÂÁ´¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
90
91 .BR sockatmark ()
92 ¤Ï
93 .B SIOCATMARK
94 .BR ioctl (2)
95 Áàºî¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
96 .SH ¥Ð¥°
97 glibc 2.4 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
98 .BR sockatmark ()
99 ¤ÏÆ°ºî¤·¤Ê¤¤¡£
100 .SH Îã
101 °Ê²¼¤Î¥³¡¼¥É¤Ï¡¢
102 .B SIGURG
103 ¥·¥°¥Ê¥ë¤ò¼õ¤±¼è¤Ã¤¿¸å¤Ë¥Þ¡¼¥¯¤Þ¤Ç¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ó¤Ç (ÇË´þ¤·)¡¢
104 ¥Þ¡¼¥¯¤µ¤ì¤¿¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¤òÆɤ߹þ¤à¤Î¤Ë»ÈÍѤǤ­¤ë¡£
105 .nf
106
107     char buf[BUF_LEN];
108     char oobdata;
109     int atmark, s;
110
111     for (;;) {
112         atmark = sockatmark(sockfd);
113         if (atmark == \-1) {
114             perror("sockatmark");
115             break;
116         }
117
118         if (atmark)
119             break;
120
121         s = read(sockfd, buf, BUF_LEN) <= 0);
122         if (s == \-1)
123             perror("read");
124         if (s <= 0)
125             break;
126     }
127
128     if (atmark == 1) {
129         if (recv(sockfd, &oobdata, 1, MSG_OOB) == \-1) {
130             perror("recv");
131             ...
132         }
133     }
134 .fi
135 .SH ´ØÏ¢¹àÌÜ
136 .BR fcntl (2),
137 .BR recv (2),
138 .BR send (2),
139 .BR tcp (7)