From owner-freebsd-questions Mon Nov 30 12:05:49 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA07739 for freebsd-questions-outgoing; Mon, 30 Nov 1998 12:05:49 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from base486.home.org (imdave.pr.mcs.net [205.164.3.77]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA07733 for ; Mon, 30 Nov 1998 12:05:46 -0800 (PST) (envelope-from imdave@mcs.net) Received: (from imdave@localhost) by base486.home.org (8.9.1a/8.9.1) id OAA03249 for questions@FreeBSD.org; Mon, 30 Nov 1998 14:05:51 -0600 (CST) Date: Mon, 30 Nov 1998 14:05:51 -0600 (CST) From: Dave Bodenstab Message-Id: <199811302005.OAA03249@base486.home.org> To: questions@FreeBSD.ORG Subject: /proc/?/cmdline Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG There was recently a discussion about linux's /proc file system and the use by Star Office of /proc/%u/cmdline to access the command line arguments. I think I recall that the consensus was that this is sort of silly because a program ought to be able to use argv[]. I tended to agree with this at that time. Recently, I took a look at GNU's zlibc-0.9e.tar -- and I now think that this application refutes the above argument. Briefly, zlibc uses ld.so's LD_PRELOAD to load a shared object that front-ends selected system calls (open, etc.) in order to detect if the file name in question has been compressed with gzip. If so (the file doesn't exist, but file.gz does) it then uses gzip to uncompress the file and feed it via a pipe to the process doing the open. Pretty clever, eh? It wants access to the command line so that it can handle certain programs as exceptions. Of course, argv is not available to this shared object. I hadn't realized such tricks could be accomplished with shared objects. I can easily see that might have very useful application to debugging, etc. So, the question is: In light of the above, would not linux's /proc/*/cmdline be a useful feature for FreeBSD? In addition, it solves one of the problems using Star Office on FreeBSD. Dave Bodenstab imdave@mcs.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message