aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1996-02-22 19:20:48 +0000
committerPeter Wemm <peter@FreeBSD.org>1996-02-22 19:20:48 +0000
commitb5e47c10aa92ad5a8ac30e49325d609edc0e6bc6 (patch)
tree91041c40c01f1da55076ee2d23fcc0c24b09e4b8
parent1f993b918b02880de531c160d2ce268712ec98b5 (diff)
Notes
-rw-r--r--sys/i386/ibcs2/ibcs2.h4
-rw-r--r--sys/i386/linux/linux_generic.c4
-rw-r--r--sys/kern/kern_exec.c10
-rw-r--r--sys/sys/exec.h10
4 files changed, 15 insertions, 13 deletions
diff --git a/sys/i386/ibcs2/ibcs2.h b/sys/i386/ibcs2/ibcs2.h
index 8063c7be0b84..8e2573bc52d2 100644
--- a/sys/i386/ibcs2/ibcs2.h
+++ b/sys/i386/ibcs2/ibcs2.h
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ibcs2.h,v 1.3 1994/10/17 22:13:06 sos Exp $
+ * $Id: ibcs2.h,v 1.4 1995/05/30 07:59:50 rgrimes Exp $
*/
/* trace all iBCS2 system calls */
@@ -65,7 +65,7 @@ typedef void (*ibcs2_sig_t) (int);
/* misc defines */
#define UA_ALLOC() \
- (ALIGN(((caddr_t)PS_STRINGS) + sizeof(struct ps_strings)))
+ (ALIGN(((caddr_t)PS_STRINGS) - SPARE_USRSPACE))
#define IBCS2_RETVAL_SIZE (3 * sizeof(int))
#define IBCS2_MAGIC_IN 0xe215
#define IBCS2_MAGIC_OUT 0x8e11
diff --git a/sys/i386/linux/linux_generic.c b/sys/i386/linux/linux_generic.c
index 48df332aeb98..7704ceed654e 100644
--- a/sys/i386/linux/linux_generic.c
+++ b/sys/i386/linux/linux_generic.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_generic.c,v 1.3 1995/06/25 17:30:46 sos Exp $
+ * $Id: linux_generic.c,v 1.1 1995/06/25 17:32:34 sos Exp $
*/
#include <i386/linux/linux.h>
@@ -48,7 +48,7 @@ caddr_t ua_alloc_init(int len)
caddr_t ptr;
ptr = (caddr_t)ALIGN((PS_STRINGS));
- ptr += sizeof(struct ps_strings);
+ ptr -= SPARE_USRSPACE;
ua_ptr = (caddr_t)(ptr + ALIGN(len));
return ptr;
}
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index ea2b811457fd..970d4e05cb3e 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -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.21 1995/05/30 08:05:24 rgrimes Exp $
+ * $Id: kern_exec.c,v 1.21.4.1 1995/08/31 10:00:43 davidg Exp $
*/
#include <sys/param.h>
@@ -444,7 +444,9 @@ exec_copyout_strings(iparams)
* Calculate string base and vector table pointers.
*/
arginfo = PS_STRINGS;
- destp = (caddr_t)arginfo - roundup((ARG_MAX - iparams->stringspace), sizeof(char *));
+ destp = (caddr_t)arginfo - SPARE_USRSPACE -
+ roundup((ARG_MAX - iparams->stringspace), sizeof(char *));
+
/*
* The '+ 2' is for the null pointers at the end of each of the
* arg and env vector sets
@@ -469,7 +471,7 @@ exec_copyout_strings(iparams)
/*
* 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);
/*
@@ -485,7 +487,7 @@ exec_copyout_strings(iparams)
/* 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);
/*
diff --git a/sys/sys/exec.h b/sys/sys/exec.h
index b47b11db3ecd..920e0a18574c 100644
--- a/sys/sys/exec.h
+++ b/sys/sys/exec.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)exec.h 8.3 (Berkeley) 1/21/94
- * $Id: exec.h,v 1.9 1994/10/09 21:50:57 sos Exp $
+ * $Id: exec.h,v 1.10 1995/03/16 18:16:15 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 execsw {
int (*ex_imgact)(void * /* struct image_params * */);