1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/export.h>
4 #include <linux/sched/task.h>
6 struct task_struct *rust_helper_get_current(void)
11 void rust_helper_get_task_struct(struct task_struct *t)
16 void rust_helper_put_task_struct(struct task_struct *t)
21 kuid_t rust_helper_task_uid(struct task_struct *task)
23 return task_uid(task);
26 kuid_t rust_helper_task_euid(struct task_struct *task)
28 return task_euid(task);
31 #ifndef CONFIG_USER_NS
32 uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid)
34 return from_kuid(to, uid);
36 #endif /* CONFIG_USER_NS */
38 bool rust_helper_uid_eq(kuid_t left, kuid_t right)
40 return uid_eq(left, right);
43 kuid_t rust_helper_current_euid(void)
45 return current_euid();
48 struct user_namespace *rust_helper_current_user_ns(void)
50 return current_user_ns();
53 pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk,
54 struct pid_namespace *ns)
56 return task_tgid_nr_ns(tsk, ns);