Subject: Re: dev/MAKEDEV not portable
To: Chris G. Demetriou <cgd@pa.dec.com>
From: Not for internal consumption <greywolf@starwolf.starwolf.com>
List: current-users
Date: 12/22/1997 20:53:56
"Chris G. Demetriou" sez:
/*
 * > How about a mknod(8) that took the following args:
 * > 
 * > usage: mknod [ -n major-bits ] path {c|b} major minor
 *

I should have also included:

	-w devwidth-bits

 * That makes significantly less sense than a perl script (which I don't
 * particularly like, either; there's no guarantee that systems' 'mknod'
 * binaries won't do something behind your back that you can't correct
 * for -- and I think i've seen systems do such things in the past 8-).

I can't imagine that a mknod(2) call would do such things; such systems
I would consider BAD (Broken As Designed).

 * If you can't compile our mknod on the server system, i.e. so that you
 * could use our versions of the macros to create a device node from
 * major and minor numbers, why will you be able to compile our mknod on
 * the server system to get that functionality?

But if you write it in a simplistic way such that it didn't need to
reference any {machine,platform}-specific #include files, what's the
problem?  Sure you can't compile OUR mknod, but how about a minimalist
version which can handle the -n major-bits -w devwidth-bits?

The thing about perl is that perl may or may not exist on the server,
of course.  Your reference to it "making significantly less sense" tells
me that I may have missed something in this thread somewhere, so sorry
if I've hit something that's already been hashed a bit.

Assuming that I _didn't_ miss something, writing it in perl makes less
sense to me than writing it in straight unassuming C.  At worst case
we could require it to be some god{,dess}awful format like

	mknod path type devbits majorbits major minor

which I'm sure you don't like either 8'), but I hope I'm getting the
points across, i.e.,
	a) coding makes more sense than scripting in this case, if for
	   no other reason than to avoid the chance that perl doesn't
	   exist on the server; and
	2) not depending on system macros or the ability for the server
	   to compile "our mknod".

 * cgd
 */

If I'm missing something or coming across too strangely, allow me to
rethink my thoughts.



				--*greywolf;
--
"Do not meddle in the affairs of wizards,
 for they become subtle and quick to anger."	-- J. R. R. Tolkien