at v6.13 993 B view raw
1// SPDX-License-Identifier: GPL-2.0 2 3#include <linux/sched/task.h> 4 5struct task_struct *rust_helper_get_current(void) 6{ 7 return current; 8} 9 10void rust_helper_get_task_struct(struct task_struct *t) 11{ 12 get_task_struct(t); 13} 14 15void rust_helper_put_task_struct(struct task_struct *t) 16{ 17 put_task_struct(t); 18} 19 20kuid_t rust_helper_task_uid(struct task_struct *task) 21{ 22 return task_uid(task); 23} 24 25kuid_t rust_helper_task_euid(struct task_struct *task) 26{ 27 return task_euid(task); 28} 29 30#ifndef CONFIG_USER_NS 31uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) 32{ 33 return from_kuid(to, uid); 34} 35#endif /* CONFIG_USER_NS */ 36 37bool rust_helper_uid_eq(kuid_t left, kuid_t right) 38{ 39 return uid_eq(left, right); 40} 41 42kuid_t rust_helper_current_euid(void) 43{ 44 return current_euid(); 45} 46 47struct user_namespace *rust_helper_current_user_ns(void) 48{ 49 return current_user_ns(); 50} 51 52pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, 53 struct pid_namespace *ns) 54{ 55 return task_tgid_nr_ns(tsk, ns); 56}