xref: /csrg-svn/sys/sys/exec.h (revision 61064)
146439Sbostic /*-
2*61064Sbostic  * Copyright (c) 1992, 1993
3*61064Sbostic  *	The Regents of the University of California.  All rights reserved.
423413Smckusick  *
546439Sbostic  * %sccs.include.redist.c%
646439Sbostic  *
7*61064Sbostic  *	@(#)exec.h	8.1 (Berkeley) 06/02/93
823413Smckusick  */
916744Ssam 
1053001Sbostic #include <machine/exec.h>
1153008Smckusick 
1253008Smckusick /*
1353008Smckusick  * The following structure is found at the top of the user stack of each
1453008Smckusick  * user process. The ps program uses it to locate argv and environment
1553008Smckusick  * strings. Programs that wish ps to display other information may modify
1653008Smckusick  * it; normally ps_argvstr points to the text for argv[0], and ps_nargvstr
1753008Smckusick  * is the same as the program's argc. The fields ps_envstr and ps_nenvstr
1853008Smckusick  * are the equivalent for the environment.
1953008Smckusick  */
2053008Smckusick struct ps_strings {
2153008Smckusick 	char	*ps_argvstr;	/* first of 0 or more argument strings */
2253008Smckusick 	int	ps_nargvstr;	/* the number of argument strings */
2353008Smckusick 	char	*ps_envstr;	/* first of 0 or more environment strings */
2453008Smckusick 	int	ps_nenvstr;	/* the number of environment strings */
2553008Smckusick };
2653008Smckusick 
2753008Smckusick /*
2853008Smckusick  * Address of ps_strings structure (in user space).
2953008Smckusick  */
3053008Smckusick #define	PS_STRINGS \
3153008Smckusick 	((struct ps_strings *)(USRSTACK - sizeof(struct ps_strings)))
32