Subject: Re: sysv ps(1) implementation [was: ps(1) sysv silliness]
To: NetBSD Userlevel Technical Discussion List <>
From: Greg A. Woods <>
List: tech-userlevel
Date: 06/09/2000 02:08:53
[[ now that we're right off track... ]]

[ On Thursday, June 8, 2000 at 17:37:18 (-0700), Greywolf wrote: ]
> Subject: Re: sysv ps(1) implementation [was: ps(1) sysv silliness]
> [mkdir/mknod not; i remember now it was that mkdir had to be setuid
>  because the _rename_ call hadn't been implemented yet, that was it!

if you s/rename/mkdir/ then yes, that's right....

>  so mkdir was, more or less (modulo GC and error checking)

make that:

	psep = strrchr(path, '/');
	*psep = '\0';
	strcpy(parent, path);
	*psep = '/';
	mknod(path, 040777, 0);
	chown(path, getuid(), getgid())
	strcpy(dname, path);
	strcat(dname, "/.");
	link(path, dname);
	strcat(dname, ".");
	link(pname, dname);

> I didn't say that EVERYTHING should be linked, but if the operations are
> _similar enough_, they should be linked.
> Would you, for example, have a separate program to handle symbolic links?
> Would you write chown and chgrp to be separate programs?

Yes, in both cases.  That's not to say they might not share some
common subroutines, but they should be separate binaries.

> "Shared libraries are bad enough."  And you say *I* resist progress?!?
> I think shared libs are saving us from overrunning disks and memory.

The window in time where that was true was, for most people, very very
small.  Certainly there are still obsolete small machines in running
condition which have original drives that are on the size boundary where
using shared libraries keeps them usable with modern software (I have
some of them, but I tend to put more modern drives on them and stuff
them as full of memory as possible).  There are also issues of code
bloat on newer machines with wide words, but that's separate.

It also seems to be the case that on some of those obsolete machines
shared libraries chew up significant extra amounts of their precious CPU

Now if we could get rid of this bogus user-level implementation of
dynamic linking and move back to real kernel-level semi-static shared
libraries, complete with someone doing full and proper profiling to
ensure that only truly commonly shared objects are built into all shared
libraries, then we might have something worth talking about!  :-)

[[ well they are a damn sight faster and they make a *lot* better use of
virtual memory on a general purpose system! ]]

							Greg A. Woods

+1 416 218-0098      VE3TCP      <>      <robohack!woods>
Planix, Inc. <>; Secrets of the Weird <>