PS_STRINGS(5) BSD Programmer's Manual PS_STRINGS(5)NAMEps_strings - argument and environment information
SYNOPSIS
#include <sys/exec.h>
DESCRIPTION
A variety of programs and library functions need to be able to find the
argument and environment vectors in a running program. For example, the
ps(1) program needs to be able to print the arguments to programs. To
make it easy to find the vectors, the system places a ps_strings struc-
ture at the top of the stack:
struct ps_strings {
char **ps_argv;
int ps_argc;
char **ps_envp;
int ps_nenv;
};
The ps_argv field points to the program's argument vector, and the
ps_argc field counts the number of elements in the vector. The ps_envp
field points to the program's environment vector, and the ps_nenv field
counts the number of elements in the vector.
The system passes the address of this structure to the program in a ma-
chine dependent and/or binary format dependent way. On the i386 archi-
tecture, the address is passed in the EBX register and, if the program is
an ELF executable, in an AT_PSSTRINGS element in the auxiliary vector.
SEE ALSOexecve(2), auxv(5)BSDI BSD/OS February 11, 1998 1