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

NAME

6       t_sndv  -  send data or expedited data, from one or more non-contiguous
7       buffers, on a connection
8

SYNOPSIS

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

DESCRIPTION

18       This function is used to send either normal  or  expedited  data.   The
19       argument   fd  identifies  the local transport endpoint over which data
20       should be sent,  iov points to an array of buffer address/buffer length
21       pairs.    t_sndv()  sends  data  contained  in  buffers  iov0 ,  iov1 ,
22       through  iov [iovcount-1]. iovcount contains the number of non-contigu‐
23       ous  data  buffers  which  is limited to  T_IOV_MAX, an implementation-
24       defined value of at least 16.  If the limit is exceeded,  the  function
25       fails with TBADDATA.
26
27         iov(0).iov_len + . . + iov(iovcount-1).iov_len)
28
29
30
31       Note  that the limit on the total number of bytes available in all buf‐
32       fers passed:
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  flags specifies any optional flags described below:
43
44       T_EXPEDITED     If set in flags, the data will  be  sent  as  expedited
45                       data  and will be subject to the interpretations of the
46                       transport provider.
47
48
49       T_MORE          If set in   flags,  this  indicates  to  the  transport
50                       provider  that  the  transport service data unit (TSDU)
51                       (or expedited transport service data unit -  ETSDU)  is
52                       being   sent  through  multiple  t_sndv()  calls.  Each
53                       t_sndv() with  the   T_MORE  flag  set  indicates  that
54                       another  t_sndv() or  t_snd(3NSL) will follow with more
55                       data for the current TSDU (or ETSDU).
56
57
58
59       The end of the TSDU (or ETSDU) is identified by a  t_sndv()  call  with
60       the   T_MORE  flag  not set.  Use of  T_MORE enables a user to break up
61       large logical data units without losing the boundaries of  those  units
62       at the other end of the connection.  The flag implies nothing about how
63       the data is packaged for transfer below the  transport  interface.   If
64       the  transport provider does not support the concept of a TSDU as indi‐
65       cated in the  info argument on  return  from   t_open(3NSL)  or  t_get‐
66       info(3NSL),  the   T_MORE flag is not meaningful and will be ignored if
67       set.
68
69
70       The sending of a zero-length fragment of a TSDU or ETSDU is  only  per‐
71       mitted  where this is used to indicate the end of a TSDU or ETSDU, that
72       is, when the  T_MORE flag is not set.  Some  transport  providers  also
73       forbid zero-length TSDUs and ETSDUs.
74
75
76       If  set  in flags, requests that the provider transmit all data that it
77       has accumulated but not sent.  The request is a  local  action  on  the
78       provider  and  does  not  affect any similarly named protocol flag (for
79       example, the TCP PUSH flag). This effect of setting this flag is proto‐
80       col‐dependent,  and  it  may be ignored entirely by transport providers
81       which do not support the use of this feature.
82
83
84       The communications provider is free to collect data in  a  send  buffer
85       until it accumulates a sufficient amount for transmission.
86
87
88       By default,  t_sndv() operates in synchronous mode and may wait if flow
89       control restrictions prevent the data from being accepted by the  local
90       transport  provider  at the time the call is made.  However, if  O_NON‐
91       BLOCK is set by means of t_open(3NSL) or  fcntl(2),  t_sndv()  executes
92       in  asynchronous mode, and will fail immediately if there are flow con‐
93       trol restrictions.  The process can arrange to  be  informed  when  the
94       flow control restrictions are cleared via either t_look(3NSL) or the EM
95       interface.
96
97
98       On  successful  completion,   t_sndv()  returns  the  number  of  bytes
99       accepted by the transport provider.  Normally this will equal the total
100       number of bytes to be sent, that is,
101
102         (iov0.iov_len + .. + iov[iovcount-1].iov_len)
103
104
105
106       However, the interface is constrained to send at most  INT_MAX bytes in
107       a  single  send.   When  t_sndv() has submitted  INT_MAX (or lower con‐
108       strained value, see the note above) bytes to the provider for a  single
109       call,  this  value is returned to the user.   However, if O_NONBLOCK is
110       set or the function is interrupted by a signal,  it  is  possible  that
111       only  part of the data has actually been accepted by the communications
112       provider.  In this case,  t_sndv() returns a value that  is  less  than
113       the  value of nbytes.  If t_sndv() is interrupted by a signal before it
114       could transfer data to the communications provider, it returns  -1 with
115       t_errno set to TSYSERR and  errno set to EINTR.
116
117
118       If the number of bytes of data in the  iov array is zero and sending of
119       zero octets is not  supported  by  the  underlying  transport  service,
120       t_sndv() returns  -1 with t_errno set to TBADDATA.
121
122
123       The size of each TSDU or ETSDU must not exceed the limits of the trans‐
124       port provider as specified by the current values in the TSDU  or  ETSDU
125       fields in the  info argument returned by t_getinfo(3NSL).
126
127
128       The  error  TLOOK  is  returned for asynchronous events. It is required
129       only for an incoming disconnect event but may  be  returned  for  other
130       events.
131

RETURN VALUES

133       On  successful  completion,   t_sndv()  returns  the  number  of  bytes
134       accepted by the transport provider.   Otherwise,   -1  is  returned  on
135       failure and  t_errno is set to indicate the error.
136
137
138       Note  that in synchronous mode, if more than  INT_MAX bytes of data are
139       passed in the  iov array, only the first  INT_MAX bytes will be  passed
140       to the provider.
141
142
143       If  the number of bytes accepted by the communications provider is less
144       than the number of bytes  requested,  this  may  either  indicate  that
145       O_NONBLOCK  is  set  and  the communications provider is blocked due to
146       flow control, or that  O_NONBLOCK is clear and the function was  inter‐
147       rupted by a signal.
148

VALID STATES

150       T_DATAXFER, T_INREL.
151

ERRORS

153       On failure,  t_errno is set to one of the following:
154
155       TBADDATA    Illegal amount of data:
156
157
158       TBADF          The specified file descriptor does not refer to a trans‐
159                      port endpoint.
160
161                          o      A single send was attempted specifying a TSDU
162                                 (ETSDU) or fragment TSDU (ETSDU) greater than
163                                 that specified by the current values  of  the
164                                 TSDU or ETSDU fields in the  info argument.
165
166                          o      A  send  of  a zero byte TSDU (ETSDU) or zero
167                                 byte fragment of a TSDU (ETSDU) is  not  sup‐
168                                 ported by the provider.
169
170                          o      Multiple  sends were attempted resulting in a
171                                 TSDU (ETSDU) larger than  that  specified  by
172                                 the current value of the TSDU or ETSDU fields
173                                 in the  info argument - the ability of an XTI
174                                 implementation  to  detect such an error case
175                                 is  implementation-dependent.  See  WARNINGS,
176                                 below.
177
178                          o      iovcount is greater than  T_IOV_MAX.
179
180
181       TBADFLAG       An invalid flag was specified.
182
183
184       TFLOW          O_NONBLOCK  was set, but the flow control mechanism pre‐
185                      vented the transport provider from accepting any data at
186                      this time.
187
188
189       TLOOK          An  asynchronous  event  has  occurred on this transport
190                      endpoint.
191
192
193       TNOTSUPPORT    This function is not supported by the underlying  trans‐
194                      port provider.
195
196
197       TOUTSTATE      The  communications  endpoint referenced by fd is not in
198                      one of the states in which a call to  this  function  is
199                      valid.
200
201
202       TPROTO         This  error  indicates  that a communication problem has
203                      been detected between XTI and the transport provider for
204                      which there is no other suitable XTI error (t_errno).
205
206
207       TSYSERR        A  system  error  has  occurred during execution of this
208                      function.
209
210

TLI COMPATIBILITY

212       In the TLI interface definition, no counterpart  of  this  routine  was
213       defined.
214

ATTRIBUTES

216       See attributes(5)  for descriptions of the following attributes:
217
218
219
220
221       ┌─────────────────────────────┬─────────────────────────────┐
222       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
223       ├─────────────────────────────┼─────────────────────────────┤
224       │MT Level                     │Safe                         │
225       └─────────────────────────────┴─────────────────────────────┘
226

SEE ALSO

228       t_getinfo(3NSL),  t_open(3NSL),  t_rcvv(3NSL) t_rcv(3NSL), t_snd(3NSL),
229       attributes(5)
230

WARNINGS

232       It is important to remember that  the  transport  provider  treats  all
233       users  of  a  transport endpoint as a single user. Therefore if several
234       processes issue concurrent  t_sndv() or  t_snd(3NSL)  calls,  then  the
235       different data may be intermixed.
236
237
238       Multiple  sends  which exceed the maximum TSDU or ETSDU size may not be
239       discovered by XTI.  In this case an implementation-dependent error will
240       result  (generated  by the transport provider), perhaps on a subsequent
241       XTI call.  This error may take the form of a connection abort,  a  TSY‐
242       SERR, a TBADDATA or a TPROTO error.
243
244
245       If  multiple  sends  which  exceed  the  maximum TSDU or ETSDU size are
246       detected by XTI,  t_sndv() fails with TBADDATA.
247
248
249
250SunOS 5.11                        23 Aug 2001                     t_sndv(3NSL)
Impressum