You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one should generally be pretty easy. statvfs() is just a syscall that takes a mount point and returns generic information about it like file system type, size, amount of free space, etc. The details can be seen here. Generally speaking, to implement this we just add a new function for super-blocks and then in ./src/fs/super.c we look up the correct super-block and call the function to fill in the structure (and then copy it back to userspace).
statvfs() should enable us to write a simple df utility that prints information on the current mounted file systems. The only extra part is that we need a list of the current mounted file systems so we can get all their info. The information already in /proc/mounts is probably sufficient, as it lists the mount point and df should be able to simply pass that directory directly to statvfs(), but that approach probably needs to be verified. BSD also has a getmntinfo() which basically does all of this in one shot which we could implement pretty easily, but it might make sense to avoid adding extra syscalls when we don't really need them.
The text was updated successfully, but these errors were encountered:
This one should generally be pretty easy.
statvfs()
is just a syscall that takes a mount point and returns generic information about it like file system type, size, amount of free space, etc. The details can be seen here. Generally speaking, to implement this we just add a new function for super-blocks and then in./src/fs/super.c
we look up the correct super-block and call the function to fill in the structure (and then copy it back to userspace).statvfs()
should enable us to write a simpledf
utility that prints information on the current mounted file systems. The only extra part is that we need a list of the current mounted file systems so we can get all their info. The information already in/proc/mounts
is probably sufficient, as it lists the mount point anddf
should be able to simply pass that directory directly tostatvfs()
, but that approach probably needs to be verified. BSD also has agetmntinfo()
which basically does all of this in one shot which we could implement pretty easily, but it might make sense to avoid adding extra syscalls when we don't really need them.The text was updated successfully, but these errors were encountered: