1t_rcvudata(3NSL)     Networking Services Library Functions    t_rcvudata(3NSL)
2
3
4

NAME

6       t_rcvudata - receive a data unit
7

SYNOPSIS

9       #include <xti.h>
10
11
12
13       int t_rcvudata(int fd, struct t_unitdata *unitdata, int *flags);
14
15

DESCRIPTION

17       This  routine  is part of the XTI interfaces which evolved from the TLI
18       interfaces. XTI represents the future evolution  of  these  interfaces.
19       However,  TLI  interfaces are supported for compatibility. When using a
20       TLI routine that has the same name as an  XTI  routine,  the   tiuser.h
21       header  file must be used.  Refer to the  TLI COMPATIBILITY section for
22       a description of differences between the two interfaces.
23
24
25       This function is used in connectionless-mode to  receive  a  data  unit
26       from  another  transport  user.  The  argument  fd identifies the local
27       transport endpoint through which data will be received, unitdata  holds
28       information associated with the received data unit, and flags is set on
29       return to indicate that the complete data unit was  not  received.  The
30       argument  unitdata points to a t_unitdata structure containing the fol‐
31       lowing members:
32
33         struct netbuf addr;
34         struct netbuf opt;
35         struct netbuf udata;
36
37
38
39       The maxlen field of addr, opt and udata must be set before calling this
40       function  to  indicate  the maximum size of the buffer for each. If the
41       maxlen field of  addr or   opt  is  set  to  zero,  no  information  is
42       returned in the  buf field of this parameter.
43
44
45       On  return  from  this call, addr specifies the protocol address of the
46       sending user, opt identifies options that  were  associated  with  this
47       data unit, and udata specifies the user data that was received.
48
49
50       By default, t_rcvudata() operates in synchronous mode and will wait for
51       a data unit to arrive if  none  is  currently  available.  However,  if
52       O_NONBLOCK  is  set by means of  t_open(3NSL) or fcntl(2), t_rcvudata()
53       will execute in asynchronous mode and will fail if no  data  units  are
54       available.
55
56
57       If  the  buffer  defined  in  the  udata field of unitdata is not large
58       enough to hold the current data unit, the buffer  will  be  filled  and
59       T_MORE  will be set in flags on return to indicate that another t_rcvu‐
60       data() should be called to retrieve the rest of the data unit.   Subse‐
61       quent  calls  to  t_rcvudata()  will  return zero for the length of the
62       address and options until the full data unit has been received.
63
64
65       If the call is interrupted, t_rcvudata() will return EINTR and no data‐
66       grams will have been removed from the endpoint.
67

RETURN VALUES

69       Upon  successful  completion,  a value of  0 is returned.  Otherwise, a
70       value of  −1 is returned and t_errno is set to indicate an error.
71

VALID STATES

73       T_IDLE.
74

ERRORS

76       On failure, t_errno is set to one of the following:
77
78       TBADF          The specified file descriptor does not refer to a trans‐
79                      port endpoint.
80
81
82       TBUFOVFLW      The  number of bytes allocated for the incoming protocol
83                      address or options (maxlen) is greater than  0  but  not
84                      sufficient  to  store  the  information.  The  unit data
85                      information to be returned  in  unitdata  will  be  dis‐
86                      carded.
87
88
89       TLOOK          An  asynchronous  event  has  occurred on this transport
90                      endpoint and requires immediate attention.
91
92
93       TNODATA        O_NONBLOCK was set, but  no  data  units  are  currently
94                      available from the transport provider.
95
96
97       TNOTSUPPORT    This  function is not supported by the underlying trans‐
98                      port provider.
99
100
101       TOUTSTATE      The communications endpoint referenced by  fd is not  in
102                      one  of  the  states in which a call to this function is
103                      valid.
104
105
106       TPROTO         This error indicates that a  communication  problem  has
107                      been detected between XTI and the transport provider for
108                      which there is no other suitable XTI error (t_errno).
109
110
111       TSYSERR        A system error has occurred  during  execution  of  this
112                      function.
113
114

TLI COMPATIBILITY

116       The XTI and TLI interface definitions have common names but use differ‐
117       ent header files. This, and other semantic differences between the  two
118       interfaces are described in the subsections below.
119
120   Interface Header
121       The  XTI  interfaces  use the header file, xti.h. TLI interfaces should
122       not use this header.  They should use the header:
123         #include<tiuser.h>
124
125   Error Description Values
126       The t_errno values that can be set by the XTI interface and  cannot  be
127       set by the TLI interface are:
128         TPROTO
129         TOUTSTATE
130
131
132       A  t_errno  value  that this routine can return under different circum‐
133       stances than its XTI counterpart is TBUFOVFLW. It can be returned  even
134       when the maxlen field of the corresponding buffer has been set to zero.
135
136   Option Buffers
137       The format of the options in an opt buffer is dictated by the transport
138       provider. Unlike the XTI interface, the TLI interface does not fix  the
139       buffer format.
140

ATTRIBUTES

142       See attributes(5)  for descriptions of the following attributes:
143
144
145
146
147       ┌─────────────────────────────┬─────────────────────────────┐
148       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
149       ├─────────────────────────────┼─────────────────────────────┤
150       │MT Level                     │Safe                         │
151       └─────────────────────────────┴─────────────────────────────┘
152

SEE ALSO

154       fcntl(2),   t_alloc(3NSL),   t_open(3NSL),   t_rcvuderr(3NSL),  t_sndu‐
155       data(3NSL), attributes(5)
156
157
158
159SunOS 5.11                        7 May 1998                  t_rcvudata(3NSL)
Impressum