diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-10-21 13:26:45 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-10-21 13:26:45 +0000 |
commit | 91d53422c7a89facb0c367bbd280be3c30b39871 (patch) | |
tree | 85e614eddc30e652abe90f5d8c95fb368247a18b /sys/dev/pci/drm/include | |
parent | 34f473adeddc7cfcf173f708876443638c178176 (diff) |
handle capable(CAP_SYS_NICE) for allowing high priority contexts
Diffstat (limited to 'sys/dev/pci/drm/include')
-rw-r--r-- | sys/dev/pci/drm/include/linux/capability.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/include/linux/capability.h b/sys/dev/pci/drm/include/linux/capability.h index db938d1bc96..00511a0bfcd 100644 --- a/sys/dev/pci/drm/include/linux/capability.h +++ b/sys/dev/pci/drm/include/linux/capability.h @@ -9,11 +9,18 @@ #include <machine/cpu.h> #define CAP_SYS_ADMIN 0x1 -static inline int +#define CAP_SYS_NICE 0x2 + +static inline bool capable(int cap) { - KASSERT(cap == CAP_SYS_ADMIN); - return suser(curproc) == 0; + switch (cap) { + case CAP_SYS_ADMIN: + case CAP_SYS_NICE: + return suser(curproc) == 0; + default: + panic("unhandled capability"); + } } #endif |