mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Improve upon the new pledge command
This commit is contained in:
parent
b707fca77a
commit
1d744ea11b
13 changed files with 382 additions and 64 deletions
30
libc/sysv/consts/ioprio.h
Normal file
30
libc/sysv/consts/ioprio.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IOPRIO_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IOPRIO_H_
|
||||
|
||||
#define IOPRIO_WHO_PROCESS 1
|
||||
#define IOPRIO_WHO_PGRP 2
|
||||
#define IOPRIO_WHO_USER 3
|
||||
|
||||
#define IOPRIO_CLASS_SHIFT 13
|
||||
#define IOPRIO_CLASS_MASK 0x07
|
||||
#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
|
||||
|
||||
#define IOPRIO_PRIO_CLASS(ioprio) \
|
||||
(((ioprio) >> IOPRIO_CLASS_SHIFT) & IOPRIO_CLASS_MASK)
|
||||
#define IOPRIO_PRIO_DATA(ioprio) ((ioprio)&IOPRIO_PRIO_MASK)
|
||||
#define IOPRIO_PRIO_VALUE(class, data) \
|
||||
((((class) & IOPRIO_CLASS_MASK) << IOPRIO_CLASS_SHIFT) | \
|
||||
((data)&IOPRIO_PRIO_MASK))
|
||||
|
||||
#define IOPRIO_CLASS_NONE 0
|
||||
#define IOPRIO_CLASS_RT 1
|
||||
#define IOPRIO_CLASS_BE 2
|
||||
#define IOPRIO_CLASS_IDLE 3
|
||||
|
||||
#define IOPRIO_NR_LEVELS 8
|
||||
#define IOPRIO_BE_NR IOPRIO_NR_LEVELS
|
||||
|
||||
#define IOPRIO_NORM 4
|
||||
#define IOPRIO_BE_NORM IOPRIO_NORM
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IOPRIO_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue