Reorganise ps_strings in order to gain BSD/OS 2.0 binary compatability.

This is now in line with NetBSD as well..

Note that once this series of commits is finished, you must recompile
libkvm, then ps and maybe 'w'.  If you are running the recently imported
sendmail-8.7, you should recompile that too (src/conf.c at least).
This commit is contained in:
peter 1995-12-09 04:29:11 +00:00
parent 34914741e3
commit 196f865c25
2 changed files with 11 additions and 9 deletions

View File

@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: kern_exec.c,v 1.27 1995/11/13 10:45:22 davidg Exp $
* $Id: kern_exec.c,v 1.28 1995/12/07 12:46:40 davidg Exp $
*/
#include <sys/param.h>
@ -451,7 +451,9 @@ exec_copyout_strings(imgp)
* Calculate string base and vector table pointers.
*/
arginfo = PS_STRINGS;
destp = (caddr_t)arginfo - roundup((ARG_MAX - imgp->stringspace), sizeof(char *));
destp = (caddr_t)arginfo - SPARE_USRSPACE -
roundup((ARG_MAX - imgp->stringspace), sizeof(char *));
/*
* The '+ 2' is for the null pointers at the end of each of the
* arg and env vector sets
@ -476,7 +478,7 @@ exec_copyout_strings(imgp)
/*
* Fill in "ps_strings" struct for ps, w, etc.
*/
suword(&arginfo->ps_argvstr, (int)destp);
suword(&arginfo->ps_argvstr, (int)vectp);
suword(&arginfo->ps_nargvstr, argc);
/*
@ -492,7 +494,7 @@ exec_copyout_strings(imgp)
/* a null vector table pointer seperates the argp's from the envp's */
suword(vectp++, NULL);
suword(&arginfo->ps_envstr, (int)destp);
suword(&arginfo->ps_envstr, (int)vectp);
suword(&arginfo->ps_nenvstr, envc);
/*

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)exec.h 8.3 (Berkeley) 1/21/94
* $Id: exec.h,v 1.10 1995/03/16 18:16:15 bde Exp $
* $Id: exec.h,v 1.11 1995/11/13 07:44:03 bde Exp $
*/
#ifndef _SYS_EXEC_H_
@ -46,14 +46,14 @@
* The following structure is found at the top of the user stack of each
* user process. The ps program uses it to locate argv and environment
* strings. Programs that wish ps to display other information may modify
* it; normally ps_argvstr points to the text for argv[0], and ps_nargvstr
* it; normally ps_argvstr points to the argv vector, and ps_nargvstr
* is the same as the program's argc. The fields ps_envstr and ps_nenvstr
* are the equivalent for the environment.
*/
struct ps_strings {
char *ps_argvstr; /* first of 0 or more argument strings */
char **ps_argvstr; /* first of 0 or more argument strings */
int ps_nargvstr; /* the number of argument strings */
char *ps_envstr; /* first of 0 or more environment strings */
char **ps_envstr; /* first of 0 or more environment strings */
int ps_nenvstr; /* the number of environment strings */
};
@ -62,7 +62,7 @@ struct ps_strings {
*/
#define SPARE_USRSPACE 256
#define PS_STRINGS ((struct ps_strings *) \
(USRSTACK - sizeof(struct ps_strings) - SPARE_USRSPACE))
(USRSTACK - sizeof(struct ps_strings)))
struct image_params;