#include <stdio.h>
#include <stdlib.h>
#include <err.h>

#ifdef __linux__
#include <sys/vfs.h>
#else
#include <sys/param.h>
#include <sys/mount.h>
#endif

int
main(int argc, char **argv)
{
	struct statfs buf;
	int error;

	if (argc != 2)
		errx(EXIT_FAILURE, "please give me a path");

	error = statfs(argv[1], &buf);
	if (error)
		err(EXIT_FAILURE, "statfs()");

	printf("f_fsid.val[0] = 0x%x\n", buf.f_fsid);
	printf("f_fsid.val[1] = 0x%x\n", (int)*((int32_t *)&buf.f_fsid + 1));

	return (0);
}

