+do_is_fifo (const char *path)
+{
+ mode_t mode;
+ int r = get_mode (path, &mode);
+ if (r <= 0) return r;
+ return S_ISFIFO (mode);
+}
+
+int
+do_is_symlink (const char *path)
+{
+ mode_t mode;
+ int r = get_mode (path, &mode);
+ if (r <= 0) return r;
+ return S_ISLNK (mode);
+}
+
+int
+do_is_socket (const char *path)
+{
+ mode_t mode;
+ int r = get_mode (path, &mode);
+ if (r <= 0) return r;
+ return S_ISSOCK (mode);
+}
+
+static int
+get_mode (const char *path, mode_t *mode)