mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 22:47:50 +00:00
parent
4b43b5c1c1
commit
0c617366e5
@ -26,6 +26,8 @@ struct task_struct * lx_emul_task_get_current(void);
|
||||
|
||||
struct task_struct * lx_emul_task_get(int pid);
|
||||
|
||||
int lx_emul_task_pid(struct task_struct *task);
|
||||
|
||||
void lx_emul_task_create(struct task_struct * task,
|
||||
const char * name,
|
||||
int pid,
|
||||
|
@ -70,6 +70,19 @@ extern "C" struct task_struct * lx_emul_task_get(int pid)
|
||||
}
|
||||
|
||||
|
||||
extern "C" int lx_emul_task_pid(struct task_struct * t)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
Lx_kit::env().scheduler.for_each_task([&] (Lx_kit::Task & task) {
|
||||
if (t == task.lx_task())
|
||||
ret = task.pid();
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
extern "C" void lx_emul_task_name(struct task_struct * t, const char * name)
|
||||
{
|
||||
Lx_kit::env().scheduler.task((void*)t).name(name);
|
||||
|
Loading…
Reference in New Issue
Block a user