diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-11-01 21:46:50 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-11-01 21:46:50 -0400 |
commit | 8c3b9aaaab11be9d0fe24a72ebb16e171ca22125 (patch) | |
tree | 1eceebe2763cec5a010a193d48b50edef5fb78a2 /util.c | |
parent | b74261ac825ec2b9c02d73e36f7b44b64c9d184c (diff) | |
download | bfs-8c3b9aaaab11be9d0fe24a72ebb16e171ca22125.tar.xz |
Print device major/minor numbers for -ls
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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); +} |