From 914f7187672279328ffe563d52118e1c1621939d 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 00000000..7d17574a --- /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)