Date: Sat, 15 May 1999 21:53:18 +0100 (BST) From: Andrew Gordon <arg@arg1.demon.co.uk> To: Jon Smith <jonsmith@physics.purdue.edu> Cc: freebsd-hackers@freebsd.org Subject: StarOffice command line args Message-ID: <Pine.BSF.3.96.990515214551.27200B-200000@server.arg.sj.co.uk>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-84950218-926801598=:27200 Content-Type: TEXT/PLAIN; charset=US-ASCII Some while ago, Jon Smith wrote: > > Has anyone successfully gotten Star Office 5.0 to run multi-user? > I have just solved this. The problem is that StarOffice accesses the command line arguments (and hence the "/net" flag needed to install multi-user) using the vile /proc/xxx/cmdline mechanism. The FreeBSD implementation of this is a hack that only returns argv[0] and therefore discards any command line arguments. The attached patch is still a hack, but is one step closer to the right answer: it now returns the right answer if the current process reads its own /proc/xxx/cmdline, but still returns only argv[0] if a process attempts to read another process' cmdline. This is enough to solve the StarOffice problem. The reason I haven't done the job properly is that I don't know how to read an address in user-space for a process other than curproc. From the implementation of /proc/xxx/mem, this seems difficult to do. --0-84950218-926801598=:27200 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=procfs-patch Content-Transfer-Encoding: BASE64 Content-ID: <Pine.BSF.3.96.990515215318.27200C@server.arg.sj.co.uk> Content-Description: SW5kZXg6IHByb2Nmc19zdGF0dXMuYw0KPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PQ0KUkNTIGZpbGU6IC9yZXBvc2l0b3J5L3NyYy9zeXMvbWlzY2ZzL3Byb2Nm cy9wcm9jZnNfc3RhdHVzLmMsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjEy DQpkaWZmIC1jIC1yMS4xMiBwcm9jZnNfc3RhdHVzLmMNCioqKiBwcm9jZnNf c3RhdHVzLmMJMTk5OS8wMS8wNSAwMzo1MzowNgkxLjE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DQohIAkJCWVycm9yID0gY29weWluc3RyKHBzdHIucHNf YXJndnN0cltpXSwgcHMsDQohIAkJCQkgYnl0ZXNfbGVmdCwgJmRvbmUpOw0K ISAJCQkvKiBJZiB0b28gbG9uZyBvciBtYWxmb3JtZWQsIGp1c3QgdHJ1bmNh dGUJKi8NCiEgCQkJaWYgKGVycm9yKSB7DQohIAkJCQllcnJvciA9IDA7DQoh IAkJCQlicmVhazsNCiEgCQkJfQ0KISAJCQlwcyArPSBkb25lOw0KISAJCQli eXRlc19sZWZ0IC09IGRvbmU7DQohIAkJfQ0KISAJfSBlbHNlIHsNCiEgCQlw cyA9IHBzYnVmOw0KISAJCWJjb3B5KHAtPnBfY29tbSwgcHMsIE1BWENPTUxF Tik7DQohIAkJcHNbTUFYQ09NTEVOXSA9ICdcMCc7DQohIAkJcHMgKz0gc3Ry bGVuKHBzKTsNCiEgCX0NCiAgDQogIAl4bGVuID0gcHMgLSBwc2J1ZjsNCiAg CXhsZW4gLT0gdWlvLT51aW9fb2Zmc2V0Ow0K --0-84950218-926801598=:27200-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990515214551.27200B-200000>