/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* file systems on the current host.
*/
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <thread.h>
#include <synch.h>
#include "libfsmgt.h"
/*
* Private constants
*/
/*
* Private variables
*/
/*
* Private method declarations
*/
static int cmp_fields(char *, char *, int);
int *errp);
int *errp);
static char *create_vfstab_entry_line(struct vfstab *, int *);
/*
* Public methods
*/
}
} /* fs_free_mntdefaults_list */
/*
* Filter by the fields that are filled in on the filter parameter.
* Fields that aren't used in filtering the defaults will be NULL.
*/
int *errp) {
(void) mutex_lock(&vfstab_lock);
if (search_entry == NULL) {
/*
* Out of memory, the error pointer (errp) gets
* set in create_vfstab_filter.
*/
(void) mutex_unlock(&vfstab_lock);
return (NULL);
}
/*
* Add to list to be returned
*/
/*
* Out of memory, the error pointer (errp)
* gets set in create_mntdefaults_entry.
*/
(void) mutex_unlock(&vfstab_lock);
return (NULL);
}
} else {
}
}
(void) mutex_unlock(&vfstab_lock);
} else {
} /* if ((fp = fopen(VFSTAB, "r")) != NULL) */
return (headp);
} /* fs_get_filtered_mount_defaults */
{
(void) mutex_lock(&vfstab_lock);
/*
* Add entry to list
*/
/*
* Out of memory, the error pointer (errp)
* gets set in create_mntdefaults_entry.
*/
(void) mutex_unlock(&vfstab_lock);
return (NULL);
}
} else {
}
}
(void) mutex_unlock(&vfstab_lock);
} else {
} /* if ((fp = fopen(VFSTAB, "r")) != NULL) */
/*
* Caller must free the returned list
*/
return (headp);
} /* fs_get_mount_defaults */
(void) mutex_lock(&vfstab_lock);
(void) mutex_unlock(&vfstab_lock);
} else {
}
} else {
}
return (ret_val);
} /* fs_add_mount_default */
int *errp)
{
char *new_line;
int line_found = 0;
char *tmp;
int count = 0;
(void) mutex_lock(&vfstab_lock);
char *charp;
(void) mutex_unlock(&vfstab_lock);
return (NULL);
}
for (charp = vfstab_line;
/*
* Write comments out to temp vfstab
* image
*/
line_found = 0;
break;
}
continue;
}
/*
* Invalid vfstab line.
*/
(void) mutex_unlock(&vfstab_lock);
return (NULL);
}
line_found = 1;
new_line =
line_found = 0;
break;
}
} else {
line_found = 0;
break;
}
}
}
int i;
for (i = 0; i < count; i++) {
}
(void) mutex_unlock(&vfstab_lock);
} else {
(void) mutex_unlock(&vfstab_lock);
}
} else {
(void) mutex_unlock(&vfstab_lock);
}
} else {
}
return (ret_val);
} /* fs_edit_mount_defaults */
{
int line_found = 0;
char *tmp;
char *charp;
int count = 0;
(void) mutex_lock(&vfstab_lock);
(void) mutex_unlock(&vfstab_lock);
return (NULL);
}
for (charp = vfstab_line;
/*
* Write comments out to temp vfstab
* image
*/
line_found = 0;
break;
}
continue;
}
/*
* Invalid vfstab line.
*/
(void) mutex_unlock(&vfstab_lock);
return (NULL);
}
line_found = 1;
} else {
line_found = 0;
break;
}
}
}
int i;
for (i = 0; i < count; i++) {
}
(void) mutex_unlock(&vfstab_lock);
} else {
(void) mutex_unlock(&vfstab_lock);
}
} else {
(void) mutex_unlock(&vfstab_lock);
if (temp_vfstab != NULL) {
}
}
} else {
}
return (ret_val);
}
/*
* Private methods
*/
static fs_mntdefaults_t *
(size_t)sizeof (fs_mntdefaults_t));
/*
* Out of memory
*/
return (NULL);
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
return (newp);
} /* create_mntdefaults_entry */
static struct vfstab *
if (search_entry == NULL) {
/*
* Out of memory
*/
return (NULL);
}
/*
* Populate the filter criteria
*/
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
/*
* Out of memory
*/
return (NULL);
}
}
return (search_entry);
} /* create_vfstab_filter */
} /* free_vfstab_entry */
static int
return (ret_val);
} /* vfstab_line_cmp */
/*
* Helper function for comparing fields in a fs_mntdefaults_t to a
* vfstab structure. Used in vfstab_line_cmp().
*/
static int
if (ret_val != 0) {
ret_val = 0;
}
ret_val = 0;
}
}
return (ret_val);
} /* cmp_fields */
/*
* Helper fuction used by del_vfstab_ent() and edit_vfstab_ent() to
* create a vfstab line for writing out to the vfstab file.
*/
char *
char *line;
int line_length;
line_length = (
(vfstab_ent->vfs_mountp ?
(vfstab_ent->vfs_fstype ?
} else {
}
return (line);
} /* create_vfstab_entry_line */