1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/sched/task.h>
5 struct task_struct
*rust_helper_get_current(void)
10 void rust_helper_get_task_struct(struct task_struct
*t
)
15 void rust_helper_put_task_struct(struct 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
);