t_rcvudata.3xti
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3XTI 代码 · 共 134 行
3XTI
134 行
.TH t_rcvudata 3xti.SH Namet_rcvudata \- receive a data unit.SH Syntax.B #include <xti.h>.br.sp 1.B int t_rcvudata(\fIfd, unitdata, flags\fB).br.B int \fIfd\fR;.br.B struct t_unitdata \fI*unitdata\fB;.br.B int \fI*flags\fR:.SH Arguments.IP \fIfd\fR 10Identifies the local transport endpoint through which data is received..IP \fIunitdata\fR 10Holds information associated with the received data unit. The\fIunitdata\fR argument points to a \fBt_unitdata\fR structurecontaining the following members:.EXstruct netbuf \fIaddr\fP;struct netbuf \fIopt\fP;struct netbuf \fIudata\fP.EE.IPOn return from this call, the members have the following meanings:.RS 10.IP \fIaddr\fP 12Specifies the protocol address of the sending unit..IP \fIopt\fPIdentifies protocol-specific options that were associated with this data unit..IP \fIudata\fPSpecifies the user data that was received..IP \fIflags\fR Set on return to indicate that the complete data unit was not received..RE.SH DescriptionThis function is used in connectionless mode to receive a data unit fromanother transport user..NXR "t_rcvudata system call".NXR "connectionless mode" "receiving data".PPBy default, .PN t_rcvudata()operates in synchronous mode waitsfor a data unit to arrive if none is currently available. However, ifO_NONBLOCK is set by means of .PN t_open() or.PN fcntl()\fR,\fR \fIudata\fR executes in asynchronous mode and fails if no data units are available..PPThe \fImaxlen\fR field of \fIaddr\fR, \fIopt\fR, and \fIudata\fR must beset before issuing this function to indicate the maximum size of thebuffer for each..PPIf the buffer defined in the \fIudata\fR field of \fIunitdata\fR is notlarge enough to hold the current data unit, the buffer fillsand T_MORE sets in \fIflags\fR on return to indicate thatanother .PN t_rcvudata() should be issued to retrieve the rest of thedata unit. Subsequent .PN t_rcvudata() calls return zero for the length of the address and options until the full data unit has been received..PP.TStab(@);lfHB lfHB lfHBlfR lfR lfR ._.sp 6pParameters@Before Call@After Call.sp 6p_.sp 6pfd@x@/unitdata->addr.maxlen@x@/unitdata->addr.len@/@xunitdata->addr.buf@x@(x)unitdata->opt.maxlen@x@/unitdata->opt.len@/@xunitdata->opt.buf@x@(x)unitdata->udata.maxlen@x@/unitdata->udata.len@/@xunitdata->udata.buf@x@(x)flags@/@x.sp 6p_.TE.PP.sp 12p.SH Return ValuesUpon successful completion, a value of 0 is returned. On failure, avalue of \-1 is returned, and \fBt_errno\fR is set to indicate theerror..SH DiagnosticsOn failure, \fBt_errno\fR is set to one of the following:.TP 20[TBADF]The specified file descriptor does not refer to a transport endpoint..TP 20 [TOUTSTATE]The function was issued in the wrong sequence on the transport endpointreferenced by \fIfd\fR..TP 20[TNODATA]O_NONBLOCK was set, but no data units are currently available fromthe transport provider..TP 20[TBUFOVFLW]The number of bytes allocated for the incoming protocol address oroptions is not sufficient to store the information. The unit datainformation to be returned in \fIunitdata\fR is discarded..TP 20[TLOOK]An asynchronous event has occurred on the transport endpoint and requires immediate attention..TP 20[TNOTSUPPORT]This function is not supported by the underlying transport provider. .TP 20[TSYSERR]A system error has occurred during execution of this function..SH See Alsofcntl(2), t_alloc(3xti), t_open(3xti),t_rcvuderr(3xti), t_sndudata(3xti)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?