[lkml]   [2001]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: no ioctls for serial ports? [was Re: LANANA: To Pending Device Number Registrants]

On Sat, 19 May 2001, Linus Torvalds wrote:

> On Sat, 19 May 2001, Pavel Machek wrote:
> >
> > Well, if we did something like modify(int fd, char *how), you could do
> >
> > modify(0, "nonblock,9600")
> What you're really proposing is to make ioctl's be ASCII strings.
> Which is not necessarily a bad idea, and I think plan9 did something
> similar (or rather, if I remember correctly, plan9 has control streams
> that were ASCII. Or am I confused?).

You are not. Control streams in question look like normal files. Normally
driver exports a tree with several data files (e.g. fd0, fd1, fd2, fd3)
and several control files (e.g. fd0ctl, fd1ctl, fd2ctl, fd3ctl). write()
to the latter passes commands. No extra syscalls needed.

Notice that sometimes it's not ASCII - depends on the nature of stuff you
are passing. Things like setting font, etc. need to pass bitmaps, so some
parts of the stuff you write end up as binary. Which is perfectly sane.

> And a "stream of bytes" is in a very real sense the simplest structure,
> and is the unix way (and the plan9 way is to avoid binary streams, and use
> ASCII text instead when possible, whihc probably also makes sense).

s/possible/makes sense/. For commands ASCII is OK, but for cases when you
pass binary data as a part of command (not just "something large", but
something that really happens to be a bitmap, etc.) you write it as binary

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:53    [W:0.362 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site