/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <signal.h>
#include <strings.h>
#include <unistd.h>
#include <stdio.h>
#include "libnsctl.h"
#include <nsctl.h>
static int _nsc_open_path(nsc_fd_t *);
static int _nsc_open_check(nsc_fd_t *);
/*
* Turn off ckdchk checking of nsc_open()'d volumes since we have no CKD
* we could do this more sanely by completing the implementation of the
* CKD module, and having nsc_open() prevent any non-NSC_CKD_DISK open
* of a CKD volume.
* -- Simon, Thu Feb 18 10:49:46 GMT 1999
*/
static int ckdchk = 0;
nsc_fd_t *
char *path;
{
return (0);
}
return (0);
}
if (!_nsc_open_path(fd)) {
return (0);
}
return (0);
}
return (fd);
}
nsc_fd_t *
char *path;
{
int i;
return (0);
}
return (0);
return (0);
return (0);
}
}
return (0);
}
}
return (0);
return (0);
return (fd);
}
static int
{
return (0);
return (1);
return (0);
}
static int
{
char s[30];
int i;
return (1);
return (0);
return (0);
for (i = 1; i <= NSIG; i++)
for (i = sysconf(_SC_OPEN_MAX); i >= 0; i--)
close(i);
exit(1);
}
return (pid != -1);
}
int
{
int rc;
if (!fd)
return (0);
return (rc);
}
int
{
}
int
{
if (!fd)
return (0);
return (-1);
}
}
int
{
int rc;
if (!fd)
return (0);
if (rc != 0) {
return (rc);
}
return (0);
}
int
{
}
void
{
ckdchk = 0;
}
static int
int cmd;
void *arg;
{
if (fd < 0)
return (-1);
rc = save_errno = 0;
if (rc < 0)
save_errno = errno;
errno = save_errno;
return (rc);
}
/*
* int
* nsc_freeze(char *path)
* Freeze a pathname
*
* Returns 0 for success, or -1 and sets errno.
*
* Description:
* This is the user level interface to the nsctl freeze operation.
* See uts/common/ns/nsctl/nsc_freeze.c for more information.
*/
int
char *path;
{
return (-1);
}
}
/*
* int
* nsc_unfreeze(char *path)
* Unfreeze a pathname
*
* Returns 0 for success, or -1 and sets errno.
*
* Description:
* This is the user level interface to the nsctl unfreeze operation.
* See uts/common/ns/nsctl/nsc_freeze.c for more information.
*/
int
char *path;
{
return (-1);
}
}
/*
* int
* nsc_isfrozen(char *path)
* Test if a pathname is frozen
*
* Returns:
* 0 path is frozen
* 1 path is not frozen
* -1 error (errno will be set)
*
* Description
* This is the user level interface to to the nsctl isfrozen operation.
* See uts/common/ns/nsctl/nsc_freeze.c for more information.
*/
int
char *path;
{
return (-1);
}
}
int
{
}
int
{
}
/*
* int
* nsc_nvclean()
* mark nvmem clean, to prevent a warmstart of the cache on reboot
*/
int
{
int cmd;
return (_nsc_do_ioctl(cmd, (void *)0));
}