xref: /original-bsd/sys/sys/exec.h (revision 333da485)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  * (c) UNIX System Laboratories, Inc.
5  * All or some portions of this file are derived from material licensed
6  * to the University of California by American Telephone and Telegraph
7  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8  * the permission of UNIX System Laboratories, Inc.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)exec.h	8.3 (Berkeley) 01/21/94
13  */
14 
15 #include <machine/exec.h>
16 
17 /*
18  * The following structure is found at the top of the user stack of each
19  * user process. The ps program uses it to locate argv and environment
20  * strings. Programs that wish ps to display other information may modify
21  * it; normally ps_argvstr points to the text for argv[0], and ps_nargvstr
22  * is the same as the program's argc. The fields ps_envstr and ps_nenvstr
23  * are the equivalent for the environment.
24  */
25 struct ps_strings {
26 	char	*ps_argvstr;	/* first of 0 or more argument strings */
27 	int	ps_nargvstr;	/* the number of argument strings */
28 	char	*ps_envstr;	/* first of 0 or more environment strings */
29 	int	ps_nenvstr;	/* the number of environment strings */
30 };
31 
32 /*
33  * Address of ps_strings structure (in user space).
34  */
35 #define	PS_STRINGS \
36 	((struct ps_strings *)(USRSTACK - sizeof(struct ps_strings)))
37 
38 /*
39  * Arguments to the exec system call.
40  */
41 struct execve_args {
42 	char	*fname;
43 	char	**argp;
44 	char	**envp;
45 };
46