Subject: Re: mount*(8) linked as one binary ?
To: Jaromír Dolecek <firstname.lastname@example.org>
From: Matthew Orgass <email@example.com>
Date: 11/03/2000 11:10:16
On Wed, 1 Nov 2000, Jarom=EDr Dolecek wrote:
> Matthew Orgass wrote:
> > It seems wrong that the combined mount is the largest binary in /sbin=
> > /bin, larger then dhclient and the shells, although this is mostly libc=
> > fault. It would probably be worthwile to put umount in the same binary=
> > since it should use the same libc functions.
> It not so on my i386:
Oh, right, because the number you gave earlier includes the separate
> > Why would you want to replace mount_foo?
> Testing or whatever - I needed to replace system binaries with a script
> couple of times on some systems (either when debugging something or
> because I needed to force some usage), for example.
I think this is more of an argument against mount_foo being in the path,
although I guess if they are kept at all then execing would make things
easier in that case. If all special mount_foo programs were in, say,
/sbin/mount.d then everything would just use mount -t, so there would only
be one thing to replace instead of nineteen.
> > It isn't really needed, but is cleaner if you want to do anything mor=
> > then just pass the result to the user. With a separate binary you need=
> > interpret the result, while libraries are forced to have public
> > interfaces. Further, libraries are versioned so you can at least get a=
> > error message when what you are expecting has been changed.
> Yes, though the advantages of library are typically worth the necessary
> efford only when the involved code is used on more than only one place :)
I personally like to design the major parts of all programs as
libraries, since the extra effort usually results in cleaner code that
more than pays for itself later. Of course, it does also have a
performance and code size penalty, but I think that also is a price worth
Also, if you make it easier to share the code, more people will use it.=
Anything worth doing once is worth doing twice :).