9 struct statfs mbuf
[128];
12 if ((fs_count
= getfsstat (NULL
, 0, MNT_NOWAIT
)) != -1 )
14 getfsstat (mbuf
, fs_count
* sizeof(mbuf
[0]), MNT_NOWAIT
);
16 for ( int i
= 0; i
< fs_count
; ++i
)
18 printf("mount from name %s\n", mbuf
[i
].f_mntfromname
);
23 struct statfs
* badbuf
= malloc(sizeof(struct statfs
));
25 getfsstat(badbuf
, 1, MNT_NOWAIT
);
27 struct statfs betterbuf
;
30 getfsstat(NULL
, i
, MNT_NOWAIT
);
31 getfsstat(&betterbuf
, sizeof(struct statfs
), badflags
);