[linux-lvm] Writing forward compatible applications using /proc

Joe Thornber thornber at btconnect.com
Sun Aug 12 19:26:25 UTC 2001


On Sun, Aug 12, 2001 at 02:13:48PM -0500, Steven Lembark wrote:
> 
> 
> 
> > You should also be able to get all the information you need from the
> > tools.
> 
> Problem with this is (a) having for fork/exec the tool at each
> iteration

Look at the new tool in the experimental branch (which will turn into
2.0 at some point).  We've put in an interactive mode so you can run
the tool once, piping commands to it.

> and (b) having to capture/parse stdout/stderr and
> check exit/signal status for each call.  Just the error checking
> and validating stderr vs. stdout can double the code size for
> getting data.

Not sure I agree with this, the error checking code can be reused for
all your different LVM queries.

> Another way out (which the /proc file system was intended to
> avoid) is to put an add'l device file in the VG directory
> (e.g., "./status") which delivers a struct or block text
> with the same info as /proc has now.  Net result is that a
> simple read or fgets will pull in the necessary info w/o
> all the extra error checking.

This is unlikely to happen, it goes in /proc or not at all.  I do not
understand why people want to remove this sort of information from
/proc.

- Joe



More information about the linux-lvm mailing list