Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (s and S) sockatmark(2)
NAME
sockatmark - Determines whether a socket is at the out-of-band mark
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/socket.h>
int sockatmark(
int socket);
PARAMETERS
socket Specifies the file descriptor for the socket.
DESCRIPTION
The sockatmark() function determines whether the specified socket is at an out-of-band mark in
its receive queue data. Calls to the sockatmark() function between receive operations allow an
application to determine the position of out-of-band data within its received data.
A call to sockatmark() does not remove the out-of-band data mark from the data stream.
NOTES
A call to the sockatmark() function can be made instead of a call to the ioctl() function with a
request of SIOCATMARK.
RETURN VALUES
If the protocol has marked the data stream and all data preceeding the mark has been read, the
sockatmark() function returns the value 1. If no mark exists or if data precedes the mark in the
receive queue, the function call returns the value 0 (zero).
If the sockatmark() call fails, the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the sockatmark() function sets errno to the
corresponding value:
[EBADF] The socket parameter is not a valid open file descriptor.
[ECONNRESET]
One of the following conditions occurred:
• The transport-provider process for this socket is no longer available.
• The TCP/IP subsystem for this socket is no longer available.
• The connection was forcibly closed by the peer socket.
The socket can only be closed.
[ENOBUFS] There was not enough buffer space available to complete the call. A retry at a
later time might succeed.
[ENOMEM] Required memory resources were not available. A retry at a later time might
succeed.
[ENOTTY] The socket parameter does not refer to a socket.
527186-003 Hewlett-Packard Company 7−69