/*
* 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
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
/*
* Kernel TLI-like function to initialize a transport
* endpoint using the protocol specified.
*
* Returns:
* 0 on success and "tiptr" is set to a valid transport pointer,
* else a positive error code.
*/
int
{
int madefp = 0;
int retval;
int error;
int rtries = 0;
/*
* Special case for install: miniroot needs to be able to access files
* via NFS as though it were always in the global zone.
*/
if (nfs_global_client_only != 0)
error = 0;
retval = 0;
return (EINVAL);
}
/*
* allocate a file pointer, but
* no file descripter.
*/
return (error);
}
/* Install proper cred in file */
}
/*
* this will call the streams open for us.
* Want to retry if error is EAGAIN, the streams open routine
* might fail due to temporarely out of memory.
*/
do {
== EAGAIN) {
}
if (error) {
return (error);
}
/*
* fp is completely initialized so drop the write lock.
* I actually don't need any locking on fp in here since
* there is no fd pointing at it. However, since I could
* call closef if there is an error and closef requires
* the fp read locked, I will acquire the read lock here
* and make sure I release it before I leave this routine.
*/
madefp = 1;
} else {
}
if (madefp)
return (ENOSTR);
}
/*
* allocate a new transport structure
*/
/*
* see if TIMOD is already pushed
*/
if (error) {
if (madefp)
return (error);
}
if (retval == 0) {
&retval);
if (error) {
switch (error) {
case ENOSPC:
case EAGAIN:
case ENOSR:
/*
* This probably means the master file
* should be tuned.
*/
"t_kopen: I_PUSH of timod failed, error %d\n",
error);
error = 0;
goto tryagain;
default:
if (madefp)
error);
return (error);
}
}
}
if (error) {
if (madefp)
return (error);
}
if (retval) {
else
if (madefp)
retval);
return (error);
}
if (madefp)
KTLILOG(1,
"t_kopen: strioc.ic_len != sizeof (struct T_info_ack): %d\n",
return (EPROTO);
}
return (0);
}
static t_scalar_t
{
switch (infosize) {
case -1:
return (DEFSIZE);
case -2:
return (0);
default:
return (infosize);
}
}