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 .LP 64 This function is used in connectionless mode to send a data unit to another 65 transport user. The argument \fIfd\fR identifies the local transport endpoint 66 through which data will be sent, \fIiovcount\fR contains the number of 67 non-contiguous \fIudata\fR buffers and is limited to an implementation-defined 68 value given by \fBT_IOV_MAX\fR which is at least 16, and \fIunitdata\fR 69 points to a \fBt_unitdata\fR structure containing the following members: 70 .sp 71 .in +2 72 .nf 73 struct netbuf addr; 74 struct netbuf opt; 75 struct netbuf udata; 76 .fi 77 .in -2 78 79 .sp 80 .LP 81 If the limit on \fIiovcount\fR is exceeded, the function fails with 82 \fBTBADDATA\fR. 83 .sp 84 .LP 85 In \fBunitdata\fR, \fIaddr\fR specifies the protocol address of the 86 destination user, and \fIopt\fR identifies options that the user wants 87 associated with this request. The \fIudata\fR field is not used. The user may 88 choose not to specify what protocol options are associated with the transfer by 89 setting the \fIlen\fR field of \fIopt\fR to zero. In this case, the provider 90 may use default options. 91 .sp 92 .LP 93 The data to be sent is identified by \fIiov\fR\fB[0]\fR\fI\fR through \fIiov 94 [iovcount-1]\fR\fB\&.\fR 95 .sp 96 .LP 97 Note that the limit on the total number of bytes available in all buffers 98 passed: 99 .sp 100 .in +2 101 .nf 102 \fIiov(0).iov_len + . . + iov(iovcount-1).iov_len \fR 103 .fi 104 .in -2 105 106 .sp 107 .LP 108 may be constrained by implementation limits. If no other constraint applies, it 109 will be limited by \fBINT_MAX\fR. In practice, the availability of memory to an 110 application is likely to impose a lower limit on the amount of data that can be 111 sent or received using scatter/gather functions. 112 .sp 113 .LP 114 By default, \fBt_sndvudata()\fR operates in synchronous mode and may wait if 115 flow control restrictions prevent the data from being accepted by the local 116 transport provider at the time the call is made. However, if \fBO_NONBLOCK\fR 117 is set by means of \fBt_open\fR(3NSL) or \fBfcntl\fR(2), \fBt_sndvudata()\fR 118 executes in asynchronous mode and will fail under such conditions. The process 119 can arrange to be notified of the clearance of a flow control restriction by 120 means of either \fBt_look\fR(3NSL) or the EM interface. 121 .sp 122 .LP 123 If the amount of data specified in \fIiov\fR\fB0\fR\fI\fR through \fIiov 124 [iovcount-1]\fR exceeds the TSDU size as returned in the \fItsdu\fR field of 125 the \fIinfo\fR argument of \fBt_open\fR(3NSL) or \fBt_getinfo\fR(3NSL), or is 126 zero and sending of zero octets is not supported by the underlying transport 127 service, a \fBTBADDATA\fR error is generated. If \fBt_sndvudata()\fR is 128 called before the destination user has activated its transport endpoint (see 129 \fBt_bind\fR(3NSL)\|), the data unit may be discarded. 130 .sp 131 .LP 132 If it is not possible for the transport provider to immediately detect the 133 conditions that cause the errors \fBTBADADDR\fR and \fBTBADOPT\fR, these 134 errors will alternatively be returned by \fBt_rcvuderr\fR(3NSL). An 135 application must therefore be prepared to receive these errors in both of these 136 ways. 137 .SH RETURN VALUES 138 .LP 139 Upon successful completion, a value of \fB0\fR is returned. Otherwise, a value 140 of -1 is returned and \fBt_errno\fR is set to indicate an error. 141 .SH VALID STATES 142 .LP 143 \fBT_IDLE\fR. 144 .SH ERRORS 145 .LP 146 On failure, \fBt_errno\fR is set to one of the following: 147 .sp 148 .ne 2 149 .na 150 \fB\fBTBADADDR\fR\fR 151 .ad 152 .RS 15n 153 The specified protocol address was in an incorrect format or contained illegal 154 information. 155 .RE 156 157 .sp 158 .ne 2 159 .na 160 \fB\fBTBADDATA\fR\fR 161 .ad 162 .RS 15n 163 Illegal amount of data. 164 .RS +4 165 .TP 166 .ie t \(bu 167 .el o 168 A single send was attempted specifying a TSDU greater than that specified in 169 the \fIinfo\fR argument, or a send of a zero byte TSDU is not supported by the 170 provider. 171 .RE 172 .RS +4 173 .TP 174 .ie t \(bu 175 .el o 176 \fIiovcount\fR is greater than \fBT_IOV_MAX.\fR 177 .RE 178 .RE 179 180 .sp 181 .ne 2 182 .na 183 \fB\fBTBADF\fR\fR 184 .ad 185 .RS 15n 186 The specified file descriptor does not refer to a transport endpoint. 187 .RE 188 189 .sp 190 .ne 2 191 .na 192 \fB\fBTBADOPT\fR\fR 193 .ad 194 .RS 15n 195 The specified options were in an incorrect format or contained illegal 196 information. 197 .RE 198 199 .sp 200 .ne 2 201 .na 202 \fB\fBTFLOW\fR\fR 203 .ad 204 .RS 15n 205 \fBO_NONBLOCK\fR \fBi\fR was set, but the flow control mechanism prevented the 206 transport provider from accepting any data at this time. 207 .RE 208 209 .sp 210 .ne 2 211 .na 212 \fB\fBTLOOK\fR\fR 213 .ad 214 .RS 15n 215 An asynchronous event has occurred on this transport endpoint. 216 .RE 217 218 .sp 219 .ne 2 220 .na 221 \fB\fBTNOTSUPPORT\fR\fR 222 .ad 223 .RS 15n 224 This function is not supported by the underlying transport provider. 225 .RE 226 227 .sp 228 .ne 2 229 .na 230 \fB\fBTOUTSTATE\fR\fR 231 .ad 232 .RS 15n 233 The communications endpoint referenced by \fIfd\fR is not in one of the states 234 in which a call to this function is valid. 235 .RE 236 237 .sp 238 .ne 2 239 .na 240 \fB\fBTPROTO\fR\fR 241 .ad 242 .RS 15n 243 This error indicates that a communication problem has been detected between XTI 244 and the transport provider for which there is no other suitable XTI error 245 \fB(t_errno)\fR. 246 .RE 247 248 .sp 249 .ne 2 250 .na 251 \fB\fBTSYSERR\fR\fR 252 .ad 253 .RS 15n 254 A system error has occurred during execution of this function. 255 .RE 256 257 .SH TLI COMPATIBILITY 258 .LP 259 In the \fBTLI\fR interface definition, no counterpart of this routine was 260 defined. 261 .SH ATTRIBUTES 262 .LP 263 See \fBattributes\fR(5) for descriptions of the following attributes: 264 .sp 265 266 .sp 267 .TS 268 box; 269 c | c 270 l | l . 271 ATTRIBUTE TYPE ATTRIBUTE VALUE 272 _ 273 MT Level Safe 274 .TE 275 276 .SH SEE ALSO 277 .LP 278 \fBfcntl\fR(2), \fBt_alloc\fR(3NSL), \fBt_open\fR(3NSL), 279 \fBt_rcvudata\fR(3NSL), \fBt_rcvvudata\fR(3NSL) \fBt_rcvuderr\fR(3NSL), 280 \fBt_sndudata\fR(3NSL), \fBattributes\fR(5)