[ Team LiB ] Previous Section Next Section

17.3 Socket Operations

Three ioctl requests are explicitly used for sockets (pp. 551–553 of TCPv2). All three require that the third argument to ioctl be a pointer to an integer.

SIOCATMARK

Return through the integer pointed to by the third argument a nonzero value if the socket's read pointer is currently at the out-of-band mark, or a zero value if the read pointer is not at the out-of-band mark. We will describe out-of-band data in more detail in Chapter 24. POSIX replaces this request with the sockatmark function, and we will show an implementation of this new function using ioctl in Section 24.3.

SIOCGPGRP

Return through the integer pointed to by the third argument either the process ID or the process group ID that is set to receive the SIGIO or SIGURG signal for this socket. This request is identical to an fcntl of F_GETOWN, and we note in Figure 7.20 that POSIX standardizes the fcntl.

SIOCSPGRP

Set either the process ID or process group ID to receive the SIGIO or SIGURG signal for this socket from the integer pointed to by the third argument. This request is identical to an fcntl of F_SETOWN, and we note in Figure 7.20 that POSIX standardizes the fcntl.

    [ Team LiB ] Previous Section Next Section