home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!rpi!bu.edu!dartvax!coos.dartmouth.edu!platt
- From: platt@coos.dartmouth.edu (The Crouton Man)
- Newsgroups: comp.os.linux
- Subject: bug in /dev/tty
- Message-ID: <1992Jul28.060505.29450@dartvax.dartmouth.edu>
- Date: 28 Jul 92 06:05:05 GMT
- Sender: platt@coos.dartmouth.edu
- Organization: Dartmouth College, Hanover, NH
- Lines: 27
-
- ok, i am using 0.96cpl2 + autodetect + filefs.
- shell: rc ( and bash for test )
-
- it is my understanding that you should be able to open /dev/tty
- in order to capture keyboard input even if the stdin is redirected
- from a file or pipe. however, when i do the following:
-
- cat foo | myprogram
-
- and
-
- fd = open("/dev/tty",O_RDONLY);
- printf("fd: %d\n",fd);
-
- i get
-
- fd: 0
-
- which should be stdin, and it is, but not the keyboard (tty).
- should not i have a separate file descriptor from the stdin?
- more importantly why don't i, and how do i open the keyboard (tty),
- as opposed to stdin (which has been redirected from stdin).
-
- any ideas?
-
- croutons
- croutons@dartmouth.edu
-