Subject: Re: Attack of the clones: turning sl*, strip*, ppp* into cloners.
To: None <tech-net@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 02/25/2002 18:14:00
>>>>struct linedisc {
>>>>	char l_name[20];
>>>>	int l_flags;
>>>>	int l_unit;
>>>>};

This still has the same basic problem of assuming that some fixed data
blob (two ints, in this case) is suitable for any line discipline.
That may be true today, but when the next exception comes along, do we
glue on more kludges and end up with _two_ backward compatability
structs?  Or do we do it right, with an ldisc-specific opaque blob
passed through from userland to the line discipline code?  (And isn't
one of the things NetBSd is about doing it right even if it's a little
more work?)

> [...], although in the char* case, you can't TIOCSLINED to "sl0" (or
> "sl") and then do a TIOCGLINED and get back the same thing.

I don't see why not; at worst it would mean maintaining a copy of the
string that was actually passed in to set whatever discipline is
current.

Whether set-get consistency is worth maintaining that string is another
question.  But it's surely not hard to do.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B