# ps_strings



## fluca1978 (Jul 18, 2013)

I cannot fully understand how struct ps_strings is used. As far as I understand it is used to keep a pointer to _argv, envp_ of a process at a fixed location (the top of the user process stack) so that it is always possible to get the pointers from outside of the process.

Despite the name, I cannot find any reference to ps_strings in the ps(1) implementation, and even the kvm_getargv(3) does not seem to me is bound to ps_strings. Can someone point me to an example of using ps_strings?


----------



## fonz (Jul 18, 2013)

The only uses I can find quickly are in /usr/src/sys/kern/kern_exec.c and /usr/src/sys/kern/kern_proc.c.


----------



## fluca1978 (Jul 19, 2013)

fonz said:
			
		

> The only uses I can find quickly are in /usr/src/sys/kern/kern_exec.c and /usr/src/sys/kern/kern_proc.c.



Yes I know, but that is not related to ps(1) or similar commands, as far as I understand. So what is the purpose of ps_strings now?


----------



## fonz (Jul 25, 2013)

Have you considered the possibility that in this case the ps_ part is just short for "process" and might very well have absolutely nothing to do with ps(1)?

As far as I can tell it's just a kernel data structure that makes the housekeeping required by the implementation of calls such as execve(2) a little easier.


----------



## cpm@ (Jul 26, 2013)

See ps_strings(5) from BSDi man pages. Also you could request to add this manual page to FreeBSD.

Also I point you to:
http://bxr.su/search?q=ps_strings&defs=&refs=&path=&project=FreeBSD.


----------



## fluca1978 (Jul 26, 2013)

cpu82 said:
			
		

> See ps_strings(5) from BSDi man pages. Also you could request to add this manual page to FreeBSD.



Thanks but that does not explain how ps_strings is used, and in fact it has the same information that you can find in the sources.


----------



## cpm@ (Jul 31, 2013)

@fluca1978,

FYI, see this request: 
http://lists.freebsd.org/pipermail/freebsd-doc/2013-July/022422.html.


----------

