[Toybox] df not working on FreeBSD

Vidar Karlsen vidar at karlsen.tech
Mon Apr 15 02:37:25 PDT 2024


Hello,

df throws the following error on FreeBSD:

root at 140amd64_noopts-usrports:/usr/local/toybox/bin # ./df /
df: getmntinfo: Invalid argument

A little bit of poking around shows that getmntinfo expects the second
argument (the mode) to be one of these, and not 0:

sys/sys/mount.h:
#define MNT_WAIT    1   /* synchronously wait for I/O to complete */
#define MNT_NOWAIT  2   /* start all I/O, but do not wait for it */
#define MNT_LAZY    3   /* push data not written by filesystem syncer */
#define MNT_SUSPEND 4   /* Suspend file system after sync */

Changing 0 to MNT_NOWAIT in portability.c makes df happy again.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toybox_freebsd_df.patch
Type: text/x-diff
Size: 607 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240415/c02250b8/attachment.patch>


More information about the Toybox mailing list