Вопрос

I would like to be able to use the name of the process in servers/sched/schedule.c however schedproc structure doesn't contain the name variable. I thought about using endpoint_lookup() function to get the pointer to the proc structure but since it is defined in kernel/proc.c I wasn't sure if I could call it within schedule.c (from user space).

Это было полезно?

Решение

In user space, you could use /proc/<pid>/cmdline to get the process's name, like

$cat /proc/$$/cmdline 

bash

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top