1 .\" Copyright (c) 2006, Michael Kerrisk (mtk.manpages@gmail.com)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
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
27 .TH SOCKATMARK 3 2008-12-03 "Linux" "Linux Programmer's Manual"
30 .\"O sockatmark \- determine whether socket is at out-of-band mark
31 sockatmark \- どのソケットに帯域外 (out-of-band) マークが付けられているかを調べる
34 .B #include <sys/socket.h>
36 .BI "int sockatmark(int " sockfd );
39 .\"O Feature Test Macro Requirements for glibc (see
40 .\"O .BR feature_test_macros (7)):
42 .RB ( feature_test_macros (7)
48 _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
52 .\"O .BR sockatmark ()
53 .\"O returns a value indicating whether or not the socket referred
54 .\"O to by the file descriptor
56 .\"O is at the out-of-band mark.
60 で参照されるソケットに帯域外マークが付けられているか否かを返す。
61 .\"O If the socket is at the mark, then 1 is returned;
62 .\"O if the socket is not at the mark, 0 is returned.
63 .\"O This function does not remove the out-of-band mark.
64 ソケットにマークが付けられている場合は、1 が返される。
65 ソケットにマークが付けられていない場合は、0 が返される。
67 .\"O .SH "RETURN VALUE"
69 .\"O A successful call to
70 .\"O .BR sockatmark ()
71 .\"O returns 1 if the socket is at the out-of-band mark, or 0 if it is not.
72 .\"O On error, \-1 is returned and \fIerrno\fP is set to indicate the error.
74 の呼び出しが成功した場合、ソケットに帯域外マークが
75 付けられていれば 1 を返し、付けられていなければ 0 を返す。
76 エラーの場合は \-1 が返され、エラーを表す \fIerrno\fP が設定される。
82 .\"O is not a valid file descriptor.
87 .\" POSIX.1 says ENOTTY for this case
89 .\"O is not a file descriptor to which
90 .\"O .BR sockatmark ()
95 が適用できないファイルディスクリプタである。
98 .\"O .BR sockatmark ()
99 .\"O was added to glibc in version 2.2.4.
101 は glibc バージョン 2.2.4 で追加された。
102 .\"O .SH "CONFORMING TO"
108 .\"O .BR sockatmark ()
109 .\"O returns 1, then the out-of-band data can be read using the
120 .\"O Out-of-band data is only supported on some stream socket protocols.
121 帯域外データは、いくつかのストリームソケットプロトコルでしか
124 .\"O .BR sockatmark ()
125 .\"O can safely be called from a handler for the
131 シグナルのハンドラから安全に呼び出すことができる。
133 .\"O .BR sockatmark ()
134 .\"O is implemented using the
145 .\"O Prior to glibc 2.4,
146 .\"O .BR sockatmark ()
148 glibc 2.4 より前のバージョンでは、
153 .\"O The following code can be used after receipt of a
155 .\"O signal to read (and discard) all data up to the mark,
156 .\"O and then read the byte of data at the mark:
159 シグナルを受け取った後にマークまでの全てのデータを読み込んで (破棄し)、
160 マークされたデータのバイトを読み込むのに使用できる。
168 atmark = sockatmark(sockfd);
170 perror("sockatmark");
177 s = read(sockfd, buf, BUF_LEN) <= 0);
185 if (recv(sockfd, &oobdata, 1, MSG_OOB) == \-1) {