NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/56779: RAW mode on the TTY always returns EOF (-1)



The following reply was made to PR kern/56779; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56779: RAW mode on the TTY always returns EOF  (-1)
Date: Tue, 5 Apr 2022 07:50:35 +0000 (UTC)

 On Tue, 5 Apr 2022, mac%culver.net@localhost wrote:
 
 >    // Change TTY settings to raw mode
 >    cfmakeraw(&tty_opts_raw);
 >    tty_opts_raw.c_ispeed = tty_opts_backup.c_ispeed;
 >    tty_opts_raw.c_ospeed = tty_opts_backup.c_ospeed;
 >    tcsetattr(STDIN_FILENO, TCSANOW, &tty_opts_raw);
 >
 
 You have to initialize `tty_opts_raw' first before calling
 cfmakeraw():
 
  	tty_opts_raw = tty_opts_backup;
  	cfmakeraw(&tty_opts_raw);
 
 Otherwise, you will have junk in most of your structure. Try
 a `stty -a -f ...' to see.
 
 -RVP
 


Home | Main Index | Thread Index | Old Index