Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / rust / helpers / task.c
blob31c33ea2dce6fbf4f03538e78f6833d457470d90
1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/sched/task.h>
5 struct task_struct *rust_helper_get_current(void)
7 return current;
10 void rust_helper_get_task_struct(struct task_struct *t)
12 get_task_struct(t);
15 void rust_helper_put_task_struct(struct task_struct *t)
17 put_task_struct(t);
20 kuid_t rust_helper_task_uid(struct task_struct *task)
22 return task_uid(task);
25 kuid_t rust_helper_task_euid(struct task_struct *task)
27 return task_euid(task);
30 #ifndef CONFIG_USER_NS
31 uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid)
33 return from_kuid(to, uid);
35 #endif /* CONFIG_USER_NS */
37 bool rust_helper_uid_eq(kuid_t left, kuid_t right)
39 return uid_eq(left, right);
42 kuid_t rust_helper_current_euid(void)
44 return current_euid();
47 struct user_namespace *rust_helper_current_user_ns(void)
49 return current_user_ns();
52 pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk,
53 struct pid_namespace *ns)
55 return task_tgid_nr_ns(tsk, ns);