+/* Return true iff device is the root device (and therefore should be
+ * ignored from the point of view of user calls).
+ */
+int
+is_root_device (const char *device)
+{
+ struct stat statbuf;
+ if (stat (device, &statbuf) == -1) {
+ perror (device);
+ return 0;
+ }
+ if (statbuf.st_rdev == root_device)
+ return 1;
+ return 0;
+}
+