From 86d777e2eb55fc619f983491af69a0823024932d Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 3 Apr 2023 10:57:47 +0300 Subject: [PATCH] LibC: add device macros in sys/sysmacros.h --- libc/include/sys/sysmacros.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 libc/include/sys/sysmacros.h diff --git a/libc/include/sys/sysmacros.h b/libc/include/sys/sysmacros.h new file mode 100644 index 0000000000..7d17574a13 --- /dev/null +++ b/libc/include/sys/sysmacros.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +#define makedev(maj, min) ((dev_t)(maj) << 32 | (dev_t)(min)) + +#define major(dev) (((dev) >> 32) & 0xFFFFFFFF) +#define minor(dev) ( (dev) & 0xFFFFFFFF)