/*
* 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
*/
/*
*/
/*
* This file contains the code that door server threads run, excluding the
* callbacks provided by the driver
*/
#include <stdio.h>
#include <door.h>
#include <assert.h>
#include <unistd.h>
#include <strings.h>
#include <pthread.h>
#include <thread.h>
#include <synch.h>
#include <libuvfs_impl.h>
#include <errno.h>
#include <atomic.h>
/*
* NB: this should only be used for operations that are expecting a result
* of type libuvfs_common_res_t.
*/
/*ARGSUSED*/
void
{
}
static ucred_t *
{
(void) door_ucred(&ucred);
return (ucred);
}
static void
{
(void) atexit(libuvfs_daemon_atexit);
}
/*ARGSUSED*/
static void
{
/*
* If our arg is DOOR_UNREF_DATA, then the kernel has dropped
* all references to our door, which means that we should exit.
*/
if (arg == DOOR_UNREF_DATA) {
return;
}
if ((argsize < sizeof (libuvfs_common_arg_t)) ||
}
/*
* No need to take locks on fs, since callbacks may not change after
* the door is created.
*/
}
}
/*
* We should never get here if the callback correctly called
* libuvfs_return() (which contains the door_return() call).
*/
abort();
}
int
const libuvfs_callback_reg_t *reg)
{
return (-1);
}
return (0);
}
int
const libuvfs_callback_reg_t *callbacks)
{
return (-1);
}
return (0);
}
static void
{
}
/*ARGSUSED*/
static void
{
}
/*
* Create a new worker thread, unless we're at the limit.
*/
/*ARGSUSED*/
static int
void *vfs)
{
return (0);
}
return (-1);
return (1);
}
int
{
int rc;
if (rc != 0)
goto errout;
if (rc == -1)
goto errout;
if (rc != 0)
goto errout;
/*
* Here we wait. Other threads, the threads servicing the door
* upcalls, will do all of the work.
*/
return (0);
if (libuvfs_is_daemon())
return (rc);
}
/*ARGSUSED*/
void
{
int error;
errno = 0;
if (error == -1) {
NULL, 0);
}
}