getvfsent, getvfsbytype, getvfsbyname, getvfsbyflag, setvfsent, or endvfsent Subroutine

Purpose

Gets a vfs file entry.

Library

Standard C Library(libc.a)

Syntax

#include <sys/vfs.h>
#include <sys/vmount.h>
struct vfs_ent *getvfsent( )

struct vfs_ent *getvfsbytype( vfsType)
int vfsType;

struct vfs_ent *getvfsbyname( vfsName)
char *vfsName;

struct vfs_ent *getvfsbyflag( vfsFlag)
int vfsFlag;

void setvfsent( )
void endvfsent( )

Description

Attention: All information is contained in a static area and so must be copied to be saved.

The getvfsent subroutine, when first called, returns a pointer to the first vfs_ent structure in the file. On the next call, it returns a pointer to the next vfs_ent structure in the file. Successive calls are used to search the entire file.

The vfs_ent structure is defined in the vfs.h file and it contains the following fields:

char vfsent_name;
int vfsent_type;
int vfsent_flags;
char *vfsent_mnt_hlpr;
char *vfsent_fs_hlpr;

The getvfsbytype subroutine searches from the beginning of the file until it finds a vfs type matching the vfsType parameter. The subroutine then returns a pointer to the structure in which it was found.

The getvfsbyname subroutine searches from the beginning of the file until it finds a vfs name matching the vfsName parameter. The search is made using flattened names; the search-string uses ASCII equivalent characters.

The getvfsbytype subroutine searches from the beginning of the file until it finds a type matching the vfsType parameter.

The getvfsbyflag subroutine searches from the beginning of the file until it finds the entry whose flag corresponds flags defined in the vfs.h file. Currently, these are VFS_DFLT_LOCAL and VFS_DFLT_REMOTE.

The setvfsent subroutine rewinds the vfs file to allow repeated searches.

The endvfsent subroutine closes the vfs file when processing is complete.

Parameters

Item Description
vfsType Specifies a vfs type.
vfsName Specifies a vfs name.
vfsFlag Specifies either VFS_DFLT_LOCAL or VFS_DFLT_REMOTE.

Return Values

The getvfsent, getvfsbytype, getvfsbyname, and getvfsbyflag subroutines return a pointer to a vfs_ent structure containing the broken-out fields of a line in the /etc/vfs file. If an end-of-file character or an error is encountered on reading, a null pointer is returned.

Files

Item Description
/etc/vfs Describes the virtual file system (VFS) installed on the system.