fs lsmount subcommand for listing VFS mountpoint info
This commit is contained in:
18
user/fs/lsmount.c
Normal file
18
user/fs/lsmount.c
Normal file
@ -0,0 +1,18 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ulib.h>
|
||||
|
||||
static const char *fstypes[] = { "Little FS" };
|
||||
|
||||
void fs_lsmount(void) {
|
||||
VfsAvailMounts availmounts; ZERO(&availmounts);
|
||||
vfsavailmounts(&availmounts);
|
||||
|
||||
for (size_t i = 0; i < ARRLEN(availmounts.fieldavail); i++) {
|
||||
if (availmounts.fieldavail[i]) {
|
||||
VfsMountStat stat; ZERO(&stat);
|
||||
vfsmountstat(&stat, (char *)availmounts.labels[i]);
|
||||
uprintf("%-30s %-10s %-30s\n", stat.label, fstypes[stat.fstype], stat.devname);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user