Commit 2628f1c5 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov

add parse_device() for freebsd and macos

parent b39c7630
......@@ -292,6 +292,8 @@ void parse_options(int argc, char **argv)
errx(1, "no destination specified");
}
#ifdef __linux__
void parse_device(dev_t dev)
{
char *buf = NULL, *ptr;
......@@ -333,6 +335,29 @@ out:
fclose(file);
}
#elif defined(__APPLE__) || defined(__FreeBSD__)
void parse_device(dev_t dev)
{
struct statfs fs;
(void)dev;
if (statfs(path, &fs))
return;
fstype = strdup(fs.f_fstypename);
device = strdup(fs.f_mntfromname);
}
#else
void parse_device(dev_t dev)
{
(void)dev;
}
#endif
off_t get_device_size(int fd)
{
unsigned long long blksize = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment