sysmacros.h 606 B

1234567891011121314151617181920
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * Sysmacro definitions for NOLIBC
  4. * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
  5. */
  6. /* make sure to include all global symbols */
  7. #include "../nolibc.h"
  8. #ifndef _NOLIBC_SYS_SYSMACROS_H
  9. #define _NOLIBC_SYS_SYSMACROS_H
  10. #include "../std.h"
  11. /* WARNING, it only deals with the 4096 first majors and 256 first minors */
  12. #define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff)))
  13. #define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff))
  14. #define minor(dev) ((unsigned int)((dev) & 0xff))
  15. #endif /* _NOLIBC_SYS_SYSMACROS_H */