aboutsummaryrefslogtreecommitdiffstats
path: root/man7/unix.7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2010-09-10 06:00:39 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2010-09-10 06:02:16 +0200
commitfbea0f8160fc322fe97a02fa0fd9dc7ac568ada4 (patch)
tree0bfb7961743b47d36f0ae10135c1ce0c461c70c3 /man7/unix.7
parent00c84453849be5e0791f4eb5f8c7865ab8c43b2d (diff)
downloadman-pages-fbea0f8160fc322fe97a02fa0fd9dc7ac568ada4.tar.gz
unix.7: Document SIOCINQ ioctl() operation
Reported-by: Jim Belton <jim.belton@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/unix.7')
-rw-r--r--man7/unix.740
1 files changed, 39 insertions, 1 deletions
diff --git a/man7/unix.7 b/man7/unix.7
index ad48c2e0a0..b891905de6 100644
--- a/man7/unix.7
+++ b/man7/unix.7
@@ -12,7 +12,7 @@
.\" address that can appear in the sockaddr_un structure: pathname,
.\" unnamed, and abstract.
.\"
-.TH UNIX 7 2008-12-01 "Linux" "Linux Programmer's Manual"
+.TH UNIX 7 2010-09-10 "Linux" "Linux Programmer's Manual"
.SH NAME
unix, AF_UNIX, AF_LOCAL \- Sockets for local
interprocess communication
@@ -253,6 +253,44 @@ To receive a
message the
.B SO_PASSCRED
option must be enabled on the socket.
+.SS Ioctls
+The following
+.BR ioctl (2)
+calls return information in
+.IR value .
+The correct syntax is:
+.PP
+.RS
+.nf
+.BI int " value";
+.IB error " = ioctl(" tcp_socket ", " ioctl_type ", &" value ");"
+.fi
+.RE
+.PP
+.I ioctl_type
+can be:
+.TP
+.B SIOCINQ
+Returns the amount of queued unread data in the receive buffer.
+The socket must not be in LISTEN state, otherwise an error
+.RB ( EINVAL )
+is returned.
+.B SIOCINQ
+is defined in
+.IR <linux/sockios.h> .
+.\" FIXME http://sources.redhat.com/bugzilla/show_bug.cgi?id=12002,
+.\" filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers
+Alternatively,
+you can use the synonymous
+.BR FIONREAD ,
+defined in
+.IR <sys/ioctl.h> .
+.\" SIOCOUTQ also has an effect for UNIX doamin sockets, but not
+.\" quite what userland might expect. It seems to return the number
+.\" of bytes allocated for buffers containing pending output.
+.\" That number is normally larger than the number of bytes of pending
+.\" output. Since this info is, from userland's point of view, imprecise,
+.\" and it may well change, probably best not to document this now.
.SH ERRORS
.TP
.B EADDRINUSE