FreeBSD regtest: remove test for version 13+ syscalls
[valgrind.git] / memcheck / tests / freebsd / getfsstat.c
blob97848aa9d20a5225df238260800909a339ff1303
1 #include <sys/param.h>
2 #include <sys/ucred.h>
3 #include <sys/mount.h>
4 #include <stdio.h>
5 #include <stdlib.h>
7 int main(void)
9 struct statfs mbuf[128];
10 int fs_count;
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);
22 // now some bad uses
23 struct statfs* badbuf = malloc(sizeof(struct statfs));
24 free(badbuf);
25 getfsstat(badbuf, 1, MNT_NOWAIT);
27 struct statfs betterbuf;
28 int i;
29 int badflags;
30 getfsstat(NULL, i, MNT_NOWAIT);
31 getfsstat(&betterbuf, sizeof(struct statfs), badflags);