Receive data or expedited data sent over a connection.
X/Open Transport Interface Library (libxti.a)
#include <xti.h> int t_rcv ( int fd, void *buf, unsigned int nbytes, int *flags)
The t_rcv subroutine receives either normal or expedited data. By default, the t_rcv subroutine operates in synchronous mode and waits for data to arrive if none is currently available. However, if O_NONBLOCK is set via the t_open subroutine or the fcntl parameter, the, t_rcv subroutine executes in asynchronous mode and fails if no data is available. (See the TNODATA error in "Error Codes" below.)
|fd||Identifies the local transport endpoint through which data will arrive.|
|buf||Points to a receive buffer where user data will be placed.|
|nbytes||Specifies the size of the receive buffer.|
|flags||Specifies optional flags. This parameter may be set on return from
the t_rcv subroutine. The possible values are:
On successful completion, the t_rcv subroutine returns the number of bytes received. Otherwise, it returns -1 on failure and t_errno is set to indicate the error.
On failure, t_errno is
set to one of the following:
|TBADF||The specified file descriptor does not refer to a transport endpoint.|
|TLOOK||An asynchronous event has occurred on this transport endpoint and requires immediate attention.|
|TNODATA||O_NONBLOCK was set, but no data is currently available from the transport provider.|
|TNOTSUPPORT||This subroutine is not supported by the underlying transport provider.|
|TOUTSTATE||The subroutine was issued in the wrong sequence on the transport endpoint referenced by the fd parameter.|
|TPROTO||This error indicates that a communication problem has been detected between the X/Open Transport Interface and the transport provider for which there is no other suitable X/Open Transport Interface (t_errno).|
|TSYSERR||A system error has occurred during execution of this subroutine.|
The fcntl subroutine, t_getinfo subroutine, t_look subroutine, t_open subroutine, t_snd subroutine.