/*
* CDDL HEADER START
*
* 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.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* 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]
*
* CDDL HEADER END
*/
/*
*/
#include "mt.h"
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <stropts.h>
#include <xti.h>
#include <assert.h>
#include <syslog.h>
#include "tx.h"
/*
* Any changes to either of them should be reviewed to see whether they
* are applicable to the other file.
*/
int
int flags, int api_semantics)
{
char *curptr;
int iovcount;
int first_time;
int band;
int sv_errno;
int doputmsg = 0;
return (-1);
return (-1);
}
return (-1);
}
return (-1);
}
/*
* XXX
* Is it OK to do this TBADFLAG check when XTI spec
* is being extended with new and interesting flags
* everyday ?
*/
if ((flags & ~(TX_ALL_VALID_FLAGS)) != 0) {
return (-1);
}
if (flags & T_EXPEDITED)
else {
/* normal data */
}
/*
* nbytes is the sum of the bytecounts in the tiov vector
* A value larger than INT_MAX is truncated to INT_MAX by
* _t_bytecount_upto_intmax()
*/
if ((tsdu_limit > 0) && /* limit meaningful and ... */
return (-1);
}
/*
* Check for incoming disconnect only. XNS Issue 5 makes it optional
* to check for incoming orderly release
*/
if (lookevent < 0) {
return (-1);
}
if (lookevent == T_DISCONNECT) {
return (-1);
}
/* sending zero length data when not allowed */
return (-1);
}
if (doputmsg) {
/*
* of the message.
*/
if (flags & T_EXPEDITED) {
} else
/*
* Allocate a databuffer into which we will gather the
* input vector data, and make a call to putmsg(). We
* do this since we don't have the equivalent of a putmsgv()
*/
if (nbytes != 0) {
return (-1); /* error */
}
/*
* Gather the input buffers, into the single linear
* buffer allocated above, while taking care to see
* that no more than INT_MAX bytes will be copied.
*/
} else {
}
}
/*
* Calls to send data (write or putmsg) can potentially
* block, for MT case, we drop the lock and enable signals here
* and acquire it back
*/
first_time = 1;
do {
if (doputmsg) {
/*
* transport provider supports TSDU concept
* (unlike TCP) or it is expedited data.
* In this case do the fragmentation
*/
} else {
else
}
if (retval == 0) {
}
} else {
/*
* transport provider does *not* support TSDU concept
* (e.g. TCP) and it is not expedited data. A
* perf. optimization is used. Note: the T_MORE
* flag is ignored here even if set by the user.
*/
/*
* The first time, setup the tiovec for doing a writev
* call. We assume that T_IOV_MAX <= IOV_MAX.
* Since writev may return a partial count, we need
* the loop. After the first time, we just adjust
* the iov vector to not include the already
* written bytes.
*/
if (first_time) {
first_time = 0;
&iovcount);
} else {
/*
* bytes_sent - value set below in the previous
* iteration of the loop is used now.
*/
}
if (retval >= 0) {
/* Amount that was actually sent */
bytes_sent = retval;
}
}
if (retval < 0) {
if (nbytes == bytes_remaining) {
/*
* Return appropriate error
*/
else
if (dataptr)
return (-1); /* return error */
}
/*
* [ partial completion of t_snd() case.
*
* some data was transmitted so don't
* return error. Don't attempt to
* send more (break from loop) but
* return OK.
*/
break;
}
} while (bytes_remaining != 0);
return (nbytes - bytes_remaining);
}