[PATCH] Cygwin: spawn.cc: Fix typo in comment by commit 974e6d76.

2021-01-18 Thread Takashi Yano via Cygwin-patches
--- winsup/cygwin/spawn.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 42044ab53..d03492ee6 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -636,7 +636,7 @@ child_info_spawn::worker (const char

Re: [PATCH 11/11] dir.cc: Try unlink_nt first

2021-01-18 Thread Ben
On 18-01-2021 18:07, Ben wrote: > > Have I missed something else? > Alright, I now see unlink uses isproc_dev and rmdir uses isdev_dev. Is this correct? Why are files and directories handled differently? Anyway, I will add isdev_dev to the new unlink_nt Ben...

Re: [PATCH 08/11] path.cc: Allow to skip filesystem checks

2021-01-18 Thread Ben
On 18-01-2021 12:36, Corinna Vinschen via Cygwin-patches wrote: > On Jan 15 14:45, Ben Wijen wrote: > > Without any code setting the flag, this doesn't seem to make any > sense. At least the commit message should reflect on the reasons > for this change. > Something like this: path.cc:

Re: [PATCH 11/11] dir.cc: Try unlink_nt first

2021-01-18 Thread Ben
On 18-01-2021 13:13, Corinna Vinschen via Cygwin-patches wrote: > > Your code is skipping the safety checks and the has_dot_last_component() > check. The latter implements a check required by POSIX. Skipping > it introduces an incompatibility, see man 2 rmdir. > Yes, I missed

Re: [PATCH] Cygwin: pty: Set input_available_event only for cygwin pipe.

2021-01-18 Thread Takashi Yano via Cygwin-patches
On Mon, 18 Jan 2021 16:27:00 +0100 Corinna Vinschen wrote: > On Jan 19 00:00, Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Fri, 15 Jan 2021 18:26:31 +0900 > > Takashi Yano wrote: > > > - cat exits immediately in the following senario. > > > 1) Execute env

Re: [PATCH] Cygwin: pty: Set input_available_event only for cygwin pipe.

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 19 00:00, Takashi Yano via Cygwin-patches wrote: > Hi Corinna, > > On Fri, 15 Jan 2021 18:26:31 +0900 > Takashi Yano wrote: > > - cat exits immediately in the following senario. > > 1) Execute env CYGWIN=disable_pcon script > > 2) Execute cmd.exe > > 3) Execute cat in cmd.exe.

Re: [PATCH] Cygwin: pty: Set input_available_event only for cygwin pipe.

2021-01-18 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Fri, 15 Jan 2021 18:26:31 +0900 Takashi Yano wrote: > - cat exits immediately in the following senario. > 1) Execute env CYGWIN=disable_pcon script > 2) Execute cmd.exe > 3) Execute cat in cmd.exe. > This is caused by setting input_available_event for the pipe for >

Re: [PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-18 Thread Ben
> > I'm sure, but that code path is called on non-remote ntfs only anyway. > Ofcourse, I was thinking about the new _unlink_nt...

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Ben
On 18-01-2021 15:49, Corinna Vinschen via Cygwin-patches wrote: > > Care to send the resulting patch? > Will send with next patch-set. Ben...

Re: [PATCH 05/11] Cygwin: Move post-dir unlink check

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 15:31, Ben wrote: > On 18-01-2021 12:08, Corinna Vinschen via Cygwin-patches wrote: > > On Jan 15 14:45, Ben Wijen wrote: > >> Move post-dir unlink check from > >> fhandler_disk_file::rmdir to _unlink_nt > > > > Why? It's not much of a problem, codewise, but the commit message > >

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 14:51, Ben wrote: > On 18-01-2021 14:04, Corinna Vinschen via Cygwin-patches wrote: > > What about this instead? It should be better optimizable: > > > Hmmm: > * _remove_r should still set reent->_errno This is redundant: errno == (*__errno ()) == _REENT->_errno == __getreent

Re: [PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 15:30, Ben wrote: > > > On 18-01-2021 13:22, Corinna Vinschen via Cygwin-patches wrote: > > On Jan 18 13:11, Ben wrote: > >> > >> > >> On 18-01-2021 11:45, Corinna Vinschen via Cygwin-patches wrote: > >>> Rather than calling NtSetInformationFile here again, we should rather > >>> just

Re: [PATCH 05/11] Cygwin: Move post-dir unlink check

2021-01-18 Thread Ben
On 18-01-2021 12:08, Corinna Vinschen via Cygwin-patches wrote: > On Jan 15 14:45, Ben Wijen wrote: >> Move post-dir unlink check from >> fhandler_disk_file::rmdir to _unlink_nt > > Why? It's not much of a problem, codewise, but the commit message > could be improved here. > Something like

Re: [PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-18 Thread Ben
On 18-01-2021 13:22, Corinna Vinschen via Cygwin-patches wrote: > On Jan 18 13:11, Ben wrote: >> >> >> On 18-01-2021 11:45, Corinna Vinschen via Cygwin-patches wrote: >>> Rather than calling NtSetInformationFile here again, we should rather >>> just skip the transaction stuff on 1809 and later.

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Ben
On 18-01-2021 14:04, Corinna Vinschen via Cygwin-patches wrote: > What about this instead? It should be better optimizable: > Hmmm: * _remove_r should still set reent->_errno * _GLOBAL_REENT isn't threadlocal, what about __getreent() So maybe: diff --git a/winsup/cygwin/syscalls.cc

Re: [PATCH v3] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 22:10, Takashi Yano via Cygwin-patches wrote: > - After commit 232fde0e, pty changes console code page when the first > non-cygwin app is executed. If pty is started in real console device, > pty changes the code page of root console. This causes very annoying > result because

[PATCH v3] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Takashi Yano via Cygwin-patches
- After commit 232fde0e, pty changes console code page when the first non-cygwin app is executed. If pty is started in real console device, pty changes the code page of root console. This causes very annoying result because changing code page changes the font of command prompt if console

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 13:40, Ben wrote: > On 18-01-2021 11:56, Corinna Vinschen via Cygwin-patches wrote: > > Hmm, you're adding another function call to the call stack. Doesn't > > that slow down _remove_r rather than speeding it up? Ok, this function > > is called from _tmpfile_r/_tmpfile64_r only, so

Re: [PATCH v2 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 21:57, Takashi Yano via Cygwin-patches wrote: > On Mon, 18 Jan 2021 13:39:01 +0100 > Corinna Vinschen wrote: > > Sorry if I'm slow, but I was just mulling over this code snippet again, > > and I was wondering if we couldn't do without the HeapAlloc loop. > > Assuming you use a

Re: [PATCH] Cygwin: Interim malloc speedup

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
Hi Mark, On Jan 17 22:47, Mark Geisert wrote: > Hi Corinna, > Happy New Year back at you! I'm very glad to see you posting again! Yeah, I took a longer timeout over the holiday season. > Corinna Vinschen via Cygwin-patches wrote: > > Hi Mark, > > > > Happy New Year! > > > > On Dec 21 20:53,

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Ben
On 18-01-2021 11:56, Corinna Vinschen via Cygwin-patches wrote: > Hmm, you're adding another function call to the call stack. Doesn't > that slow down _remove_r rather than speeding it up? Ok, this function > is called from _tmpfile_r/_tmpfile64_r only, so dedup may trump speed > here... > >

Re: [PATCH v2 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
Hi Takashi, On Jan 18 20:24, Takashi Yano via Cygwin-patches wrote: > @@ -59,6 +59,46 @@ struct pipe_reply { >DWORD error; > }; > > +extern HANDLE attach_mutex; /* Defined in fhandler_console.cc */ > + > +static DWORD > +get_console_process_id (DWORD pid, bool match) > +{ > + DWORD list1;

Re: [PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 18 13:11, Ben wrote: > > > On 18-01-2021 11:45, Corinna Vinschen via Cygwin-patches wrote: > > Rather than calling NtSetInformationFile here again, we should rather > > just skip the transaction stuff on 1809 and later. I'd suggest adding > > another wincap flag like, say,

Re: [PATCH 11/11] dir.cc: Try unlink_nt first

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > Speedup deletion of directories. > --- > winsup/cygwin/dir.cc | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc > index f912a9e47..2e7da3638 100644 > --- a/winsup/cygwin/dir.cc > +++

Re: [PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-18 Thread Ben
On 18-01-2021 11:45, Corinna Vinschen via Cygwin-patches wrote: > Rather than calling NtSetInformationFile here again, we should rather > just skip the transaction stuff on 1809 and later. I'd suggest adding > another wincap flag like, say, "has_posix_ro_override", being true > for 1809 and

Re: [PATCH 09/11] mount.cc: Implement poor-man's cache

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > Try to avoid NtQueryVolumeInformationFile. > --- > winsup/cygwin/mount.cc | 78 -- > winsup/cygwin/mount.h | 2 +- > winsup/cygwin/path.cc | 2 +- > winsup/cygwin/path.h | 1 + > 4 files changed, 56 insertions(+),

Re: [PATCH 08/11] path.cc: Allow to skip filesystem checks

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > When file attributes are of no concern, > there is no point to query them. Without any code setting the flag, this doesn't seem to make any sense. At least the commit message should reflect on the reasons for this change. > --- > winsup/cygwin/path.cc | 3

Re: [PATCH 06/11] cxx.cc: Fix dynamic initialization for static local variables

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > The old implementation for __cxa_guard_acquire did not return 1, > therefore dynamic initialization was never performed. > > If concurrent-safe dynamic initialisation is ever needed, CXX ABI > must be followed when re-implementing __cxa_guard_acquire (et al.) >

[PATCH v2 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Takashi Yano via Cygwin-patches
- After commit 232fde0e, pty changes console code page when the first non-cygwin app is executed. If pty is started in real console device, pty changes the code page of root console. This causes very annoying result because changing code page changes the font of command prompt if console

Re: [PATCH 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Mon, 18 Jan 2021 11:23:40 +0100 Corinna Vinschen wrote: > I'm going to push patches 1 - 3. In terms of patch 4 I have a few > questions: > > On Jan 15 17:32, Takashi Yano via Cygwin-patches wrote: > > @@ -2185,7 +2185,7 @@ private: > >bool send_winch_maybe (); > >void

Re: [PATCH 05/11] Cygwin: Move post-dir unlink check

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > Move post-dir unlink check from > fhandler_disk_file::rmdir to _unlink_nt Why? It's not much of a problem, codewise, but the commit message could be improved here. Corinna

Re: [PATCH 04/11] syscalls.cc: Use EISDIR

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > This is the non-POSIX value returned by Linux since 2.1.132. > --- > winsup/cygwin/syscalls.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc > index 227d1a911..043ccdb99 100644 >

Re: [PATCH 03/11] syscalls.cc: Fix num_links

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > NtQueryInformationFile on fh_ro needs FILE_READ_ATTRIBUTES > to succeed. > --- > winsup/cygwin/syscalls.cc | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc > index

Re: [PATCH 02/11] syscalls.cc: Deduplicate _remove_r

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 14:45, Ben Wijen wrote: > The _remove_r code is already in the remove function. > Therefore, just call the remove function and make > sure errno is set correctly in the reent struct. > --- > winsup/cygwin/syscalls.cc | 15 ++- > 1 file changed, 6 insertions(+), 9

Re: [PATCH 07/11] syscalls.cc: Implement non-path_conv dependent _unlink_nt

2021-01-18 Thread Ben
Hi, After reiterating over my patches, I see this must come after implementing the 'poor mans cache' commit. I will reorder in a new patch-set. Sorry about that. Ben... On 15-01-2021 14:45, Ben Wijen wrote: > Implement _unlink_nt: wich does not depend on patch_conv > --- >

Re: [PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
Hi Ben, after venting that I missed this flag, back to the patch itself: On Jan 15 14:45, Ben Wijen wrote: > --- > winsup/cygwin/ntdll.h | 3 ++- > winsup/cygwin/syscalls.cc | 20 > 2 files changed, 18 insertions(+), 5 deletions(-) > > diff --git

Re: [PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
Hi Ben, On Jan 15 14:45, Ben Wijen wrote: > --- > winsup/cygwin/ntdll.h | 3 ++- > winsup/cygwin/syscalls.cc | 20 > 2 files changed, 18 insertions(+), 5 deletions(-) > > diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h > index d4f6aaf45..7eee383dd 100644 >

Re: [PATCH] Cygwin: document a recent bug fix

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
On Jan 15 12:52, Ken Brown via Cygwin-patches wrote: > This documents commit aec64798, "Cygwin: add flag to indicate reparse > points unknown to WinAPI". > --- > winsup/cygwin/release/3.2.0 | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/winsup/cygwin/release/3.2.0

Re: [PATCH 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Corinna Vinschen via Cygwin-patches
Hi Takashi, I'm going to push patches 1 - 3. In terms of patch 4 I have a few questions: On Jan 15 17:32, Takashi Yano via Cygwin-patches wrote: > @@ -2185,7 +2185,7 @@ private: >bool send_winch_maybe (); >void setup (); >bool set_unit (); > - static bool need_invisible (); > +