receive a data unit
cc [options] file -lnsl
int t_rcvudata(int fd, struct t_unitdata unitdata, int flags);
This function is a TLI/XTI data transfer routine
used in connectionless mode to receive a data unit
from another transport user.
Data is received through the transport endpoint specified
On return, unitdata contains the information
associated with the data unit, and
flags points to a value that indicates whether
the complete data unit was received.
This function is a service of connectionless transport
providers and is supported only if the provider returned
service type T_CLTS on t_open or t_getinfo.
the file descriptor for the transport endpoint through which the
data will be received.
points to the t_unitdata structure associated with
the received data unit.
points to a value set on return if the complete data
unit was not received.
The unitdata argument points to a t_unitdata
structure containing the following members:
struct netbuf addr; /* address */
struct netbuf opt; /* options */
struct netbuf udata; /* user data */
netbuf is described in
maxlen field of
udata must be set before issuing this function to indicate
the maximum size of the buffer for each.
On return from this call,
specifies the protocol address of the sending user,
opt identifies protocol-specific options that were
associated with this data unit, and
udata specifies the user data that was received.
If the buffer defined in the
udata field of
is not large enough to hold the current data unit,
the buffer will be filled and T_MORE will be set in
on return to indicate that another t_rcvudata
should be issued to retrieve the rest of the data unit.
call(s) will return 0 for the length of the address and options
until the full data unit has been received.
On entry, T_IDLE; unchanged on exit.
X/Open® Transport Interface Library (shared object)
Network Services Library (shared object)
By default, t_rcvudata operates in synchronous mode and will
wait for a data unit to arrive if none is currently available.
However, if O_NONBLOCK is set (via t_open
or fcntl), t_rcvudata will execute in asynchronous mode
and will fail if no data units are available.
t_rcvudata returns 0 on successful completion and -1 on failure
and t_errno is set to indicate the error.
On failure, t_errno may be set to one of the following:
The specified file descriptor does not refer to a transport endpoint.
O_NONBLOCK was set, but
no data units are currently available from the transport provider.
The number of bytes (
maxlen) allocated for an incoming argument
is greater than zero but not sufficient to store the value of that argument.
The unit data information to be returned in
will be discarded.
An asynchronous event has occurred on the transport endpoint
specified by fd and requires immediate attention.
This function is not supported by the underlying transport
The function was issued in the wrong sequence
on the transport endpoint referenced by fd.
A system error has occurred during execution of this function.
A communication problem has been detected with the transport provider
and there is no other value of t_errno to describe
the error condition.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004