Subject: compat32 support for new getargv sysctl.
To: None <port-sparc64@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: port-sparc64
Date: 05/26/2000 22:09:47
Folks,

I don't currently have access to a sparc64 system, so some parts for
the new getargv/getenv supported I've recently committed is almost
guaranteed not to work on sparc64/compat32.  It _may_ be as simple as
applying the trailing patch.  Is there anyone who can give this a test?
In theory, a 32-bit compiled new ps should work on a sparc64 kernel and
show all fields and arguments of both 64-bit native and 32-bit compat32
binaries.  Likewise, a 64-bit native ps should show both binary types
as well.  I'd be also interested in what combinations do and don't work
before the recent changes as well...

I'm pretty sure I'm subscribed to port-sparc64, but could anyone please
CC me replies in case I'm not?

TIA,
Simon.
--
Index: compat/netbsd32/netbsd32_netbsd.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/netbsd32/netbsd32_netbsd.c,v
retrieving revision 1.25
diff -p -u -r1.25 netbsd32_netbsd.c
--- netbsd32_netbsd.c	2000/03/30 11:27:18	1.25
+++ netbsd32_netbsd.c	2000/05/26 12:03:41
@@ -1953,6 +1953,13 @@ netbsd32_execve(p, v, retval)
 	if (copyout(&arginfo, (char *) PS_STRINGS, sizeof(arginfo)))
 		goto exec_abort;
 
+	/* fill process ps_strings info */
+	p->p_psstr = PS_STRINGS;
+	p->p_psargv = offsetof(struct ps_strings, ps_argvstr);
+	p->p_psnargv = offsetof(struct ps_strings, ps_nargvstr);
+	p->p_psenv = offsetof(struct ps_strings, ps_envstr);
+	p->p_psnenv = offsetof(struct ps_strings, ps_nenvstr);
+
 	/* copy out the process's signal trapoline code */
 	if (szsigcode) {
 		if (copyout((char *)pack.ep_emul->e_sigcode,