Logo
Explore Help
Sign In
fluencelabs/musl
1
0
Fork 0
You've already forked musl
mirror of https://github.com/fluencelabs/musl synced 2025-05-10 06:07:28 +00:00
Code Issues Projects Releases Wiki Activity
musl/include/sys/sysmacros.h

16 lines
394 B
C
Raw Normal View History

header file fixes: multiple include guard consistency and correctness one file was reusing another file's macro name, and many had inconsistent underscores and application of SYS prefix, etc. patch by Szabolcs Nagy (nsz)
2012-06-15 21:52:53 -04:00
#ifndef _SYS_SYSMACROS_H
#define _SYS_SYSMACROS_H
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
support full range of dev_t major/minor numbers in makedev, etc. macros
2013-05-15 16:15:50 -04:00
#define major(x) \
fix shifts possibly larger than type in major() macro in theory this should not be an issue, since major() should only be applied to type dev_t, which is 64-bit. however, it appears some applications are not using dev_t but a smaller integer type (which works on Linux because the kernel's dev_t is really only 32-bit). to avoid the undefined behavior, do it as two shifts.
2013-06-29 13:57:13 -04:00
((unsigned)( (((x)>>31>>1) & 0xfffff000) | (((x)>>8) & 0x00000fff) ))
support full range of dev_t major/minor numbers in makedev, etc. macros
2013-05-15 16:15:50 -04:00
#define minor(x) \
((unsigned)( (((x)>>12) & 0xffffff00) | ((x) & 0x000000ff) ))
#define makedev(x,y) ( \
(((x)&0xfffff000ULL) << 32) | \
(((x)&0x00000fffULL) << 8) | \
(((y)&0xffffff00ULL) << 12) | \
(((y)&0x000000ffULL)) )
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
#endif
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.7 Page: 607ms Template: 40ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API