sockatmark(3N)sockatmark(3N)NAMEsockatmark() - determine whether a socket is at the out-of-band mark
SYNOPSISDESCRIPTION
The function determines whether the socket specified by the descriptor
is at the out-of-band data mark.
If the protocol for the socket supports out-of-band data by marking the
stream with an out-of-band mark, the function returns 1 when all data
preceding the mark has been read and the out-of-band mark is the first
element in the receive queue. The function does not remove the mark
from the stream.
X/Open Sockets Only
is new in
RETURN VALUES
Upon successful completion, the function returns a value indicating
whether the socket is at an out-of-band data mark:
If the protocol has marked the data stream and all data preceding
the mark has
been read.
If there is no mark, or if data
precedes the mark in the receive queue.
On failure, returns and sets to indicate the error.
ERRORS
If fails, is set to one of the following values:
The argument is not a valid file descriptor.
The argument does not specify a descriptor for a socket.
APPLICATION USAGE
The use of this function between receive operations allows an applica‐
tion to determine which received data precedes the out-of-band data and
which follows the out-of-band data.
There is an inherent race condition in the use of this function. On an
empty receive queue, the current read of the location might be at the
"mark". However, the system has no way of knowing that the next data
segment arriving from the network is carrying the mark. Then returns
false, and the next read operation silently consumes the mark.
Hence, this function can only be used reliably in one or both ways:
· when the application already knows that the out-of-band data has
been seen by the system
· and that it knows data is waiting to be read at the socket (by
using or
AUTHOR
was developed by HP and IEEE.
SEE ALSOioctl(2), pselect(2), recv(2), recvmsg(2), socket(7).
STANDARDS CONFORMANCEsockatmark(3N)