xref: /csrg-svn/sys/sys/exec.h (revision 53008)
146439Sbostic /*-
253001Sbostic  * Copyright (c) 1992 The Regents of the University of California.
346439Sbostic  * All rights reserved.
423413Smckusick  *
546439Sbostic  * %sccs.include.redist.c%
646439Sbostic  *
7*53008Smckusick  *	@(#)exec.h	7.11 (Berkeley) 03/18/92
823413Smckusick  */
916744Ssam 
1053001Sbostic #include <machine/exec.h>
11*53008Smckusick 
12*53008Smckusick /*
13*53008Smckusick  * The following structure is found at the top of the user stack of each
14*53008Smckusick  * user process. The ps program uses it to locate argv and environment
15*53008Smckusick  * strings. Programs that wish ps to display other information may modify
16*53008Smckusick  * it; normally ps_argvstr points to the text for argv[0], and ps_nargvstr
17*53008Smckusick  * is the same as the program's argc. The fields ps_envstr and ps_nenvstr
18*53008Smckusick  * are the equivalent for the environment.
19*53008Smckusick  */
20*53008Smckusick struct ps_strings {
21*53008Smckusick 	char	*ps_argvstr;	/* first of 0 or more argument strings */
22*53008Smckusick 	int	ps_nargvstr;	/* the number of argument strings */
23*53008Smckusick 	char	*ps_envstr;	/* first of 0 or more environment strings */
24*53008Smckusick 	int	ps_nenvstr;	/* the number of environment strings */
25*53008Smckusick };
26*53008Smckusick 
27*53008Smckusick /*
28*53008Smckusick  * Address of ps_strings structure (in user space).
29*53008Smckusick  */
30*53008Smckusick #define	PS_STRINGS \
31*53008Smckusick 	((struct ps_strings *)(USRSTACK - sizeof(struct ps_strings)))
32