getfsdev.c 382 B

123456789101112131415161718192021222324
  1. #include "rsync.h"
  2. int main(int argc, char *argv[])
  3. {
  4. STRUCT_STAT st;
  5. int ret;
  6. while (--argc > 0) {
  7. #ifdef USE_STAT64_FUNCS
  8. ret = stat64(*++argv, &st);
  9. #else
  10. ret = stat(*++argv, &st);
  11. #endif
  12. if (ret < 0) {
  13. fprintf(stderr, "Unable to stat `%s'\n", *argv);
  14. exit(1);
  15. }
  16. printf("%ld/%ld\n", (long)major(st.st_dev),
  17. (long)minor(st.st_dev));
  18. }
  19. return 0;
  20. }