syslog.h: add LOG_PRIMASK and LOG_PRI macros

Change-Id: I9ae0c3165cea831e329e49211ff738cbb89a65de
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3408
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Jérôme Duval 2020-11-21 20:02:51 +01:00
parent 8ef2ce074c
commit c5ff1f14c6

View File

@ -61,6 +61,9 @@
#define LOG_INFO 6
#define LOG_DEBUG 7
#define LOG_PRIMASK (0x7) /* mask to extract priority part */
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
/* turns a priority into a mask usable for setlogmask() */
#define LOG_MASK(pri) (1 << (pri))
#define LOG_UPTO(pri) ((1 << ((pri) + 1)) - 1)