/*
* 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
*/
/*
*/
/*
* Client-side interface to the IO Daemon (IOD)
*/
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <netdb.h>
#include <libintl.h>
#include <door.h>
#include <sys/byteorder.h>
#include <assert.h>
#include "charsets.h"
#include "private.h"
/*
* This is constant for the life of a process,
* and initialized at startup, so no locks.
*/
char *
smb_iod_door_path(void)
{
int x;
if (door_path[0] == '\0') {
}
return (door_path);
}
/*
* Open the door (client side) and
* find out if the service is there.
*/
int
{
char *path;
int err = 0;
path = smb_iod_door_path();
if (fd < 0)
return (errno);
/*
* Make sure the IOD is running.
* Pass NULL args.
*/
if (rc < 0) {
return (err);
}
if (err != 0) {
return (err);
}
/* This handle controls per-process resources. */
return (0);
}
/*
* Request the creation of our per-user smbiod
* via door call to the "main" IOD service.
*/
static int
start_iod(void)
{
if (fd < 0) {
return (err);
}
cmd = SMBIOD_START;
if (rc < 0) {
return (err);
}
return (err);
}
/*
* Get a door handle to the IOD, starting it if necessary.
* On success, sets ctx->ct_door_fd
*/
int
{
if (--tmo <= 0)
goto errout;
/*
* We have no per-user IOD yet. Request one.
* Do this request every time through the loop
* because the master IOD will only start our
* per-user IOD if we don't have one, and our
* first requst could have happened while we
* had an IOD that was doing shutdown.
*/
if (err != 0)
goto errout;
/*
* Wait for it to get ready.
*/
(void) sleep(1);
}
/* Save the door fd. */
return (0);
"Could not contact service: %s"),
return (ENOTACTIVE);
}
/*
* Ask the IOD to connect using the info in ctx.
* Called by newvc.
*/
int
{
int err = 0;
/* Should already have the IOD door. */
if (ctx->ct_door_fd < 0)
return (EINVAL);
}
return (err);
}