Maciej Żenczykowski
2014-Jun-11 18:24 UTC
[klibc] [PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
I guess what I wanted to say is that it might be desirable to have the
klibc shell do some dancing (perhaps controlled by some flags, but on
by default?)
If getpid() == 1 then fork a child, continue in the child, have the
parent wait for the child to terminate, then exit
child should
setsid()
close(2)
close(1)
close(0)
open("/dev/ttyS0", O_RDONLY)
open("/dev/ttyS0", O_WRONLY|O_NOCTTY)
open("/dev/ttyS0", O_WRONLY|O_NOCTTY)
And /dev/ttyS0 should either be /dev/console or specified on
commandline, or parsed out of kernel command line console= string.
Just loose ideas.
Thorsten Glaser
2014-Jun-12 08:48 UTC
[klibc] [PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
Maciej ?enczykowski dixit:>I guess what I wanted to say is that it might be desirable to have the >klibc shell do some dancing (perhaps controlled by some flags, but onThere is no klibc shell.>child should > >setsid() >close(2) >close(1) >close(0) >open("/dev/ttyS0", O_RDONLY) >open("/dev/ttyS0", O_WRONLY|O_NOCTTY) >open("/dev/ttyS0", O_WRONLY|O_NOCTTY)Yes. You boot with init=/bin/mksh (for example), then type mksh -lT!/dev/ttyS0 and it does that. This functionality is built into the shell. Busybox has some magic to divine the real console device used, but this is too fragile. In the rescue case, it?s better to do that from hand (you have either tty1 or ttyS0/ttyACM0/? or hvc0 normally ? plus, if it fails you get a message and can retry). My point here, asking for this change, is: normally you do *not* need full job control right from the start. But you *do* want to have PS1 and working command line editing (e.g. tab completion). For this, /dev/console must be isatty(). bye, //mirabilos -- FWIW, I'm quite impressed with mksh interactively. I thought it was much *much* more bare bones. But it turns out it beats the living hell out of ksh93 in that respect. I'd even consider it for my daily use if I hadn't wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
H. Peter Anvin
2014-Jun-12 19:26 UTC
[klibc] [PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
On 06/12/2014 01:48 AM, Thorsten Glaser wrote:> Maciej ?enczykowski dixit: > >> I guess what I wanted to say is that it might be desirable to have the >> klibc shell do some dancing (perhaps controlled by some flags, but on > > There is no klibc shell. >There is a version of dash included in the klibc distribution. However, it doesn't support job control. -hpa
Apparently Analagous Threads
- [PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
- [PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
- [PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
- [PATCH] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does
- [klibc:master] isatty(): use TCGETS instead of TIOCGPGRP, like dietlibc does