[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Detecting dialup connections



On Mon, Sep 27, 1999 at 12:25:34AM +0200, Michael Schwingen wrote:
> On Sun, Sep 26, 1999 at 08:42:44PM +0200, Jo Even Skarstein wrote:
> Using names like ttyS0 makes it easy to detect all serial ports present,
> regardless of the hardware, and it enables something like
> 
> for i in /dev/ttyS*; do
>  ... configure port
> done
> 
> in init scripts etc. without requiring modifications for new hardware.

Yes, that was my intention but you put it clearer. ;-)

BTW (Qfunk!), I didn't mean to completely abandon the current naming
scheme.  I even think it is a good idea if I see a socket at the back of
my machine labelled "modem2" and I then see a file "/dev/modem2".  But if
the kernel would automatically create symlinks:

	/dev
	  ttyS0 -> modem1
	  ttyS1 -> modem2
	  ttyS2 -> serial1
 	  ttyS3 -> serial2
	  ttyS4 -> some_future_extension
	  ...

everybody is happy.  I wouldn't interpret any hardware features into the
names, this is Windoze (extender) thinking to me.  The Unix way is ioctl()
IMHO.

Of course, we don't have to call the devices ttyS*.  But if we agree on
standardized names, then ttyS* is not bad because it makes life easier to
adapt things from the "big brother" (Linux).  Simple example: I just
ported "login", a simple case, actually no reason to read the entire
sources.  And so it was only good luck that I saw that the sources
detected a serial line by the name "ttyS*".

The more patches required, the more errors ...

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000/
mailto:gufl0000@stud.uni-sb.de