From owner-freebsd-emulation Fri Jul 23 4:35:18 1999 Delivered-To: freebsd-emulation@freebsd.org Received: from atena.eurocontrol.fr (atena.uneec.eurocontrol.fr [147.196.69.10]) by hub.freebsd.org (Postfix) with ESMTP id 823221501E for ; Fri, 23 Jul 1999 04:35:12 -0700 (PDT) (envelope-from roberto@eurocontrol.fr) Received: from caerdonn.eurocontrol.fr (caerdonn.eurocontrol.fr [147.196.43.2]) by atena.eurocontrol.fr (Postfix) with ESMTP id 33E641BE8 for ; Fri, 23 Jul 1999 13:33:12 +0200 (MET DST) (envelope-from roberto@caerdonn.eurocontrol.fr) Received: by caerdonn.eurocontrol.fr (Postfix, from userid 1193) id 8C1713B60; Fri, 23 Jul 1999 13:33:05 +0200 (CEST) Date: Fri, 23 Jul 1999 13:33:05 +0200 From: Ollivier Robert To: emulation@freebsd.org Subject: Star Office 5.1 Message-ID: <19990723133305.A525@caerdonn.eurocontrol.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/0.95.5i X-Operating-System: FreeBSD 4.0-CURRENT Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I confirm that you _need_ the procfs patch that was posted a while ago to run SO 5.1. Just in case, here it is: -=-=- cvs diff: Diffing . Index: procfs_status.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/procfs/procfs_status.c,v retrieving revision 1.14 diff -u -2 -u -r1.14 procfs_status.c --- procfs_status.c 1999/05/22 20:10:26 1.14 +++ procfs_status.c 1999/07/19 14:50:12 @@ -49,4 +49,8 @@ #include #include +#include +#include +#include +#include int @@ -165,13 +169,38 @@ /* - * For now, this is a hack. To implement this fully would require - * groping around in the process address space to follow argv etc. + * This is a hack: the correct behaviour is only implemented for + * the case of the current process enquiring about its own argv + * (due to the difficulty of accessing other processes' address space). + * For other cases, we cop out and just return argv[0] from p->p_comm. + * Note that if the argv is no longer available, we deliberately + * don't fall back on p->p_comm or return an error: the authentic + * Linux behaviour is to return zero-length in this case. */ - ps = psbuf; - bcopy(p->p_comm, ps, MAXCOMLEN); - ps[MAXCOMLEN] = '\0'; - ps += strlen(ps); - - ps += sprintf(ps, "\n"); + if (curproc == p) { + struct ps_strings pstr; + int i; + size_t bytes_left, done; + + error = copyin((void*)PS_STRINGS, &pstr, sizeof(pstr)); + if (error) return (error); + bytes_left = sizeof(psbuf); + ps = psbuf; + for (i = 0; bytes_left && (i < pstr.ps_nargvstr); i++) { + error = copyinstr(pstr.ps_argvstr[i], ps, + bytes_left, &done); + /* If too long or malformed, just truncate */ + if (error) { + error = 0; + break; + } + ps += done; + bytes_left -= done; + } + } else { + ps = psbuf; + bcopy(p->p_comm, ps, MAXCOMLEN); + ps[MAXCOMLEN] = '\0'; + ps += strlen(ps); + } xlen = ps - psbuf; -=-=- -- Ollivier ROBERT -=- Eurocontrol EEC/TEC -=- Ollivier.Robert@eurocontrol.fr The Postman hits! The Postman hits! You have new mail. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message