summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/include/linux/capability.h
blob: c91b233d9e3a7e692ebd387d0c43e5326799ad44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Public domain. */

#ifndef _LINUX_CAPABILITY_H
#define _LINUX_CAPABILITY_H

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ucred.h>
#include <machine/cpu.h>

#define CAP_SYS_ADMIN	0x1
#define CAP_SYS_NICE	0x2

static inline bool
capable(int cap) 
{ 
	switch (cap) {
	case CAP_SYS_ADMIN:
	case CAP_SYS_NICE:
		return suser(curproc) == 0;
	default:
		panic("unhandled capability");
	}
} 

static inline bool
perfmon_capable(void)
{
	return false;
}

#endif