Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sysfs(2) [opensolaris man page]

sysfs(2)							   System Calls 							  sysfs(2)

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. SunOS 5.11 5 Jul 1990 sysfs(2)

Check Out this Related Man Page

SYSFS(2)						     Linux Programmer's Manual							  SYSFS(2)

NAME
sysfs - get file system type information SYNOPSIS
int sysfs(int option, const char *fsname); int sysfs(int option, unsigned int fs_index, char *buf); int sysfs(int option); DESCRIPTION
sysfs returns information about the file system types currently present in the kernel. The specific form of the sysfs call and the informa- tion returned depends on the option in effect: 1 Translate the file-system identifier string fsname into a file-system type index. 2 Translate the file-system type index fs_index into a null-terminated file-system identifier string. This string will be written to the buffer pointed to by buf. Make sure that buf has enough space to accept the string. 3 Return the total number of file system types currently present in the kernel. The numbering of the file-system type indexes begins with zero. RETURN VALUE
On success, sysfs returns the file-system index for option 1, zero for option 2, and the number of currently configured file systems for option 3. On error, -1 is returned, and errno is set appropriately. ERRORS
EINVAL fsname is not a valid file-system type identifier; fs_index is out-of-bounds; option is invalid. EFAULT Either fsname or buf is outside your accessible address space. CONFORMING TO
SVr4. NOTE
On Linux with the proc filesystem mounted on /proc, the same information can be derived from /proc/filesystems. BUGS
There is no libc or glibc support. There is no way to guess how large buf should be. Linux 1.3.16 1995-08-09 SYSFS(2)
Man Page

4 More Discussions You Might Find Interesting

1. HP-UX

more than one fs type on the same file system

hi is it possible to have more than one file system types on the same file system. if yes then how do we do it, can veritas be used to achieve this (1 Reply)
Discussion started by: livemyway
1 Replies

2. Programming

Unable to reference sysfs on Linux.

I am porting C code to a linux system but I am unable to link a call to the sysfs function. An excerpt from my code is: if (fstat(fileno(TrCtl.Fp), &fsstat) != -1) { (void) sysfs(1, fsname); if (strcmp(fsname, "nfs")) { (void) lockf(fileno(TrCtl.Fp), F_LOCK, 0L); ... (5 Replies)
Discussion started by: mbb
5 Replies

3. SuSE

X11 errors in users .xsession_errors

Hi, i have an user, he uses a suse linux 10.3 box with dual monitor. He has many logs in .xsession_errors like: X Error: BadWindow (invalid Window parameter) 3 Major opcode: 20 Minor opcode: 0 Resource id: 0x2e00013 Does anyone know what this exactly means? Thx in front for... (1 Reply)
Discussion started by: ortsvorsteher
1 Replies

4. Linux

Query about creating sysfs directory under device driver

Hi all, Currently i am involved in developing a device driver for a custom hardware. My linux stack already has the sysfs directory structure /sys/class/hwmon/ My need is that, while loading my device driver i need to create a "xyz" sysfs directory inside hwmon sysfs directory as... (0 Replies)
Discussion started by: cbalu
0 Replies