'\"macro stdmacro
.if n .pH g7.connld @(#)connld	40.4 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} connld 7 "" "\&"
.if \nX=1 .ds x} connld 7 ""
.if \nX=2 .ds x} connld 7 "" "\&"
.if \nX=3 .ds x} connld "" "" "\&"
.TH \*(x}
.SH NAME
\f4connld\fP - line discipline for unique stream connections
.SH DESCRIPTION
\f4connld\fP is a \s-1STREAMS\s0-based module that provides unique connections
between server and client processes.
It can only be pushed [see \f4streamio\fP(7)] onto one end of a \s-1STREAMS\s0-based 
pipe that may subsequently be attached to a name in the file system name space.
After the pipe end is attached, a new pipe is created internally when an 
originating process attempts to \f4open\fP(2) or \f4creat\fP(2) the file system 
name.
A file descriptor for one end of the new pipe is packaged into
a message identical to that for the \f4ioctl I_SENDFD\fP [see \f4streamio\fP(7)] 
and is transmitted along the stream to the server process on the 
other end.
The originating process is blocked until the server responds.
.P
The server responds to the \f4I_SENDFD\fP request by accepting the file descriptor
through the \f4I_RECVFD ioctl\fP message.
When this happens, the file descriptor associated with the other end of the
new pipe is transmitted to the originating process as the file descriptor returned 
from \f4open\fP(2) or \f4creat\fP(2).
.P
If the server does not respond to the \f4I_SENDFD\fP request, the stream that
the \f4connld\fP module is pushed on becomes uni-directional because the server 
will not be able to retrieve any data off the stream until the \f4I_RECVFD\fP 
request is issued.
If the server process exits before issuing the \f4I_RECVFD\fP request, the
\f4open\fP(2) or the \f4creat\fP(2) system calls will fail and return -1
to the originating process.
.P
When the \f4connld\fP module is pushed onto a pipe, messages going back and forth 
through the pipe are ignored by \f4connld\fP.
.P
On success, an open of \f4connld\fP returns 0.
On failure, \f4errno\fP is set to the following values:
.TP 13
\f4EINVAL\fP
A stream onto which \f4connld\fP is being pushed is not a pipe or the pipe
does not have a write queue pointer pointing to a stream head read queue.
.TP
\f4EINVAL\fP
The other end of the pipe onto which \f4connld\fP is being pushed is linked
under a multiplexor.
.TP
\f4EPIPE\fP
\f4connld\fP is being pushed onto a pipe end whose other end is no longer
there.
.TP
\f4ENOMEM\fP
An internal pipe could not be created.
.TP
\f4ENXIO\fP
An \f4M_HANGUP\fP message is at the stream head of the pipe onto which
\f4connld\fP is being pushed.
.TP
\f4EAGAIN\fP
Internal data structures could not be allocated.
.TP
\f4ENFILE\fP
A file table entry could not be allocated.
.SH "SEE ALSO"
.nf
\f4streamio\fP(7)
\f2Programmer's Guide: \s-1STREAMS\s0\fP
.fi
.Ee
