Question

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).

Was it helpful?

Solution

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

$cat /proc/$$/cmdline 

bash

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top