how to get current process name?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to find the name of the current process. I've been tracing through
the way that the procfs does it, but now I'm kind of lost.

I want to find the name used on the command line, not necessarily that of
the executable. I looked at proc_pid_cmdline, and it does a lot of task
locking and accessing of the vm.

Since the module I'm working on has the current process blocked, is all of
the locking necessary?

Basically, my questions are:
	Do I need to lock the task and inc the mm_users?
	Where exactly is the cmdline name found?
	How do I access it?
	What will the memory look like there ( nul terminiators, etc. )?

Thanks for any help anyone can provide.

-- 
John Tyner
jtyner@cs.ucr.edu

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux