newlib-cygwin/winsup/cygwin/fhandler
Takashi Yano b03601a671 Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty.
While st_rdev returned by fstat() for /dev/tty should be FH_TTY,
the current cygwin1.dll returns FH_PTYS+minor or FH_CONS+minor.
Similarly, fstat() does not return correct value for /dev/console,
/dev/conout, /dev/conin or /dev/ptmx.

This patch fixes the issue by:
1) Introduce dev_referred_via in fhandler_termios.
2) Add new argument, which has dev_t value referred by open(),
  for constructors of fhandler_pty_slave and fhandler_pty_master to
  set the value of dev_referred_via.
3) Set st_rdev using dev_referred_via in fhandler_termios::fstat()
  if it is available.

Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-07-08 08:03:22 +09:00
..
base.cc Cygwin: fsync: Fix EINVAL for block device. 2023-01-22 19:01:34 +09:00
clipboard.cc
console.cc Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty. 2023-07-08 08:03:22 +09:00
cygdrive.cc
dev.cc
dev_fd.cc
disk_file.cc Cygwin: unlink: drop unlink_nt/unlink_nt_shareable wrappers 2023-03-20 12:55:30 +01:00
dsp.cc Cygwin: dsp: Fix SNDCTL_DSP_{POST,SYNC} ioctl() behaviour. 2023-02-25 10:28:34 +09:00
fifo.cc Cygwin: select: don't report read ready on a FIFO never opened for writing 2022-10-19 08:17:50 -04:00
floppy.cc
mqueue.cc Cygwin: get_posix_access: Make mode_t parameter mandatory 2023-02-09 21:58:44 +01:00
netdrive.cc
nodevice.cc
null.cc
pipe.cc Cygwin: pipe: Fix performance degradation for non-cygwin pipe. 2022-12-09 21:01:29 +09:00
proc.cc fhandler/proc.cc: use wincap.has_user_shstk 2023-06-20 10:06:56 +02:00
process.cc Cygwin: ctty: Replace ctty constant with more descriptive macros. 2023-03-07 10:51:29 +09:00
process_fd.cc
procnet.cc
procsys.cc Cygwin: get_posix_access: Make mode_t parameter mandatory 2023-02-09 21:58:44 +01:00
procsysvipc.cc
pty.cc Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty. 2023-07-08 08:03:22 +09:00
random.cc
raw.cc
registry.cc Cygwin: get_posix_access: Make mode_t parameter mandatory 2023-02-09 21:58:44 +01:00
serial.cc Cygwin: serial: Fix a copy-paste error in DTR setup 2022-11-29 11:47:27 +01:00
signalfd.cc
socket.cc
socket_inet.cc
socket_local.cc
socket_unix.cc
tape.cc
termios.cc Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty. 2023-07-08 08:03:22 +09:00
timerfd.cc
virtual.cc
windows.cc
zero.cc