aboutgitcodelistschat:MatrixIRC
path: root/common
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-09-01 10:16:36 +0200
committerAlice Frosi <afrosi@redhat.com>2023-09-01 10:37:04 +0200
commit59f7f7c241253293c25e001c9340f1deeb138311 (patch)
tree4be7c160cbec552f5d5d3dcd88e85c1b98407749 /common
parentaecd6adbd2f5ce12437215fe2e64e004d28db86b (diff)
downloadseitan-59f7f7c241253293c25e001c9340f1deeb138311.tar
seitan-59f7f7c241253293c25e001c9340f1deeb138311.tar.gz
seitan-59f7f7c241253293c25e001c9340f1deeb138311.tar.bz2
seitan-59f7f7c241253293c25e001c9340f1deeb138311.tar.lz
seitan-59f7f7c241253293c25e001c9340f1deeb138311.tar.xz
seitan-59f7f7c241253293c25e001c9340f1deeb138311.tar.zst
seitan-59f7f7c241253293c25e001c9340f1deeb138311.zip
cooker, seitan: add sched_setscheduler
The sched_setscheduler requires to set the pid of the process we want to change the priority, this adds a new metadata for getting the target pid at runtime. Add a couple of syscalls for the scheduler in the string parsing. Signed-off-by: Alice Frosi <afrosi@redhat.com>
Diffstat (limited to 'common')
-rw-r--r--common/gluten.h3
-rw-r--r--common/util.c34
2 files changed, 24 insertions, 13 deletions
diff --git a/common/gluten.h b/common/gluten.h
index 6414e20..1f06221 100644
--- a/common/gluten.h
+++ b/common/gluten.h
@@ -147,7 +147,8 @@ BUILD_BUG_ON(BITS_PER_NUM(CONTEXT_TYPE_MAX) + \
enum metadata_type {
UID_TARGET = 0,
GID_TARGET = 1,
- METADATA_MAX = GID_TARGET,
+ PID_TARGET = 2,
+ METADATA_MAX = PID_TARGET,
};
extern const char *metadata_type_str[METADATA_MAX + 1];
diff --git a/common/util.c b/common/util.c
index 8815ecb..3e81a1c 100644
--- a/common/util.c
+++ b/common/util.c
@@ -55,17 +55,27 @@ const char *cmp_type_str[CMP_MAX + 1] = {
"EQ", "NE", "GT", "GE", "LT", "LE",
};
-const char *metadata_type_str[METADATA_MAX + 1] = { "uid", "gid" };
+const char *metadata_type_str[METADATA_MAX + 1] = { "uid", "gid", "pid" };
const char *syscall_name_str[N_SYSCALL + 1] = {
- [__NR_chown] = "chown",
- [__NR_connect] = "connect",
- [__NR_ioctl] = "ioctl",
- [__NR_lchown] = "lchown",
- [__NR_mknod] = "mknod",
- [__NR_mknodat] = "mknodat",
- [__NR_read] = "read",
- [__NR_socket] = "socket",
- [__NR_unshare] = "unshare",
- [__NR_open] = "open",
-
+ [__NR_chown] = "chown",
+ [__NR_connect] = "connect",
+ [__NR_ioctl] = "ioctl",
+ [__NR_lchown] = "lchown",
+ [__NR_mknod] = "mknod",
+ [__NR_mknodat] = "mknodat",
+ [__NR_open] = "open",
+ [__NR_read] = "read",
+ [__NR_sched_get_priority_max] = "sched_get_priority_max",
+ [__NR_sched_get_priority_min] = "sched_get_priority_min",
+ [__NR_sched_getaffinity] = "sched_getaffinity",
+ [__NR_sched_getattr] = "sched_getattr",
+ [__NR_sched_getparam] = "sched_getparam",
+ [__NR_sched_getscheduler] = "sched_getscheduler",
+ [__NR_sched_setaffinity] = "sched_setaffinity",
+ [__NR_sched_setattr] = "sched_setattr",
+ [__NR_sched_setparam] = "sched_setparam",
+ [__NR_sched_setscheduler] = "sched_setscheduler",
+ [__NR_sched_yield] = "sched_yield",
+ [__NR_socket] = "socket",
+ [__NR_unshare] = "unshare",
};