summaryrefslogtreecommitdiffstats
path: root/getfsdev.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--getfsdev.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/getfsdev.c b/getfsdev.c
new file mode 100644
index 0000000..bc8c65d
--- /dev/null
+++ b/getfsdev.c
@@ -0,0 +1,22 @@
+#include "rsync.h"
+
+ int main(int argc, char *argv[])
+{
+ STRUCT_STAT st;
+ int ret;
+
+ while (--argc > 0) {
+#ifdef USE_STAT64_FUNCS
+ ret = stat64(*++argv, &st);
+#else
+ ret = stat(*++argv, &st);
+#endif
+ if (ret < 0) {
+ fprintf(stderr, "Unable to stat `%s'\n", *argv);
+ exit(1);
+ }
+ printf("%ld/%ld\n", (long)major(st.st_dev), (long)minor(st.st_dev));
+ }
+
+ return 0;
+}