On Wed, Dec 19, 2001 at 06:35:34PM -0500, Roland McGrath wrote:
> For set_bits, I think you can do:
> 
>       tioctl_tiocgeta (underlying, &ttystat);
>       if (termstate.__ispeed)
>         ttystat.__ispeed = termstate.__ispeed;
>       if (termstate.__ospeed)
>         ttystat.__ospeed = termstate.__ospeed;
>       cfmakeraw (&ttystat);
>       ttystat.c_cflag = termstate.c_cflag &~ HUPCL;
>       tioctl_tiocseta (underlying, &ttystat);
>       
> Of course, check for errors and if you get EOPNOTSUPP or MIG_BAD_ID
> from tiocgeta, then don't try the set calls.

Well, ok, I did that (of course, tioctl_tiocgeta takes the arguments a bit
differently, but that's easy), although I don't know why you set raw mode
explicitely.  I will leave everything what is questionable to you for
someone else.  Just two issues:  What about CSTOP and/or CSIZE, do I handle
it the way it is done for Mach devices?  And do I update the termstate to
match reality, eg do I go back and do a tiocgeta and (re)set the speeds?

I am prety ignorant to the details of all those control bits, if it is not
easy to give a definite answer to this I will just leave it out for now as
they are not required by anything I want to do with the code anyway.

The last piece of unconsidered code is this snipped from devio that is
run after the device is opened.  Do we have to do anything like that, too?

      device_get_status (phys_device, TTY_STATUS,
                         (dev_status_t)&ttystat, &count);
      ttystat.tt_breakc = 0;
      ttystat.tt_flags = TF_ANYP | TF_LITOUT | TF_NOHANG | TF_HUPCLS;
      device_set_status (phys_device, TTY_STATUS,
                         (dev_status_t)&ttystat, TTY_STATUS_COUNT);

Seems this saga is slowly coming to an (intermediate) end ;)

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to