This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

tcgetattr(0, &T) fails on redirection


The following code:

#include <sys/termios.h>

main()
{
  struct termios T;
  if (tcgetattr(0, &T) == 0)
    printf("Succeeded\n");
  else
    printf("Failed\n");
}

works when I simply execute

./program

but fails when I run

./program < file

Is the standard input file descriptor not 0 in this case ?
If so, how do I find out what it is ?
Or perhaps one can't run tcgetattr on this file descriptor ?
If its impossible, how does one put standard input into
raw mode in this case ?

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]