If you've ever used ddi_get_pid() to return the process's PID, you'll find the 
function below rather handy:

char *
ddi_get_proc_name (void)     /* Return the command name of the current thread */
{
  return ttoproc (curthread)->p_user.u_comm;
}

This function will return the name of the process (or program) that 
ddi_get_pid() will return.

If you've ever user mixertool while running an audio app, you can only see the 
PID of the process. Using our little kernel function, you can also get the name 
of the process that was currently playing. 

We use it in our Open Sound drivers to show what process (and it's PID) is 
currently accessing the particular OSS device.

We'd like to request a formal inclusion of this function into Open Solaris.
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to