If first argument is 3, returns total number of filesystem types
If first argument is 2, looks the filesystem name of the Nth filesystem
my $num = syscall &SYS_sysfs, 3;
die "sysfs: $!\n" if $num < 0;
print "This system has support for $num file systems\n";
for my $i (0..$num-1) {
my $buf = "\0"x255;
syscall(&SYS_sysfs, 2, $i, $buf) < 0 and die "sysfs: $!\n";
print "$buf\n";
}
Example output:
This system has support for 21 file systems
sysfs
rootfs
bdev
proc
...