From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eli Zaretskii" To: cgf@redhat.com Cc: gdb@sources.redhat.com Subject: Re: DOS/Windows-specific code: inflow.c Date: Tue, 08 May 2001 11:15:00 -0000 Message-id: <1858-Tue08May2001211559+0300-eliz@is.elta.co.il> References: <20010503211502.21716.qmail@web6401.mail.yahoo.com> <3AF1DAA0.3060702@cygnus.com> <200105071609.TAA24129@is.elta.co.il> <200105081145.OAA06214@is.elta.co.il> <20010508105251.A24160@redhat.com> X-SW-Source: 2001-05/msg00140.html > Date: Tue, 8 May 2001 10:52:51 -0400 > From: Christopher Faylor > > On Tue, May 08, 2001 at 02:45:43PM +0300, Eli Zaretskii wrote: > > > > * inflow.c:new_tty() > > > > #if !defined(__GO32__) && !defined(_WIN32) > > #ifdef TIOCNOTTY > > /* Disconnect the child process from our controlling terminal. On some > > systems (SVR4 for example), this may cause a SIGTTOU, so temporarily > > ignore SIGTTOU. */ > > tty = open ("/dev/tty", O_RDWR); > > if (tty > 0) > > { > > void (*osigttou) (); > > > > osigttou = (void (*)()) signal (SIGTTOU, SIG_IGN); > > ioctl (tty, TIOCNOTTY, 0); > > close (tty); > > signal (SIGTTOU, osigttou); > > } > > #endif > > > > /* Now open the specified new terminal. */ > > > > #ifdef USE_O_NOCTTY > > tty = open (inferior_thisrun_terminal, O_RDWR | O_NOCTTY); > > #else > > tty = open (inferior_thisrun_terminal, O_RDWR); > > #endif > > if (tty == -1) > > { > > print_sys_errmsg (inferior_thisrun_terminal, errno); > > _exit (1); > > } > > > >This code assumes too many Posix features. Should we define > >NO_NEW_TTY? > > Actually, I think something should define O_NOCTTY to 0. Are you sure it would be enough? Is inferior_thisrun_terminal defined on all platforms? > > * inflow.c: pass_signal() [and many more functions that call kill()] > > > > /* ARGSUSED */ > > static void > > pass_signal (int signo) > > { > > #ifndef _WIN32 > > kill (PIDGET (inferior_pid), SIGINT); > > #endif > > } > > > >I don't really understand why does the Windows build need to ifdef > >away the calls to kill. In any case, it sounds like providing a no-op > >version in win32-nat.c would be a better idea. > > I don't understand it either. This should work fine on _WIN32. Maybe > we should just get rid of the #ifndef. I'm all for it.