cosmopolitan/libc/sysv/consts/ioprio.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
965 B
C
Raw Permalink Normal View History

2022-07-14 11:32:33 +00:00
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IOPRIO_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IOPRIO_H_
#ifdef _COSMO_SOURCE
2022-07-14 11:32:33 +00:00
#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 /* _COSMO_SOURCE */
2022-07-14 11:32:33 +00:00
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IOPRIO_H_ */