[PATCH 2/3] Cygwin: fhandler_disk_file::fstatvfs: refactor

2020-01-27 Thread Ken Brown
Define a new method fhandler_base::fstatvfs_by_handle, extracted from fhandler_disk_file::fstatvfs, which gets the statvfs information when a handle is available. This will be used in future commits for special files that have been opened with O_PATH. --- winsup/cygwin/fhandler.h| 1

[PATCH 1/3] Cygwin: fhandler_base::fstat_fs: accomodate the O_PATH flag

2020-01-27 Thread Ken Brown
Treat a special file opened with O_PATH the same as a regular file, i.e., use its handle to get the stat information. Before this change, fstat_fs opened the file a second time, with the wrong flags and without closing the existing handle. A side effect was to change the openflags of the file, po

[PATCH 3/3] Cygwin: FIFO::fstatvfs: use our handle if O_PATH is set

2020-01-27 Thread Ken Brown
If O_PATH is set, then the fhandler_fifo object has a handle that can be used for getting the statvfs information. Use it by calling fhandler_base::fstatvfs_by_handle. Before this change, fhandler_disk_file::fstatfvs was called on a new fhandler_disk object, which would then have to be opened. --

[PATCH 0/3] Some O_PATH fixes

2020-01-27 Thread Ken Brown
Ken Brown (3): Cygwin: fhandler_base::fstat_fs: accomodate the O_PATH flag Cygwin: fhandler_disk_file::fstatvfs: refactor Cygwin: FIFO::fstatvfs: use our handle if O_PATH is set winsup/cygwin/fhandler.h| 1 + winsup/cygwin/fhandler_disk_file.cc | 24 +--- wi

[PATCH v2] Cygwin: console: Share readahead buffer within the same process.

2020-01-27 Thread Takashi Yano
- The cause of the problem reported in https://www.cygwin.com/ml/cygwin/2020-01/msg00220.html is that the chars input before dup() cannot be read from the new file descriptor. This is because the readahead buffer (rabuf) in the console is newly created by dup(), and does not inherit from th

[PATCH v5] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-27 Thread Takashi Yano
- After commit 6cc299f0e20e4b76f7dbab5ea8c296ffa4859b62, outputs of cygwin programs which call both printf() and WriteConsole() are frequently distorted. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_tty.cc | 37 +--

Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-27 Thread Corinna Vinschen
On Jan 27 13:22, Takashi Yano wrote: > On Mon, 27 Jan 2020 11:38:22 +0900 > Takashi Yano wrote: > > On Sun, 26 Jan 2020 22:33:19 +0900 > > Takashi Yano wrote: > > > On Sat, 25 Jan 2020 20:38:37 +0900 > > > Takashi Yano wrote: > > > > On Fri, 24 Jan 2020 12:07:30 +0100 > > > > Corinna Vinschen wrote

Re: [PATCH] Cygwin: console: Share readahead buffer within the same process.

2020-01-27 Thread Corinna Vinschen
Hi Takashi, On Jan 25 18:45, Takashi Yano wrote: > - The cause of the problem reported in > https://www.cygwin.com/ml/cygwin/2020-01/msg00220.html is that the > chars input before dup() cannot be read from the new file descriptor. > This is because the readahead buffer (rabuf) in the console