Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Nov 1998 14:05:51 -0600 (CST)
From:      Dave Bodenstab <imdave@mcs.net>
To:        questions@FreeBSD.ORG
Subject:   /proc/?/cmdline
Message-ID:  <199811302005.OAA03249@base486.home.org>

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811302005.OAA03249>