t_sndudata(S) (TLI/XTI) 6 January 1993 t_sndudata(S) Name t_sndudata - send a data unit Syntax TLI syntax cc . . . -lnsls #include <sys/tiuser.h> int t_sndudata (fd, unitdata) int fd; struct t_unitdata *unitdata; XTI syntax cc . . . -lxti #include <xti.h> int t_sndudata (fd, unitdata) int fd; struct t_unitdata *unitdata; Description This function is used in connectionless mode to send a data unit to another transport user. fd identifies the local transport endpoint through which data is sent, and unitdata points to a tunitdata structure containing the following members: struct netbuf addr; struct netbuf opt; struct netbuf udata; netbuf is described in netbut(FP). In unitdata, addr specifies the pro- tocol address of the destination user, opt identifies protocol-specific options that the user wants associated with this request, and udata specifies the user data to be sent. The user may choose not to specify what protocol options are associated with the transfer by setting the len field of opt to zero. In this case, the provider may use default options. If the len field of udata is zero, no data unit is passed to the trans- port provider; tsndudata does not send zero-length data units. By default, tsndudata operates in synchronous mode and may wait if flow control restrictions prevent the data from being accepted by the local transport provider at the time the call is made. However, if ONONBLOCK is set (via topen or fcntl), tsndudata executes in asynchronous mode and fails under such conditions. If tsndudata is issued from an invalid state, or if the amount of data specified in udata exceeds the TSDU size as returned by topen or tgetinfo, the provider generates an EPROTO protocol error. (See TSYSERR below.) Return value The tsndudata function returns 0 on successful completion and -1 on failure, and terrno is set to indicate the error. Diagnostics On failure, terrno may be set to one of the following: [TBADDATA] (XTI only.) Bad data was detected. [TBADF] The specified file descriptor does not refer to a transport endpoint. [TFLOW] ONONBLOCK was set, but the flow control mechanism prevented the transport provider from accepting data at this time. [TLOOK] (XTI only.) A datagram error occurred on this transport endpoint. [TNOTSUPPORT] The use of the TCLTS service type is not supported by the underlying transport provider. [TOUTSTATE] The function was issued in the wrong sequence on the transport endpoint referenced by fd. [TSYSERR] A system error occurred during execution of this func- tion. One possibility is a protocol error and is indi- cated by EPROTO being set in errno. Another possibil- ity is an I/O error and is indicated by EIO being set in errno. See also netbuf(FP), trcvudata(S), trcvuderr(S) Standards conformance tsndudata is conformant with: AT&T SVID Issue 2; X/Open Portability Guide, Issue 3, 1989; and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2).