drctl_impl.c revision 1d4b38e0077763e7c9b20768eacb841957e787bc
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/drctl_impl.h>
int
{
int rv;
switch (cmd) {
&setup_rqst, sizeof (setup_rqst), 0) != 0) {
"for DRCTL_IOCTL_CONNECT_SERVER");
break;
}
rv = 0;
break;
default:
}
return (rv);
}
int
{
int up_err;
int rv = 0;
static const char me[] = "i_drctl_send";
if (dh)
else
return (EIO);
/*
* We don't know the size of the message the daemon
* will pass back to us. By setting rbuf to NULL,
* we force the door code to allocate a buf of the
* appropriate size. We must set rsize > 0, however,
* else the door code acts as if no response was
* expected and doesn't pass the data to us.
*/
DR_DBG_CTL("%s: msg %p size %ld obufp %p osize %p\n",
if (up_err == 0) {
DR_DBG_CTL("%s: rbuf %p rsize %ld\n",
}
} else {
switch (up_err) {
case EINTR:
case EAGAIN:
/*
* Server process may be forking, try again.
*/
goto retry;
case EBADF:
case EINVAL:
break;
default:
DR_DBG_CTL("%s: unexpected return "
break;
}
}
return (rv);
}