|
|
#include <sys/tiuser.h>int t_snd (fd, buf, nbytes, flags) int fd; char *buf; unsigned nbytes; int flags;
#include <xti.h>int t_snd (fd, buf, nbytes, flags) int fd; char *buf; unsigned nbytes; int flags;
By default, t_snd 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 O_NONBLOCK is set (via t_open or fcntl), t_snd executes in asynchronous mode, and fails immediately if there are flow control restrictions.
Even when there are no flow control restrictions, t_snd waits if STREAMS internal resources are not available, regardless of the state of O_NONBLOCK.
On successful completion, t_snd returns the number of bytes accepted by the transport provider. Normally this equals the number of bytes specified in nbytes. However, if O_NONBLOCK is set, it is possible that only part of the data is accepted by the transport provider. In this case, t_snd sets T_MORE for the data that was sent (see below) and returns a value less than nbytes. If nbytes is zero, no data is passed to the provider and t_snd returns zero.
If T_EXPEDITED is set in flags, the data is sent as expedited data, and is subject to the interpretations of the transport provider.
If T_MORE is set in flags,
or is set as described above, an indication is sent to the transport provider that the transport service
data unit (TSDU) or expedited transport service data unit
(ETSDU) is being sent through multiple t_snd calls.
Each t_snd with the T_MORE flag set indicates that another
t_snd follows with more data for the current TSDU.
The end of the TSDU (or ETSDU) is identified by a
t_snd call with the T_MORE flag not set.
Use of T_MORE
enables a user to break up large logical data units without losing
the boundaries of those units at the other end of the connection.
The flag implies nothing about how the data is
packaged for transfer below the transport interface.
If the transport provider does not support the concept of a TSDU
as indicated in the info
argument on return from t_open
or t_getinfo,
the T_MORE flag is not meaningful and should be ignored.
The size of each TSDU or ETSDU must not exceed the limits of the transport provider as returned by t_open or t_getinfo. If the size is exceeded, a TSYSERR with system error EPROTO occurs. However, the t_snd may not fail because EPROTO errors may not be reported immediately. In this case, a subsequent call that accesses the transport endpoint fails with the associated TSYSERR.
If t_snd is issued from the T_IDLE state, the provider may silently discard the data. If t_snd is issued from any state other than T_DATAXFER, T_INREL or T_IDLE, the provider generates a TSYSERR with system error EPROTO (which may be reported in the manner described above).
AT&T SVID Issue 3
;
X/Open CAE Specification, Networking Services, Issue 4, 1994.
;
and
Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2)
.