1SYSFS(2) Linux Programmer's Manual SYSFS(2)
2
3
4
6 sysfs - get file system type information
7
9 int sysfs(int option, const char *fsname);
10
11 int sysfs(int option, unsigned int fs_index, char *buf);
12
13 int sysfs(int option);
14
16 sysfs() returns information about the file system types currently
17 present in the kernel. The specific form of the sysfs() call and the
18 information returned depends on the option in effect:
19
20
21 1 Translate the file-system identifier string fsname into a file-
22 system type index.
23
24 2 Translate the file-system type index fs_index into a null-termi‐
25 nated file-system identifier string. This string will be written
26 to the buffer pointed to by buf. Make sure that buf has enough
27 space to accept the string.
28
29 3 Return the total number of file system types currently present
30 in the kernel.
31
32
33 The numbering of the file-system type indexes begins with zero.
34
36 On success, sysfs() returns the file-system index for option 1, zero
37 for option 2, and the number of currently configured file systems for
38 option 3. On error, -1 is returned, and errno is set appropriately.
39
41 EFAULT Either fsname or buf is outside your accessible address space.
42
43 EINVAL fsname is not a valid file-system type identifier; fs_index is
44 out-of-bounds; option is invalid.
45
47 SVr4.
48
50 On Linux with the proc filesystem mounted on /proc, the same informa‐
51 tion can be derived from /proc/filesystems.
52
54 There is no libc or glibc support. There is no way to guess how large
55 buf should be.
56
57
58
59Linux 1.3.16 1995-08-09 SYSFS(2)