Re: [RFA/RFC] new setting against auto-answer? (because "input not from terminal")

Joel Brobecker
2008-10-26T18:17:34Z

> > > #define ISATTY(fd) (isatty(fd) && lseek(fd,SEEK_CUR,0) == -1)
> > >
> > > and then use ISATTY instead of isatty?
> >
> > That wouldn't work, unfortunately, because the problem is that isatty
> > returns zero.
>
> What does lseek return with the above arguments?

Here are some results:

lseek (fd, 0, SEEK_CUR) -> 0
lseek (fd, -1, SEEK_CUR) -> 0
lseek (fd, 1, SEEK_CUR) -> 1

The results are identical regardless of whether GDB is started
in interactive mode or in batch mode (commands fed through a pipe).

--
Joel