hammer pfs ioctl

Link to this paste: http://bugs.dragonflybsd.org/pastes/436

Added by tuxillo 7 months ago.
Syntax: Plain Text

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include <err.h>
#include <fcntl.h>
#include <string.h>
#include <sys/param.h>
#include <vfs/hammer/hammer_ioctl.h>

int
main(int argc, char *argv[])
{
        int fd;
        int error = 0;
        uint32_t n = 0;

        fd = open(argv[1], O_RDONLY);
        if (fd < 0)
                err(1, "open");

        n = -1;
        while (error == 0) {
                error = ioctl(fd, HAMMERIOC_GETPFS_BTREE, &n);
                if (error == 0)
                        printf("PFS#%u\n", n);
                else
                        perror("ioctl");
        }

        return 0;
}

Download