Date: Thu, 15 Jul 1999 12:15:45 +0200 From: Sascha Blank <blank@uni-trier.de> To: freebsd-emulation@freebsd.org Subject: Solved: StarOffice 5.1 always starts setup Message-ID: <19990715121545.A725@blank.uni-trier.de>
next in thread | raw e-mail | index | archive | help
Hello, while browsing through my private freebsd-hackers archive I have found a small patch to procfs that Andrew Gordon <arg@arg1.demon.co.uk> has posted to that list on May 15th this year (the subject is "StarOffice command line args" if you want to search for the original article yourself). To make things easier I have attached the patch to this mail, it's only 2K large. His patch enables a process to read its own command line arguments via /proc/xxx/cmdline, and it looks like this is what StarOffice 5.1 needs to make it start up correctly. As a nice side effect doing a /net installation now works as well. While the patch is originally intended for 4.0-CURRENT, it applies cleanly to 3.2-STABLE as well (I have checked that just yesterday on my box at home). After I have patched my procfs module and rebuilt/reloaded/remounted it, I installed SO 5.1 as described in the usual FreeBSD How-To's. After starting /path/to/soffice the first time it actually executed the office suite and not the setup program as before! With that problem solved the next one is already waiting in line: every time soffice is executed it complains that it is unable to start the plugin manager and that I should therefore use the repair mode of the setup program. Of course the setup program says my installation is perfectly well, so there's nothing to do for it. This problem is not only cosmetic, because as a result of the missing plugin manager more than half of the auto pilots are completely broken as well as many StarBasic macro that SO uses, and SO uses *a lot* of them. Has anyone any idea what causes this problem, or even better: a way to fix it? Index: procfs_status.c =================================================================== RCS file: /repository/src/sys/miscfs/procfs/procfs_status.c,v retrieving revision 1.12 diff -c -r1.12 procfs_status.c *** procfs_status.c 1999/01/05 03:53:06 1.12 --- procfs_status.c 1999/05/15 20:36:16 *************** *** 47,52 **** --- 47,56 ---- #include <sys/tty.h> #include <sys/resourcevar.h> #include <miscfs/procfs/procfs.h> + #include <vm/vm.h> + #include <vm/pmap.h> + #include <vm/vm_param.h> + #include <sys/exec.h> int procfs_dostatus(curp, p, pfs, uio) *************** *** 164,178 **** return (EOPNOTSUPP); /* ! * For now, this is a hack. To implement this fully would require ! * groping around in the process address space to follow argv etc. */ ! ps = psbuf; ! bcopy(p->p_comm, ps, MAXCOMLEN); ! ps[MAXCOMLEN] = '\0'; ! ps += strlen(ps); ! ! ps += sprintf(ps, "\n"); xlen = ps - psbuf; xlen -= uio->uio_offset; --- 168,207 ---- return (EOPNOTSUPP); /* ! * 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. */ ! 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; xlen -= uio->uio_offset; -- Sascha Blank | FreeBSD - Student and System Administrator | that's where you want to go today! at the University of Trier, Germany | mailto:blank@fox.uni-trier.de | See http://www.freebsd.org for details To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990715121545.A725>