sysfs(2) CLIX sysfs(2)
NAME
sysfs - Gets file system type information
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <sys/fstyp.h>
#include <sys/fsid.h>
int sysfs(
int opcode ,
char *fsname );
int sysfs(
int opcode ,
int fs_index ,
char *buf );
int sysfs(
int opcode );
PARAMETERS
opcode Specifies the action requested.
*fsname Points to a file system identifier.
fs_index Specifies a file system type index.
*buf Points to the buffer into which a file system identifier is
returned.
DESCRIPTION
The sysfs() function returns information about the file system types
configured in the system. The number of arguments accepted by sysfs()
varies, depending on the opcode. The currently recognized opcodes and
their functions are described below:
GETFSIND Translates fsname, a null-terminated file system identifier,
into a file system type index.
GETFSTYP Translates fs_index, a file system type index, into a null-
terminated file system identifier and writes it into the
buffer pointed to by buf; this buffer must be at least of size
FSTYPSZ as defined in <sys/fstyp.h>.
2/94 - Intergraph Corporation 1
sysfs(2) CLIX sysfs(2)
GETNFSTYP Returns the total number of file system types configured in
the system.
EXAMPLES
1. To determine the number of file system types configured into the
system:
num_fstypes = sysfs(GETNFSTYP);
2. To translate a file system identifier into a file system type index:
index = sysfs(GETFSIND, "FFS");
if (index == -1)
fprintf(stderr, "FFS is not configured into the system\n");
RETURN VALUES
Upon successful completion, sysfs() returns the file system type index if
the opcode is GETFSIND, a value of 0 if the opcode is GETFSTYP, or the
number of file system types configured if the opcode is GETNFSTYP.
Otherwise, a value of -1 is returned and errno is set to indicate the
error.
ERRORS
The sysfs() function fails if one or more of the following are true:
[EINVAL] The fsname parameter points to an invalid file system
identifier; fs_index is 0 or invalid; opcode is invalid.
[EFAULT] The buf or fsname parameter points to an invalid user address.
RELATED INFORMATION
Functions: mount(2), statfs(2)
2 Intergraph Corporation - 2/94