1 .\"
   2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
   3 .\" permission to reproduce portions of its copyrighted documentation.
   4 .\" Original documentation from The Open Group can be obtained online at
   5 .\" http://www.opengroup.org/bookstore/.
   6 .\"
   7 .\" The Institute of Electrical and Electronics Engineers and The Open
   8 .\" Group, have given us permission to reprint portions of their
   9 .\" documentation.
  10 .\"
  11 .\" In the following statement, the phrase ``this text'' refers to portions
  12 .\" of the system documentation.
  13 .\"
  14 .\" Portions of this text are reprinted and reproduced in electronic form
  15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
  16 .\" Standard for Information Technology -- Portable Operating System
  17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
  18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
  19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
  20 .\" between these versions and the original IEEE and The Open Group
  21 .\" Standard, the original IEEE and The Open Group Standard is the referee
  22 .\" document.  The original Standard can be obtained online at
  23 .\" http://www.opengroup.org/unix/online.html.
  24 .\"
  25 .\" This notice shall appear on any product containing this material.
  26 .\"
  27 .\" The contents of this file are subject to the terms of the
  28 .\" Common Development and Distribution License (the "License").
  29 .\" You may not use this file except in compliance with the License.
  30 .\"
  31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Portions Copyright 1989 AT&T
  44 .\" Copyright 1994, The X/Open Company Ltd.  All Rights Reserved.
  45 .\" Portions Copyright (c) 1998, Sun Microsystems, Inc.  All Rights Reserved.
  46 .\"
  47 .TH T_SNDVUDATA 3NSL "Aug 23, 2001"
  48 .SH NAME
  49 t_sndvudata \- send a data unit from one or more noncontiguous buffers
  50 .SH SYNOPSIS
  51 .LP
  52 .nf
  53 #include <xti.h>
  54 
  55 
  56 
  57 
  58 \fBint\fR \fBt_sndvudata\fR(\fBint\fR \fIfd\fR, \fBstruct t_unitdata *\fR\fIunitdata\fR, \fBstruct t_iovec  *\fR\fIiov\fR,
  59      \fBunsigned int\fR \fIiovcount\fR);
  60 .fi
  61 
  62 .SH DESCRIPTION
  63 .sp
  64 .LP
  65 This function is used in connectionless mode to send a data unit to another
  66 transport user.  The argument  \fIfd\fR identifies the local transport endpoint
  67 through which data will be sent,  \fIiovcount\fR contains the number of
  68 non-contiguous  \fIudata\fR buffers and is limited to an implementation-defined
  69 value given by  \fBT_IOV_MAX\fR which is at least 16, and  \fIunitdata\fR
  70 points to a  \fBt_unitdata\fR structure containing the following members:
  71 .sp
  72 .in +2
  73 .nf
  74 struct netbuf addr;
  75 struct netbuf opt;
  76 struct netbuf udata;
  77 .fi
  78 .in -2
  79 
  80 .sp
  81 .LP
  82 If the limit on  \fIiovcount\fR is exceeded, the function fails with
  83 \fBTBADDATA\fR.
  84 .sp
  85 .LP
  86 In  \fBunitdata\fR, \fIaddr\fR specifies the protocol address of the
  87 destination user, and  \fIopt\fR identifies options that the user wants
  88 associated with this request. The  \fIudata\fR field is not used.  The user may
  89 choose not to specify what protocol options are associated with the transfer by
  90 setting the  \fIlen\fR field of  \fIopt\fR to zero.  In this case, the provider
  91 may use default options.
  92 .sp
  93 .LP
  94 The data to be sent is identified by  \fIiov\fR\fB[0]\fR\fI\fR through \fIiov
  95 [iovcount-1]\fR\fB\&.\fR
  96 .sp
  97 .LP
  98 Note that the limit on the total number of bytes available in all buffers
  99 passed:
 100 .sp
 101 .in +2
 102 .nf
 103 \fIiov(0).iov_len + . . + iov(iovcount-1).iov_len \fR
 104 .fi
 105 .in -2
 106 
 107 .sp
 108 .LP
 109 may be constrained by implementation limits. If no other constraint applies, it
 110 will be limited by \fBINT_MAX\fR. In practice, the availability of memory to an
 111 application is likely to impose a lower limit on the amount of data that can be
 112 sent or received using scatter/gather functions.
 113 .sp
 114 .LP
 115 By default,  \fBt_sndvudata()\fR operates in synchronous mode and may wait if
 116 flow control restrictions prevent the data from being accepted by the local
 117 transport provider at the time the call is made.  However, if  \fBO_NONBLOCK\fR
 118 is set by means of  \fBt_open\fR(3NSL) or  \fBfcntl\fR(2), \fBt_sndvudata()\fR
 119 executes in asynchronous mode and will fail under such conditions.  The process
 120 can arrange to be notified of the clearance of a flow control restriction by
 121 means of either  \fBt_look\fR(3NSL) or the EM interface.
 122 .sp
 123 .LP
 124 If the amount of data specified in  \fIiov\fR\fB0\fR\fI\fR through \fIiov
 125 [iovcount-1]\fR exceeds the TSDU size as returned in the  \fItsdu\fR field of
 126 the  \fIinfo\fR argument of \fBt_open\fR(3NSL) or  \fBt_getinfo\fR(3NSL), or is
 127 zero and sending of zero octets is not supported by the underlying transport
 128 service, a \fBTBADDATA\fR error is generated.  If  \fBt_sndvudata()\fR is
 129 called before the destination user has activated its transport endpoint (see
 130 \fBt_bind\fR(3NSL)\|), the data unit may be discarded.
 131 .sp
 132 .LP
 133 If it is not possible for the transport provider to immediately detect the
 134 conditions that cause the errors \fBTBADDADDR\fR and \fBTBADOPT\fR, these
 135 errors will alternatively be returned by  \fBt_rcvuderr\fR(3NSL). An
 136 application must therefore be prepared to receive these errors in both of these
 137 ways.
 138 .SH RETURN VALUES
 139 .sp
 140 .LP
 141 Upon successful completion, a value of  \fB0\fR is returned. Otherwise, a value
 142 of  -1 is returned and  \fBt_errno\fR is set to indicate an error.
 143 .SH VALID STATES
 144 .sp
 145 .LP
 146 \fBT_IDLE\fR.
 147 .SH ERRORS
 148 .sp
 149 .LP
 150 On failure,  \fBt_errno\fR is set to one of the following:
 151 .sp
 152 .ne 2
 153 .na
 154 \fB\fBTBADADDR\fR\fR
 155 .ad
 156 .RS 15n
 157 The specified protocol address was in an incorrect format or contained illegal
 158 information.
 159 .RE
 160 
 161 .sp
 162 .ne 2
 163 .na
 164 \fB\fBTBADDATA\fR\fR
 165 .ad
 166 .RS 15n
 167 Illegal amount of data.
 168 .RS +4
 169 .TP
 170 .ie t \(bu
 171 .el o
 172 A single send was attempted specifying a TSDU greater than that specified in
 173 the \fIinfo\fR argument, or a send of a zero byte TSDU is not supported by the
 174 provider.
 175 .RE
 176 .RS +4
 177 .TP
 178 .ie t \(bu
 179 .el o
 180 \fIiovcount\fR is greater than  \fBT_IOV_MAX.\fR
 181 .RE
 182 .RE
 183 
 184 .sp
 185 .ne 2
 186 .na
 187 \fB\fBTBADF\fR\fR
 188 .ad
 189 .RS 15n
 190 The specified file descriptor does not refer to a transport endpoint.
 191 .RE
 192 
 193 .sp
 194 .ne 2
 195 .na
 196 \fB\fBTBADOPT\fR\fR
 197 .ad
 198 .RS 15n
 199 The specified options were in an incorrect  format or contained illegal
 200 information.
 201 .RE
 202 
 203 .sp
 204 .ne 2
 205 .na
 206 \fB\fBTFLOW\fR\fR
 207 .ad
 208 .RS 15n
 209 \fBO_NONBLOCK\fR \fBi\fR was set, but the flow control mechanism prevented the
 210 transport provider from accepting any data at this time.
 211 .RE
 212 
 213 .sp
 214 .ne 2
 215 .na
 216 \fB\fBTLOOK\fR\fR
 217 .ad
 218 .RS 15n
 219 An asynchronous event has occurred on this transport endpoint.
 220 .RE
 221 
 222 .sp
 223 .ne 2
 224 .na
 225 \fB\fBTNOTSUPPORT\fR\fR
 226 .ad
 227 .RS 15n
 228 This function is not supported by the underlying transport provider.
 229 .RE
 230 
 231 .sp
 232 .ne 2
 233 .na
 234 \fB\fBTOUTSTATE\fR\fR
 235 .ad
 236 .RS 15n
 237 The communications endpoint referenced by \fIfd\fR is not in one of the states
 238 in which a call to this function is valid.
 239 .RE
 240 
 241 .sp
 242 .ne 2
 243 .na
 244 \fB\fBTPROTO\fR\fR
 245 .ad
 246 .RS 15n
 247 This error indicates that a communication problem has been detected between XTI
 248 and the transport provider for which there is no other suitable XTI error
 249 \fB(t_errno)\fR.
 250 .RE
 251 
 252 .sp
 253 .ne 2
 254 .na
 255 \fB\fBTSYSERR\fR\fR
 256 .ad
 257 .RS 15n
 258 A system error has occurred during execution of this function.
 259 .RE
 260 
 261 .SH TLI COMPATIBILITY
 262 .sp
 263 .LP
 264 In the \fBTLI\fR interface definition, no counterpart of this routine was
 265 defined.
 266 .SH ATTRIBUTES
 267 .sp
 268 .LP
 269 See \fBattributes\fR(5)  for descriptions of the following attributes:
 270 .sp
 271 
 272 .sp
 273 .TS
 274 box;
 275 c | c
 276 l | l .
 277 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 278 _
 279 MT Level        Safe
 280 .TE
 281 
 282 .SH SEE ALSO
 283 .sp
 284 .LP
 285 \fBfcntl\fR(2), \fBt_alloc\fR(3NSL), \fBt_open\fR(3NSL),
 286 \fBt_rcvudata\fR(3NSL), \fBt_rcvvudata\fR(3NSL) \fBt_rcvuderr\fR(3NSL),
 287 \fBt_sndudata\fR(3NSL), \fBattributes\fR(5)