1t_rcvv(3NSL)         Networking Services Library Functions        t_rcvv(3NSL)
2
3
4

NAME

6       t_rcvv  - receive data or expedited data sent over a connection and put
7       the data into one or more non-contiguous buffers
8

SYNOPSIS

10       #include <xti.h>
11
12
13
14
15       int t_rcvv(int fd, struct t_iovec *iov, unsigned int iovcount, int *flags);
16
17

DESCRIPTION

19       This function receives either normal or expedited data.   The  argument
20       fd  identifies  the  local  transport  endpoint through which data will
21       arrive,  iov points to an array of  buffer  address/buffer  size  pairs
22       (iov_base, iov_len). The  t_rcvv() function receives data into the buf‐
23       fers specified by  iov0.iov_base,  iov1.iov_base,  through   iov  [iov‐
24       count-1].iov_base,  always  filling one buffer before proceeding to the
25       next.
26
27
28       Note that the limit on the total number of bytes available in all  buf‐
29       fers passed:
30
31         iov(0).iov_len + . . + iov(iovcount-1).iov_len)
32
33
34
35       may  be  constrained  by  implementation limits. If no other constraint
36       applies, it will be limited by INT_MAX. In practice,  the  availability
37       of  memory  to  an application is likely to impose a lower limit on the
38       amount of data that can be sent or received using scatter/gather  func‐
39       tions.
40
41
42       The  argument  iovcount contains the number of buffers which is limited
43       to  T_IOV_MAX, which is an implementation-defined value   of  at  least
44       16. If the limit is exceeded, the function will fail with TBADDATA.
45
46
47       The  argument  flags  may be set on return from  t_rcvv() and specifies
48       optional flags as described below.
49
50
51       By default,  t_rcvv() operates in synchronous mode and  will  wait  for
52       data  to arrive if none is currently available. However, if  O_NONBLOCK
53       is set by means of  t_open(3NSL) or  fcntl(2), t_rcvv() will execute in
54       asynchronous  mode  and  will fail if no data is available. See TNODATA
55       below.
56
57
58       On return from the call, if  T_MORE is set  in  flags,  this  indicates
59       that  there  is  more data, and the current transport service data unit
60       (TSDU) or  expedited  transport  service  data  unit  (ETSDU)  must  be
61       received  in multiple  t_rcvv() or t_rcv(3NSL) calls.  In the asynchro‐
62       nous mode,  or under unusual conditions (for example, the arrival of  a
63       signal  or  T_EXDATA event), the  T_MORE flag may be set on return from
64       the  t_rcvv() call even when the number of bytes received is less  than
65       the  total  size  of  all the receive buffers.  Each  t_rcvv() with the
66       T_MORE flag set indicates that another  t_rcvv()  must  follow  to  get
67       more  data  for the current TSDU.  The end of the TSDU is identified by
68       the return of a  t_rcvv() call with the  T_MORE flag not set.   If  the
69       transport  provider does not support the concept of a TSDU as indicated
70       in the  info argument on return from  t_open(3NSL) or  t_getinfo(3NSL),
71       the   T_MORE  flag  is  not  meaningful  and should be ignored.  If the
72       amount of buffer space passed in  iov is greater than zero on the  call
73       to  t_rcvv(), then t_rcvv() will return  0 only if the end of a TSDU is
74       being returned to the user.
75
76
77       On return, the data is expedited if  T_EXPEDITED is set in  flags.   If
78       T_MORE  is  also  set,  it indicates that the number of expedited bytes
79       exceeded nbytes, a signal has interrupted the  call, or that an  entire
80       ETSDU  was  not  available  (only  for transport protocols that support
81       fragmentation of ETSDUs).  The rest of the ETSDU will  be  returned  by
82       subsequent calls to t_rcvv() which will return with  T_EXPEDITED set in
83       flags. The end of the ETSDU is identified by the return of a   t_rcvv()
84       call with  T_EXPEDITED set and  T_MORE cleared.  If the entire ETSDU is
85       not available it is possible for normal data fragments to  be  returned
86       between the initial and final fragments of an ETSDU.
87
88
89       If  a  signal  arrives, t_rcvv() returns, giving the user any data cur‐
90       rently available.  If no data is available,  t_rcvv() returns  -1, sets
91       t_errno  to  TSYSERR  and   errno  to EINTR. If some data is available,
92       t_rcvv() returns the number of bytes received and   T_MORE  is  set  in
93       flags.
94
95
96       In  synchronous  mode,  the only way for the user to be notified of the
97       arrival of normal or expedited data is to issue this function or  check
98       for  the   T_DATA  or T_EXDATA events using the  t_look(3NSL) function.
99       Additionally, the process can arrange to be notified via the EM  inter‐
100       face.
101

RETURN VALUES

103       On  successful  completion,   t_rcvv()  returns  the  number  of  bytes
104       received. Otherwise, it returns  -1 on failure and t_errno  is  set  to
105       indicate the error.
106

VALID STATES

108       T_DATAXFER, T_OUTREL.
109

ERRORS

111       On failure,  t_errno is set to one of the following:
112
113       TBADDATA       iovcount is greater than  T_IOV_MAX.
114
115
116       TBADF          The specified file descriptor does not refer to a trans‐
117                      port endpoint.
118
119
120       TLOOK          An asynchronous event has  occurred  on  this  transport
121                      endpoint and requires immediate attention.
122
123
124       TNODATA        O_NONBLOCK  was  set, but no data is currently available
125                      from the transport provider.
126
127
128       TNOTSUPPORT    This function is not supported by the underlying  trans‐
129                      port provider.
130
131
132       TOUTSTATE      The  communications  endpoint referenced by fd is not in
133                      one of the states in which a call to  this  function  is
134                      valid.
135
136
137       TPROTO         This  error  indicates  that a communication problem has
138                      been detected between XTI and the transport provider for
139                      which there is no other suitable XTI error (t_errno).
140
141
142       TSYSERR        A  system  error  has  occurred during execution of this
143                      function.
144
145

TLI COMPATIBILITY

147       In the TLI interface definition, no counterpart  of  this  routine  was
148       defined.
149

ATTRIBUTES

151       See attributes(5)  for descriptions of the following attributes:
152
153
154
155
156       ┌─────────────────────────────┬─────────────────────────────┐
157       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
158       ├─────────────────────────────┼─────────────────────────────┤
159       │MT Level                     │Safe                         │
160       └─────────────────────────────┴─────────────────────────────┘
161

SEE ALSO

163       fcntl(2),  t_getinfo(3NSL),  t_look(3NSL),  t_open(3NSL),  t_rcv(3NSL),
164       t_snd(3NSL), t_sndv(3NSL), attributes(5)
165
166
167
168SunOS 5.11                        7 May 1998                      t_rcvv(3NSL)
Impressum