xref: /titanic_44/usr/src/man/man2/sysfs.2 (revision 4d0eb50e691de4c20b1dd9976ad6839fede8a42d)
te
Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
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 or http://www.opensolaris.org/os/licensing. 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]
SYSFS 2 "Jul 5, 1990"
NAME
sysfs - get file system type information
SYNOPSIS

#include <sys/fstyp.h>
#include <sys/fsid.h>

int sysfs(int opcode, const char *fsname);

int sysfs(int opcode, int fs_index, char *buf);

int sysfs(int opcode);
DESCRIPTION

The sysfs() function returns information about the file system types configured in the system. The number of arguments accepted by sysfs() depends on the opcode argument, which can take the following values: GETFSIND

Translate fsname, a null-terminated file-system type identifier, into a file-system type index.

GETFSTYP

Translate fs_index, a file-system type index, into a null-terminated file-system type identifier and write it into the buffer pointed to by buf, which must be at least of size FSTYPSZ as defined in <sys/fstyp.h>.

GETNFSTYP

Return the total number of file system types configured in the system.

RETURN VALUES

Upon successful completion, the value returned depends upon the opcode argument as follows: GETFSIND

the file-system type index

GETFSTYP

0

GETNFSTYP

the number of file system types configured

Otherwise, -1 is returned and errno is set to indicate the error.

ERRORS

The sysfs() function will fail if: EFAULT

The buf or fsname argument points to an illegal address.

EINVAL

The fsname argument points to an invalid file-system identifier; the fs_index argument is 0 or invalid; or the opcode argument is invalid.