1 '\" te 2 .\" Copyright 1994, The X/Open Company Ltd. All Rights Reserved Portions Copyright 1989 AT&T Portions Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved 3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at 4 .\" http://www.opengroup.org/bookstore/. 5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. 6 .\" This notice shall appear on any product containing this material. 7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. 8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 10 .TH T_RCVUDATA 3NSL "May 7, 1998" 11 .SH NAME 12 t_rcvudata \- receive a data unit 13 .SH SYNOPSIS 14 .LP 15 .nf 16 #include <xti.h> 17 18 19 20 \fBint\fR \fBt_rcvudata\fR(\fBint\fR \fIfd\fR, \fBstruct t_unitdata *\fR\fIunitdata\fR, \fBint *\fR\fIflags\fR); 21 .fi 22 23 .SH DESCRIPTION 24 .sp 25 .LP 26 This routine is part of the \fBXTI\fR interfaces which evolved from the 27 \fBTLI\fR interfaces. \fBXTI\fR represents the future evolution of these 28 interfaces. However, \fBTLI\fR interfaces are supported for compatibility. When 29 using a \fBTLI\fR routine that has the same name as an \fBXTI\fR routine, the 30 \fBtiuser.h\fR header file must be used. Refer to the \fBTLI\fR 31 \fBCOMPATIBILITY\fR section for a description of differences between the two 32 interfaces. 33 .sp 34 .LP 35 This function is used in connectionless-mode to receive a data unit from 36 another transport user. The argument \fIfd\fR identifies the local transport 37 endpoint through which data will be received, \fIunitdata\fR holds information 38 associated with the received data unit, and \fIflags\fR is set on return to 39 indicate that the complete data unit was not received. The argument 40 \fIunitdata\fR points to a \fBt_unitdata\fR structure containing the following 41 members: 42 .sp 43 .in +2 44 .nf 45 \fBstruct netbuf addr; 46 struct netbuf opt; 47 struct netbuf udata;\fR 48 .fi 49 .in -2 50 51 .sp 52 .LP 53 The \fImaxlen\fR field of \fIaddr\fR, \fIopt\fR and \fIudata\fR must be set 54 before calling this function to indicate the maximum size of the buffer for 55 each. If the \fImaxlen\fR field of \fIaddr\fR or \fIopt\fR is set to zero, 56 no information is returned in the \fIbuf\fR field of this parameter. 57 .sp 58 .LP 59 On return from this call, \fIaddr\fR specifies the protocol address of the 60 sending user, \fIopt\fR identifies options that were associated with this data 61 unit, and \fIudata\fR specifies the user data that was received. 62 .sp 63 .LP 64 By default, \fBt_rcvudata()\fR operates in synchronous mode and will wait for a 65 data unit to arrive if none is currently available. However, if 66 \fBO_NONBLOCK\fR is set by means of \fBt_open\fR(3NSL) or \fBfcntl\fR(2), 67 \fBt_rcvudata()\fR will execute in asynchronous mode and will fail if no data 68 units are available. 69 .sp 70 .LP 71 If the buffer defined in the \fIudata\fR field of \fIunitdata\fR is not large 72 enough to hold the current data unit, the buffer will be filled and 73 \fBT_MORE\fR will be set in \fIflags\fR on return to indicate that another 74 \fBt_rcvudata()\fR should be called to retrieve the rest of the data unit. 75 Subsequent calls to \fBt_rcvudata()\fR will return zero for the length of the 76 address and options until the full data unit has been received. 77 .sp 78 .LP 79 If the call is interrupted, \fBt_rcvudata()\fR will return \fBEINTR\fR and no 80 datagrams will have been removed from the endpoint. 81 .SH RETURN VALUES 82 .sp 83 .LP 84 Upon successful completion, a value of \fB0\fR is returned. Otherwise, a 85 value of \(mi1 is returned and \fBt_errno\fR is set to indicate an error. 86 .SH VALID STATES 87 .sp 88 .LP 89 \fBT_IDLE\fR. 90 .SH ERRORS 91 .sp 92 .LP 93 On failure, \fBt_errno\fR is set to one of the following: 94 .sp 95 .ne 2 96 .na 97 \fB\fBTBADF\fR\fR 98 .ad 99 .RS 15n 100 The specified file descriptor does not refer to a transport endpoint. 101 .RE 102 103 .sp 104 .ne 2 105 .na 106 \fB\fBTBUFOVFLW\fR\fR 107 .ad 108 .RS 15n 109 The number of bytes allocated for the incoming protocol address or options 110 \fI(maxlen)\fR is greater than \fB0\fR but not sufficient to store the 111 information. The unit data information to be returned in \fIunitdata\fR will be 112 discarded. 113 .RE 114 115 .sp 116 .ne 2 117 .na 118 \fB\fBTLOOK\fR\fR 119 .ad 120 .RS 15n 121 An asynchronous event has occurred on this transport endpoint and requires 122 immediate attention. 123 .RE 124 125 .sp 126 .ne 2 127 .na 128 \fB\fBTNODATA\fR\fR 129 .ad 130 .RS 15n 131 \fBO_NONBLOCK\fR was set, but no data units are currently available from the 132 transport provider. 133 .RE 134 135 .sp 136 .ne 2 137 .na 138 \fB\fBTNOTSUPPORT\fR\fR 139 .ad 140 .RS 15n 141 This function is not supported by the underlying transport provider. 142 .RE 143 144 .sp 145 .ne 2 146 .na 147 \fB\fBTOUTSTATE\fR\fR 148 .ad 149 .RS 15n 150 The communications endpoint referenced by \fIfd\fR is not in one of the states 151 in which a call to this function is valid. 152 .RE 153 154 .sp 155 .ne 2 156 .na 157 \fB\fBTPROTO\fR\fR 158 .ad 159 .RS 15n 160 This error indicates that a communication problem has been detected between XTI 161 and the transport provider for which there is no other suitable XTI error 162 \fB(t_errno)\fR. 163 .RE 164 165 .sp 166 .ne 2 167 .na 168 \fB\fBTSYSERR\fR\fR 169 .ad 170 .RS 15n 171 A system error has occurred during execution of this function. 172 .RE 173 174 .SH TLI COMPATIBILITY 175 .sp 176 .LP 177 The \fBXTI\fR and \fBTLI\fR interface definitions have common names but use 178 different header files. This, and other semantic differences between the two 179 interfaces are described in the subsections below. 180 .SS "Interface Header" 181 .sp 182 .LP 183 The \fBXTI\fR interfaces use the header file, \fBxti.h\fR. \fBTLI\fR interfaces 184 should \fInot\fR use this header. They should use the header: 185 .br 186 .in +2 187 #include<tiuser.h> 188 .in -2 189 .SS "Error Description Values" 190 .sp 191 .LP 192 The \fBt_errno\fR values that can be set by the \fBXTI\fR interface and cannot 193 be set by the \fBTLI\fR interface are: 194 .br 195 .in +2 196 \fBTPROTO\fR 197 .in -2 198 .br 199 .in +2 200 \fBTOUTSTATE\fR 201 .in -2 202 .sp 203 .LP 204 A \fBt_errno\fR value that this routine can return under different 205 circumstances than its \fBXTI\fR counterpart is \fBTBUFOVFLW.\fR It can be 206 returned even when the \fBmaxlen\fR field of the corresponding buffer has been 207 set to zero. 208 .SS "Option Buffers" 209 .sp 210 .LP 211 The format of the options in an \fBopt\fR buffer is dictated by the transport 212 provider. Unlike the \fBXTI\fR interface, the \fBTLI\fR interface does not fix 213 the buffer format. 214 .SH ATTRIBUTES 215 .sp 216 .LP 217 See \fBattributes\fR(5) for descriptions of the following attributes: 218 .sp 219 220 .sp 221 .TS 222 box; 223 c | c 224 l | l . 225 ATTRIBUTE TYPE ATTRIBUTE VALUE 226 _ 227 MT Level Safe 228 .TE 229 230 .SH SEE ALSO 231 .sp 232 .LP 233 \fBfcntl\fR(2), \fBt_alloc\fR(3NSL), \fBt_open\fR(3NSL), 234 \fBt_rcvuderr\fR(3NSL), \fBt_sndudata\fR(3NSL), \fBattributes\fR(5)