1 .\" Copyright (c) 2006, Michael Kerrisk (mtk.manpages@gmail.com)
3 .\" %%%LICENSE_START(VERBATIM)
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH SOCKATMARK 3 2014-02-28 "Linux" "Linux Programmer's Manual"
27 sockatmark \- determine whether socket is at out-of-band mark
29 .B #include <sys/socket.h>
31 .BI "int sockatmark(int " sockfd );
34 Feature Test Macro Requirements for glibc (see
35 .BR feature_test_macros (7)):
40 _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
44 returns a value indicating whether or not the socket referred
45 to by the file descriptor
47 is at the out-of-band mark.
48 If the socket is at the mark, then 1 is returned;
49 if the socket is not at the mark, 0 is returned.
50 This function does not remove the out-of-band mark.
54 returns 1 if the socket is at the out-of-band mark, or 0 if it is not.
55 On error, \-1 is returned and
57 is set to indicate the error.
62 is not a valid file descriptor.
65 .\" POSIX.1 says ENOTTY for this case
67 is not a file descriptor to which
72 was added to glibc in version 2.2.4.
74 .SS Multithreading (see pthreads(7))
77 function is thread-safe.
83 returns 1, then the out-of-band data can be read using the
88 Out-of-band data is supported only on some stream socket protocols.
91 can safely be called from a handler for the
96 is implemented using the
105 The following code can be used after receipt of a
107 signal to read (and discard) all data up to the mark,
108 and then read the byte of data at the mark:
116 atmark = sockatmark(sockfd);
118 perror("sockatmark");
125 s = read(sockfd, buf, BUF_LEN) <= 0);
133 if (recv(sockfd, &oobdata, 1, MSG_OOB) == \-1) {
145 This page is part of release 3.79 of the Linux
148 A description of the project,
149 information about reporting bugs,
150 and the latest version of this page,
152 \%http://www.kernel.org/doc/man\-pages/.