a request for Pierre

Pierre A. Humblet pierre@phumblet.no-ip.org
Fri Jan 23 21:44:00 GMT 2004


Christopher Faylor wrote:
> 
> Pierre,
> I find that I need to make another change to the tty stuff and I'm
> worried that I'm just doing an old Three Stooges comedy routine where I
> close one drawer and another one hits me in the face.
> 
> Would it be possible for you to enumerate in one message, all of the
> tests you have run on the tty stuff so I won't be reenabling bugs
> when I make changes.  If you could make the tests a runnable script
> that would be wonderful, but that's probably not possible.

Sorry Chris, it's not automated and it relies on repeating the same
test in many different conditions, in particular from 
 cmd.exe with CYGWIN=tty or not, 
 cygwin console, notty (sh & bash), 
 cygwin tty (sh & bash)
 rxvt (sh & bash)

1) In any window (see above)
setsid sleep 10
should return immdiately.

2)  Create a tty window, say tty1.
>From any other window (see above) 
setsid sh -c "echo hello > /dev/tty1; /bin/sleep 10; /bin/echo there > /dev/tty"
and repeat with bash.

Should return immediately
Use ps to see that sleep has ctty 1
Verify "hello there" output on tty1

3) In any window (see above)
the following program should go in the background
when given argument 0, 1 or 2

#include <unistd.h>
#include <signal.h>

main(int argc, char * argv[])
{
  int i;
  signal(SIGHUP, SIG_IGN);
  i = atoi(argv[1]);

  if (i == 0) {
    close(0);
    close(1);
    close(2);
  }
  if (!fork()) {
    if (i == 1) {
      close(0);
      close(1);
      close(2);
    }
    setsid();
    if (i == 2) {
      close(0);
      close(1);
      close(2);
    }
    sleep(10);
  }
}

I used to also test inetd on 9x but I think it's
covered by test #3 

Good luck.

Pierre



More information about the Cygwin-developers mailing list