Pete's Log: huh what?!?
Entry #632, (Coding, Hacking, & CS stuff)(posted when I was 22 years old.)
How to know it's time to call it a night: just to check on memory leaks and such, I run bcheck on the current ush code. The result is as follows:
Running: ush (process id 14682) Enabling Error Checking... done Welcome to the micro shell! vangogh% signal TTIN (Stopped (tty input)) in _read at 0xed9386b8 0xed9386b8: _read+0x0008: ta 0x8
So the first three lines are bcheck output. The "Welcome..." line is due to an "echo" command in my .ushrc. Then comes the prompt, as expected. Then comes the TTIN signal that stops ush, apparently, then bcheck apparently bails. hrmmm. I'm going to sleep. This can wait til later. But it makes no sense. So obviously it's getting stopped when I attempt to do a read. Which happens in my parser code. But TTIN only gets sent to my process if it tries to read from /dev/tty and it isn't in the foreground process group. hmmmmm... so the echo in my .ushrc should be executed without forking, right? Well, I do mess around with process group id's. I must be changing the process group id of my shell, which will remove it from the foreground process group. But why does this only cause SIGTTIN if I run this from bcheck? Well, it'll wait till later. sleep-o-rama!