
Originally Posted by
Dedalus
Something like include a kernel structure that keep information on the active process.
I don't know the specifics of this, ie, the kernel does not have to have the name at all, but it might. I guess it does, since it puts those command lines in /proc.
The big issue is that if the normal "user space" tools are not good enough, to get some sort of customized output from the kernel would probably require you to write a separate kernel module, which that will be quite a task.
This is just an educated guess, tho, maybe somebody is aware of something else.
Anyway, even if you got the info from the kernel, I don't think that will be some kind of big advantage over just processing the data that the kernel already maintains in /proc. You will still have to search thru a list of names, all that will be saved is creating the list. Which shouldn't take more than one or two functions, maybe 30-60 lines; you put all the names in a struct array of some sort:
Code:
struct {
char *cmdline;
int pid;
int status;
int uid;
} process;
and whatever else you might want to know. Generally there is only a few hundred processes anyway. You could use popen() with the ps command to do this too.