sockatmark()

Determine whether a socket is at the out-of-band mark

Synopsis:

#include <sys/socket.h>

int sockatmark( int s );

Arguments:

s
The file descriptor of the socket that you want to check, as returned by socket().

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

The sockatmark() function determines whether the socket specified by s 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 data mark, sockatmark() returns 1 when all data preceding the mark has been read and the out-of-band data mark is the first element in the receive queue.

The sockatmark() function doesn't remove the out-of-band data mark from the stream.

Using this function between receive operations lets an application determine which data comes before and after out-of-band data.

Returns:

0
The socket isn't at the out-of-band data mark.
1
The socket is at the out-of-band data mark.
-1
An error occurred (errno is set).

Errors:

EBADF
Invalid file descriptor s.
ENOTTY
The s argument isn't the file descriptor of a valid socket.

Classification:

POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread No