summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2018-11-01 21:46:50 -0400
committerTavian Barnes <tavianator@tavianator.com>2018-11-01 21:46:50 -0400
commit8c3b9aaaab11be9d0fe24a72ebb16e171ca22125 (patch)
tree1eceebe2763cec5a010a193d48b50edef5fb78a2 /util.c
parentb74261ac825ec2b9c02d73e36f7b44b64c9d184c (diff)
downloadbfs-8c3b9aaaab11be9d0fe24a72ebb16e171ca22125.tar.xz
Print device major/minor numbers for -ls
Diffstat (limited to 'util.c')
-rw-r--r--util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/util.c b/util.c
index 9730a5e..64785be 100644
--- a/util.c
+++ b/util.c
@@ -30,6 +30,10 @@
#include <sys/types.h>
#include <unistd.h>
+#if __GLIBC__ || __has_include(<sys/sysmacros.h>)
+# include <sys/sysmacros.h>
+#endif
+
int xreaddir(DIR *dir, struct dirent **de) {
errno = 0;
*de = readdir(dir);
@@ -440,3 +444,15 @@ int ynprompt() {
dstrfree(line);
return ret;
}
+
+dev_t bfs_makedev(int ma, int mi) {
+ return makedev(ma, mi);
+}
+
+int bfs_major(dev_t dev) {
+ return major(dev);
+}
+
+int bfs_minor(dev_t dev) {
+ return minor(dev);
+}