Re: [PATCH] Cygwin: pipe: Restore non-blocking mode which was reset for non-cygwin app.

2024-03-11 Thread Takashi Yano
On Tue, 12 Mar 2024 08:03:16 +0900 Takashi Yano wrote: > + /* Set read pipe itself always non-blocking for cygwin process. > + Blocking/non-blocking is simulated in raw_read(). For write > + pipe, follow is_nonblocking(). */ > + int fd; > + cygheap_fdenum cfd (false);

Re: [PATCH] Cygwin: pipe: Restore non-blocking mode which was reset for non-cygwin app.

2024-03-11 Thread Takashi Yano
On Mon, 11 Mar 2024 21:33:04 +0100 Corinna Vinschen wrote: > this looks much better. Just one question and a few comment > changes... > > On Mar 11 22:18, Takashi Yano wrote: > > Subject: [PATCH v2] Cygwin: pipe: Make sure to set read pipe non-blocking > > for > >

Re: [PATCH] Cygwin: pipe: Restore non-blocking mode which was reset for non-cygwin app.

2024-03-11 Thread Takashi Yano
On Mon, 11 Mar 2024 20:42:37 +0900 Takashi Yano wrote: > On Mon, 11 Mar 2024 11:47:32 +0100 > Corinna Vinschen wrote: > > Hi Takashi, > > > > On Mar 10 19:31, Takashi Yano wrote: > > > @@ -590,6 +591,10 @@ child_info_spawn::worker (const char *prog_ar

Re: [PATCH] Cygwin: pipe: Restore non-blocking mode which was reset for non-cygwin app.

2024-03-11 Thread Takashi Yano
On Mon, 11 Mar 2024 11:47:32 +0100 Corinna Vinschen wrote: > Hi Takashi, > > On Mar 10 19:31, Takashi Yano wrote: > > @@ -590,6 +591,10 @@ child_info_spawn::worker (const char *prog_arg, const > > char *const *argv, > > { > > fha

[PATCH] Cygwin: pipe: Restore non-blocking mode which was reset for non-cygwin app.

2024-03-10 Thread Takashi Yano
ygwin: pipe: Adopt FILE_SYNCHRONOUS_IO_NONALERT flag for read pipe.") Reported-by: wh Reviewed-by: Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pipe.cc | 12 +++- winsup/cygwin/spawn.cc | 22 ++ 2 files changed, 29 insertions(+), 5 deletions(-)

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Takashi Yano
On Wed, 6 Mar 2024 03:42:23 +0900 Takashi Yano wrote: > + name.MaximumLength = MAX_PATH * sizeof (WCHAR); This should be: name.MaximumLength = sizeof (pipename_buf); -- Takashi Yano

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Takashi Yano
On Tue, 5 Mar 2024 17:54:19 +0100 Corinna Vinschen wrote: > On Mar 5 23:47, Takashi Yano wrote: > > On Tue, 5 Mar 2024 11:14:46 +0100 > > Corinna Vinschen wrote: > > > This doesn't affect your patch, but while looking into this, what > > > strikes

[PATCH v3] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Takashi Yano
: b531d6b06eeb ("Cygwin: pipe: Introduce temporary query_hdl.") Reported-by: Alisa Sireneva, Johannes Schindelin Reviewed-by: Corinna Vinschen Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pipe.cc | 57 -- winsup/cygwin/release/3.5.2| 4 +++ 2 fil

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Takashi Yano
On Tue, 5 Mar 2024 11:14:46 +0100 Corinna Vinschen wrote: > On Mar 5 09:06, Takashi Yano wrote: > > On Mon, 4 Mar 2024 18:38:07 +0100 > > Corinna Vinschen wrote: > > > On Mar 4 16:45, ASSI wrote: > > > > Corinna Vinschen writes: > > > > > Rig

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-04 Thread Takashi Yano
ocess from another installation of cygwin using NtQueryInformationProcess() with ProcessHandleInformation. However, I cannot imagne the case that the pipe is made by one cygwin installation but the reader process is from another installation of cygwin. BTW, what about v2 patch itself? -- Takashi Yano

[PATCH] Cygwin: console: Fix a race issue between close() and open().

2024-03-04 Thread Takashi Yano
d-by: Kate Deplaix Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/console.cc | 58 ++- winsup/cygwin/release/3.5.2 | 4 +++ 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/consol

[PATCH v2] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
: b531d6b06eeb ("Cygwin: pipe: Introduce temporary query_hdl.") Reported-by: Alisa Sireneva, Johannes Schindelin Reviewed-by: Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pipe.cc | 62 ++ winsup/cygwin/release/3.5.2| 4 +++ 2 files changed, 22 inserti

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
On Sun, 03 Mar 2024 11:39:40 +0100 ASSI wrote: > Takashi Yano writes: > >> After noticing that we enumerate all the processes (which is an expensive > >> operation) just to skip all of the non-Cygwin ones anyway, I wonder if it > >> wouldn't be smarter to go throug

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
rocesses (which is an expensive > operation) just to skip all of the non-Cygwin ones anyway, I wonder if it > wouldn't be smarter to go through the internal list of cygpids and take it > from there, skipping the `SystemProcessInformation` calls altogether. Yeah, that makes sens. I'll submi

[PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-02 Thread Takashi Yano
pipe: Introduce temporary query_hdl.") Reported-by: Alisa Sireneva, Johannes Schindelin Reviewed-by: Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pipe.cc | 10 ++ winsup/cygwin/release/3.5.2| 4 2 files changed, 14 insertions(+) diff --git a/winsup/cygwin/fhandl

[PATCH] Cygwin: console: Do not unmap shared console memory belonging to ctty.

2024-03-01 Thread Takashi Yano
://cygwin.com/pipermail/cygwin/2024-February/255561.html Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Reported-by: Kate Deplaix Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/console.cc | 8 +--- 1 file changed, 5 insert

[PATCH] Cygwin: pty: Re-fix the last bug regarding nat-pipe.

2024-02-16 Thread Takashi Yano
Fixes: f907b5f405a3 ("Cygwin: pty: Fix failure to revert from nat-pipe in disable_pcon.") Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pt

[PATCH] Cygwin: pty: Fix failure to revert from nat-pipe in disable_pcon.

2024-02-16 Thread Takashi Yano
Fixes: a9038789488e ("Cygwin: pty: Additional fix for transferring input at exit."); Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc index e52590c9d..27a2c7

[PATCH] Cygwin: console: Fix a bug that 64th console cannot be handled.

2024-02-15 Thread Takashi Yano
Fixes: 930e553da8e9 ("Cygwin: console: Unify EnumWindows() callback functions."); Signed-off-by: Takashi Yano --- winsup/cygwin/devices.cc| 2 +- winsup/cygwin/devices.in| 2 +- winsup/cygwin/fhandler/console.cc | 8 +++- winsup/cygwin/loca

[PATCH] Cygwin: console: Fix a bug that cannot handle consoles more than 32.

2024-02-15 Thread Takashi Yano
Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Signed-off-by: Takashi Yano --- winsup/cygwin/devices.cc| 2 +- winsup/cygwin/devices.in| 2 +- winsup/cygwin/release/3.5.1 | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)

[PATCH] Cygwin: console: Unify EnumWindows() callback functions.

2024-02-14 Thread Takashi Yano
Previously, three similar callback fuctions were used in console code. This patch unifies these functions to ease maintenance cost. Fixes: 8aad3a7edeb2 ("Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.") Suggested-by: Johannes Schindelin Signed-off-by: Ta

[PATCH] Cygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector.

2024-02-14 Thread Takashi Yano
Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pt

[PATCH] Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.

2024-02-13 Thread Takashi Yano
Previously, minor device number of console was not assigned correctly in ConEmu environment. This is because console window of ConEmu is not enumerated by EnumWindows(). This patch fixes the issue. Signed-off-by: Takashi Yano --- winsup/cygwin/autoload.cc | 2 ++ winsup/cygwin

[PATCH] Cygwin: console: Make VMIN and VTIME work.

2024-02-13 Thread Takashi Yano
Previously, VMIN and VTIME did not work at all. This patch fixes that. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/console.cc | 26 ++ winsup/cygwin/release/3.5.1 | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin

[PATCH] Cygwin: pty: Fix potential handle leak regarding CallNamedPipe().

2024-02-13 Thread Takashi Yano
In pty master_thread, 6 handles are duplicated when CallNamedPipe() requests that. Though some of them are not used so should be closed, they were not. This causes handle leak potentially. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 20 ++-- 1 file changed

[PATCH] Cygwin: pty: Fix handle leak in master process.

2024-02-13 Thread Takashi Yano
ahead data between two input pipes.") Reported-by: Hakkin Lain Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 1 + winsup/cygwin/release/3.5.1 | 4 2 files changed, 5 insertions(+) diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc index

Re: [PATCH] Cygwin: console: Avoid slipping past disable_master_thread check.

2024-02-03 Thread Takashi Yano
igher than cygwin users. If you attached gdb to non-msys2 program and failed to retrieve meaningfull information, how about attaching gdb to the stub process? Note that the stub process is hidden from normal cygwin tools such as 'ps'. However, it is real parent process of the non-msys2 program and you can find it in taskmanager. -- Takashi Yano

Re: [PATCH] Cygwin: console: Fix exit code for non-cygwin process.

2024-02-03 Thread Takashi Yano
_from_windows() pinfo::set_exit_code() I guess detecting crash of sbub process needs modification of spawn.cc. -- Takashi Yano

[PATCH] Cygwin: net: Make if_nametoindex, etc. consistent with if_nameindex.

2024-02-03 Thread Takashi Yano
uot;Rename if_indextoname to cygwin_if_indextoname (analag for if_nametoindex)") Reviewed-by: Signed-off-by: Takashi Yano --- winsup/cygwin/autoload.cc | 2 -- winsup/cygwin/net.cc | 31 +-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/winsup/cygw

[PATCH] Cygwin: console: Avoid slipping past disable_master_thread check.

2024-02-02 Thread Takashi Yano
t;) Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/console.cc | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc index 6a42b4949..1c8d383cd 100644 --- a/winsup/cygwin/fhandler/console.cc ++

[PATCH] Cygwin: console: Fix exit code for non-cygwin process.

2024-02-01 Thread Takashi Yano
nsole: Make the console accessible from other terminals."), that the pointer cons is accessed before fixing when it is NULL. This patch fixes the issue. Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Reported-by: Johannes Schindelin Signed-

Re: [PATCH] Cygwin: pthread: Fix handle leak in pthread_once.

2024-01-24 Thread Takashi Yano
t time. Thanks. -- Takashi Yano

[PATCH] Cygwin: pthread: Fix handle leak in pthread_once.

2024-01-24 Thread Takashi Yano
-by: Takashi Yano --- winsup/cygwin/thread.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 7bb4f9fc8..0f8327831 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -2060,6 +2060,9 @@ pthread::once (pthread_once_t

[PATCH] Cygwin: dsp: Improve minimum buffser size estimation.

2023-10-30 Thread Takashi Yano
the minimum value of Win MME to work. Fixes: 322c7150b25e ("Cygwin: dsp: Avoid setting buffer that is too small.") Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 60 +-- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/win

[PATCH] Cygwin: dsp: Avoid setting buffer that is too small.

2023-09-17 Thread Takashi Yano
The buffer size that is too small causes choppy sound. That is not practical at all. With this patch, the minimum value of the buffer size (i.e. fragstotal * fragsize) is restricted to 16384 bytes. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 2 ++ 1 file changed, 2

[PATCH] Cygwin: dsp: Fix a bug that app hangs if it killed during write().

2023-09-17 Thread Takashi Yano
If app is killed during blocking write(), it sometimes hangs. This patch fixes the issue. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc index

Re: [PATCH] Cygwin: Fix __cpuset_zero_s prototype

2023-09-09 Thread Takashi Yano
deletion(-) > > Pushed, including doc fix. These patch shoud be applied also to cygwin-3_4-branch, but didn't. -- Takashi Yano

[PATCH] Cygwin: dsp: Improve response time of select()/poll().

2023-09-07 Thread Takashi Yano
With this patch, the response time of select()/poll() has been improved by utilizing semaphore (select_sem) just like pipe and fifo. In addition, notification of exceptional conditions has been added. Fixes: 2c06014f12b0 ("Cygwin: dsp: Implement select()/poll().") Signed-off-by: Ta

[PATCH] Cygwin: dsp: Implement select()/poll().

2023-09-06 Thread Takashi Yano
Previously, sound device /dev/dsp did not support select()/poll(). These have been implemented with this patch. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 38 +++ winsup/cygwin/local_includes/fhandler.h | 11 ++ winsup/cygwin/local_includes/select.h | 9

[PATCH 3/3] Cygwin: dsp: Fix trivial editorial issue.

2023-09-05 Thread Takashi Yano
--- winsup/cygwin/fhandler/dsp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc index 00f2bab69..861443352 100644 --- a/winsup/cygwin/fhandler/dsp.cc +++ b/winsup/cygwin/fhandler/dsp.cc @@ -1029,7 +1029,7 @@

[PATCH 2/3] Cygwin: dsp: Reduce wait time for blocking read().

2023-09-05 Thread Takashi Yano
Previous wait time of 100msec is too long if application specifies smaller buffer. With this patch, the wait time is reduced to 1msec. --- winsup/cygwin/fhandler/dsp.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler/dsp.cc

[PATCH 1/3] Cygwin: dps: Fix a bug that read() could not return -1 on error.

2023-09-05 Thread Takashi Yano
--- winsup/cygwin/fhandler/dsp.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc index 8e51a51c5..e872aa08c 100644 --- a/winsup/cygwin/fhandler/dsp.cc +++ b/winsup/cygwin/fhandler/dsp.cc @@ -1192,7 +1192,9 @@

[PATCH] Cygwin: Implement sound mixer device.

2023-09-01 Thread Takashi Yano
This patch adds implementation of OSS-based sound mixer device. This allows applications to change the sound playing volume. NOTE: Currently, the recording volume cannot be changed. Signed-off-by: Takashi Yano --- winsup/cygwin/Makefile.am |1 + winsup/cygwin/devices.cc

[PATCH] Cygwin: dsp: Fix a few trivial bugs.

2023-09-01 Thread Takashi Yano
Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 4 ++-- winsup/cygwin/local_includes/fhandler.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc index 27f0a50ce..8e51a51c5 100644

[PATCH v4] Cygwin: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
if it is too long. Reported-by: Ed Morton Reviewed-by: Corinna Vinschen Signed-off-by: Takashi Yano --- winsup/cygwin/dcrt0.cc| 7 ++- winsup/cygwin/local_includes/winsup.h | 4 winsup/cygwin/release/3.4.9 | 3 +++ winsup/cygwin/spawn.cc| 9

[PATCH v3] Cygwin: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
if it is too long. Reported-by: Ed Morton Signed-off-by: Takashi Yano --- winsup/cygwin/dcrt0.cc| 8 +++- winsup/cygwin/include/cygwin/limits.h | 5 ++--- winsup/cygwin/release/3.4.9 | 3 +++ winsup/cygwin/spawn.cc| 10 +- 4 files changed, 17

Re: [PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
Hi Corinna, On Mon, 28 Aug 2023 21:27:09 +0900 Takashi Yano wrote: > On Mon, 28 Aug 2023 12:57:19 +0200 > Corinna Vinschen wrote: > > On Aug 28 18:46, Takashi Yano wrote: > > > Previously, the number of command line args was not checked for > > > cygwin process. D

Re: [PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
1) * sizeof (char **)); > + memcpy (newargv, __argv, (__argc + 1) * sizeof (char **)); >/* Handle any signals which may have arrived */ >sig_dispatch_pending (false); >_my_tls.call_signal_handler (); Shouldn't this be sizeof (char *), not sizeof (char **)? -- Takashi Yano

Re: [PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
On Mon, 28 Aug 2023 12:57:19 +0200 Corinna Vinschen wrote: > On Aug 28 18:46, Takashi Yano wrote: > > Previously, the number of command line args was not checked for > > cygwin process. Due to this, segmentation fault was caused if too > > many command line args are

Re: [PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
On Mon, 28 Aug 2023 21:09:53 +0900 Takashi Yano wrote: > On Mon, 28 Aug 2023 12:57:19 +0200 > Corinna Vinschen wrote: > > On Aug 28 18:46, Takashi Yano wrote: > > > Previously, the number of command line args was not checked for > > > cygwin process. Due to this,

Re: [PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
On Mon, 28 Aug 2023 13:09:18 +0200 Corinna Vinschen wrote: > On Aug 28 12:57, Corinna Vinschen wrote: > > On Aug 28 18:46, Takashi Yano wrote: > > > Previously, the number of command line args was not checked for > > > cygwin process. Due to this, segmentation fault w

Re: [PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
On Mon, 28 Aug 2023 12:57:19 +0200 Corinna Vinschen wrote: > On Aug 28 18:46, Takashi Yano wrote: > > Previously, the number of command line args was not checked for > > cygwin process. Due to this, segmentation fault was caused if too > > many command line args are

Re: [PATCH] Cygwin: termios: Refactor the function is_console_app().

2023-08-28 Thread Takashi Yano
On Mon, 28 Aug 2023 12:58:31 +0200 Corinna Vinschen wrote: > On Aug 28 18:21, Takashi Yano wrote: > > Signed-off-by: Takashi Yano > > --- > > winsup/cygwin/fhandler/termios.cc | 18 -- > > 1 file changed, 8 insertions(+), 10 deletions(-) > >

[PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
-by: Takashi Yano --- winsup/cygwin/release/3.4.9 | 3 +++ winsup/cygwin/spawn.cc | 43 - winsup/cygwin/sysconf.cc| 9 +++- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/release/3.4.9 b/winsup/cygwin/release/3.4.9 index

[PATCH] Cygwin: termios: Refactor the function is_console_app().

2023-08-28 Thread Takashi Yano
Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/termios.cc | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/winsup/cygwin/fhandler/termios.cc b/winsup/cygwin/fhandler/termios.cc index 789ae0179..d106955dc 100644 --- a/winsup/cygwin/fhandler

[PATCH] Cygwin: spawn: Fix segfalt when too many command line args are specified.

2023-08-28 Thread Takashi Yano
(), STATUS_STACK_OVERFLOW occurs if the stack does not have enough space. With this patch, the total length of the arguments is restricted to 1/4 of total stack size for the process, and spawnve() returns E2BIG if the size exceeds the limit. Reported-by: Ed Morton Signed-off-by: Takashi Yano

Re: [PATCH] Cygwin: pty: Fix failure to clear switch_to_nat_pipe flag.

2023-08-21 Thread Takashi Yano
Hi Corinna, On Mon, 21 Aug 2023 10:20:30 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Aug 19 15:07, Takashi Yano wrote: > > After the commit fbfea31dd9b9, switch_to_nat_pipe is not cleared > > properly when non-cygwin app is terminated in the case where the > >

[PATCH] Cygwin: pty: Fix failure to clear switch_to_nat_pipe flag.

2023-08-19 Thread Takashi Yano
process. This patch fixes the issue by adding a new argument which requests only PID of non-cygwin process to get_console_process_id(). Fixes: fbfea31dd9b9 ("Cygwin: pty: Avoid cutting the branch the pty master is sitting on.") Signed-off-by: Takashi Yano --- winsup/cygwin/fhand

Re: [PATCH] Cygwin: shared: Fix access permissions setting in open_shared().

2023-08-15 Thread Takashi Yano
On Wed, 16 Aug 2023 08:37:46 +0900 Takashi Yano wrote: > After the commit 93508e5bb841, the access permissions argument passed > to open_shared() is ignored and always replaced with (FILE_MAP_READ | > FILE_MAP_WRITE). This causes the weird behaviour that sshd service > process loses it

[PATCH] Cygwin: shared: Fix access permissions setting in open_shared().

2023-08-15 Thread Takashi Yano
not work properly. This patch resumes the access permission settings to fix that. Fixes: 93508e5bb841 ("Cygwin: open_shared: don't reuse shared_locations parameter as output") Signedd-off-by: Takashi Yano --- winsup/cygwin/mm/shared.cc | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH] Cygwin: pty: Add missing pinfo check in transfer_input().

2023-08-15 Thread Takashi Yano
pipes.") Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc index db3b77ecf..607333f52 100644 --- a/winsup/cygwin/fhandler/pty.cc +++ b/winsup/cygwin/fhand

[PATCH] Cygwin: pty: Fix thread safety of readahead buffer handling in pty master.

2023-08-04 Thread Takashi Yano
. Fixes: 7b03b0d8cee0 ("select.cc (peek_pipe): Call flush_to_slave whenever we're checking for a pty master.") Reported-by: Thomas Wolff Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 10 +- winsup/cygwin/local_includes/fhandler.h | 8 2 files c

Re: [PATCH 2/2] Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty.

2023-07-07 Thread Takashi Yano
On Fri, 7 Jul 2023 12:10:54 +0200 Corinna Vinschen wrote: > On Jul 7 12:34, Takashi Yano wrote: > > 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 c

Re: [PATCH 1/2] Cygwin: stat(): Fix "Bad address" error on stat() for /dev/tty.

2023-07-07 Thread Takashi Yano
Hi Corinna, On Fri, 7 Jul 2023 11:46:15 +0200 Corinna Vinschen wrote: > On Jul 7 12:34, Takashi Yano wrote: > > diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc > > index 18e0f3097..2aae2fd65 100644 > > --- a/winsup/cygwin/dtable.cc > > +++ b/winsup/cyg

[PATCH 2/2] Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty.

2023-07-06 Thread Takashi Yano
in fhandler_termios. 2) Add new argument, which has dev_t value refered by open(), for constructors of fhandler_pty_slave and fhandler_pty_master to set the value of dev_refered_via. 3) Set st_rdev using dev_refered_via in fhandler_termios::fstat() if it is available. Signed-off-by: Takashi Yano

[PATCH 1/2] Cygwin: stat(): Fix "Bad address" error on stat() for /dev/tty.

2023-07-06 Thread Takashi Yano
n: console: Make the console accessible from other terminals."). Fixes: 23771fa1f7028 ("dtable.cc (fh_alloc): Make different decisions when generating fhandler for not-opened devices. Add kludge to deal with opening /dev/tty.") Reported-by: Bruce Jerrick Signed-off-by: Takashi Yano

[PATCH 0/2] Fix issues of stat()/fstat() for /dev/tty.

2023-07-06 Thread Takashi Yano
Takashi Yano (2): Cygwin: stat(): Fix "Bad address" error on stat() for /dev/tty. Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty. winsup/cygwin/dtable.cc | 13 ++--- winsup/cygwin/fhandler/console.cc | 12 +++- winsup/cygwi

Re: [PATCH] Cygwin: dtable: Delete old kludge code for /dev/tty.

2023-07-06 Thread Takashi Yano
On Tue, 4 Jul 2023 17:59:41 +0200 (CEST) Johannes Schindelin wrote: > Hi Takashi, > > On Tue, 4 Jul 2023, Takashi Yano wrote: > > > On Mon, 3 Jul 2023 12:52:25 +0200 > > Corinna Vinschen wrote: > > > > > > On Jun 27 22:28, Takashi Yano wrote: > >

Re: [PATCH v2] Cygwin: dtable: Delete old kludge code for /dev/tty.

2023-07-06 Thread Takashi Yano
Hi Corinna, On Tue, 4 Jul 2023 16:36:26 +0200 Corinna Vinschen wrote: > On Jul 4 19:03, Takashi Yano wrote: > > This old kludge code assigns fhandler_console for /dev/tty even > > if the CTTY is not a console when stat() has been called. Due to > > this, the problem

[PATCH v2] Cygwin: dtable: Delete old kludge code for /dev/tty.

2023-07-04 Thread Takashi Yano
ed-by: Bruce Jerrick Reviewed-by: Corinna Vinschen Signed-off-by: Takashi Yano --- winsup/cygwin/dtable.cc | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 18e0f3097..9427e238e 100644 --- a/winsup/cygwin/dtable.cc

Re: [PATCH] Cygwin: dtable: Delete old kludge code for /dev/tty.

2023-07-04 Thread Takashi Yano
Hi Corinna, Thanks for reviewing the patch. On Mon, 3 Jul 2023 12:52:25 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Jun 27 22:28, Takashi Yano wrote: > > This old kludge code assigns fhandler_console for /dev/tty even > > if the CTTY is not a console when stat()

[PATCH] Cygwin: dtable: Delete old kludge code for /dev/tty.

2023-06-27 Thread Takashi Yano
nsole accessible from other terminals."). This patch fixes the issue by dropping the old kludge code. Reported-by: Bruce Jerrick Signed-off-by: Takashi Yano --- winsup/cygwin/dtable.cc | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin

[PATCH] Cygwin: thread: Reset _my_tls.tid if it's pthread_null in init_mainthread().

2023-06-22 Thread Takashi Yano
cygwin1.dll. https://cygwin.com/pipermail/cygwin/2023-June/253792.html With this patch, _my_tls.tid is re-initialized in pthread:: init_mainthread() if it is pthread_null. Reported-by: Mümin A. Reviewed-by: Corinna Vinschen Signed-off-by: Takashi Yano --- winsup/cygwin/thread.cc | 2 +- 1 file

[PATCH] Cygwin: pty: Additional fix for transferring input at exit.

2023-06-01 Thread Takashi Yano
: pty: Fix transferring type-ahead input between input pipes.") Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc index 207f37463..1f2b63

[PATCH] Cygwin: pty: Fix transferring type-ahead input between input pipes.

2023-06-01 Thread Takashi Yano
app. This patch fixes the issue. Fixes: e5fcc5837c95 ("Cygwin: pty: Fix reading CONIN$ when stdin is not a pty.") Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/winsup/cygwin/fhandle

[PATCH] Cygwin: pty: Fix reading CONIN$ when stdin is not a pty.

2023-04-13 Thread Takashi Yano
is the pty or not to allow that case. https://cygwin.com/pipermail/cygwin/2023-April/253424.html Reported-by: Wladislav Artsimovich Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/pty.cc | 6 ++ winsup/cygwin/release/3.4.7 | 3 +++ 2 files changed, 9 insertions(+) diff --git

Re: [EXTERNAL] [PATCH] Cygwin: ctty: Replace ctty constant with more descriptive macros.

2023-03-06 Thread Takashi Yano
< 0) > + if (!CTTY_IS_VALID (p->ctty)) > > And here as well: > > { >if (str == NULL) > str = _my_tls.locals.ttybuf; > - if (myself->ctty < 0) > + if (!CTTY_IS_VALID (myself->ctty)) Thanks. You are right, however, ctty value 0 is never used, so no problem I think. -- Takashi Yano

[PATCH] Cygwin: ctty: Remove old 'kludge' code.

2023-03-06 Thread Takashi Yano
that case is detected. Fixes: c38a2d837303 Signed-off-by: Takashi Yano --- winsup/cygwin/dtable.cc | 7 --- winsup/cygwin/syscalls.cc | 11 --- 2 files changed, 18 deletions(-) diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 6b2394814..0ed3ea85d 100644 --- a/winsup

[PATCH] Cygwin: ctty: Replace ctty constant with more descriptive macros.

2023-03-06 Thread Takashi Yano
-off-by: Takashi Yano --- winsup/cygwin/dtable.cc | 8 winsup/cygwin/exceptions.cc | 2 +- winsup/cygwin/external.cc | 4 ++-- winsup/cygwin/fhandler/console.cc | 10 ++ winsup/cygwin/fhandler/process.cc | 4 ++-- winsup

[PATCH] Cygwin: console: Suppress unnecessary open_shared_console() calls.

2023-03-06 Thread Takashi Yano
Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/console.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc index 4a4cf1897..d4b09dc79 100644 --- a/winsup/cygwin/fhandler/console.cc +++ b/winsup

[PATCH] Cygwin: ctty: Add missing fixup_after_{exec,fork}() call.

2023-03-06 Thread Takashi Yano
Previously, fixup_after_{exec,fork}() calls for CTTY were missing. This patch fixes that. Signed-off-by: Takashi Yano --- winsup/cygwin/dtable.cc | 5 + winsup/cygwin/fhandler/console.cc | 7 +++ 2 files changed, 12 insertions(+) diff --git a/winsup/cygwin/dtable.cc b/winsup

[PATCH] Cygwin: dsp: Fix SNDCTL_DSP_{POST,SYNC} ioctl() behaviour.

2023-02-25 Thread Takashi Yano
Previously, SNDCTL_DSP_POST and SNDCTL_DSP_SYNC were implemented wrongly. Due to this issue, module-oss of pulseaudio generates choppy sound when SNDCTL_DSP_POST is called. This patch fixes that. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 15 +++ 1 file changed

[PATCH] Cygwin: dsp: Fix SNDCTL_DSP_GET[IO]SPACE before read()/write().

2023-02-14 Thread Takashi Yano
Even with the commit 3a4c740f59c0, SNDCTL_DSP_GET[IO]SPACE ioctl() does not return the fragment set by SNDCTL_DSP_SETFRAGMENT if it is issued before read()/write(). This patch fixes the issue. Fixes: 3a4c740f59c0 ("Cygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().") Signed-off-b

Re: [PATCH] Cygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().

2023-01-31 Thread Takashi Yano
On Tue, 31 Jan 2023 10:28:40 +0100 Corinna Vinschen wrote: > On Jan 30 22:09, Takashi Yano wrote: > > Previously, SNDCTL_DSP_SETFRAGMENT was just a fake. In this patch, > > it has been implemented to allow latency control in some apps. > > > > Reviewed-by: Corin

Re: [PATCH] Cygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().

2023-01-31 Thread Takashi Yano
On Tue, 31 Jan 2023 10:28:40 +0100 Corinna Vinschen wrote: > LGTM. Given how much I *don't* use the audio stuff in Cygwin, > would you just like to take over maintainership for this code? Thanks. I could take care of it if you don't mind? -- Takashi Yano

[PATCH] Cygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().

2023-01-30 Thread Takashi Yano
Previously, SNDCTL_DSP_SETFRAGMENT was just a fake. In this patch, it has been implemented to allow latency control in some apps. Reviewed-by: Corinna Vinschen Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 78 - winsup/cygwin/local_includes

[PATCH] Cygwin: dsp: Fix hang on close() if another thread calls write().

2023-01-25 Thread Takashi Yano
fhandler_dev_dsp (OSS) has a problem that waitforallsent(), which is called from close(), falls into infinite loop if another thread calls write() accidentally after close(). This patch fixes the issue. Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 9

[PATCH v2] Cygwin: fsync: Fix EINVAL for block device.

2023-01-21 Thread Takashi Yano
Reviewed-by: Corinna Vinschen Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/base.cc | 3 ++- winsup/cygwin/release/3.4.6| 5 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 winsup/cygwin/release/3.4.6 diff --git a/winsup/cygwin/fhandler/base.cc b/win

Re: [PATCH] Cygwin: fsync: Fix EINVAL for block device.

2023-01-21 Thread Takashi Yano
On Sat, 21 Jan 2023 15:53:37 +0100 Corinna Vinschen wrote: > Hi Takashi, > > On Jan 21 21:44, Takashi Yano wrote: > > The commit af8a7c13b516 has a problem that fsync returns EINVAL for > > block device. This patch treats block devices as a special case. > > https://

[PATCH] Cygwin: fsync: Fix EINVAL for block device.

2023-01-21 Thread Takashi Yano
The commit af8a7c13b516 has a problem that fsync returns EINVAL for block device. This patch treats block devices as a special case. https://cygwin.com/pipermail/cygwin/2023-January/252916.html Fixes: af8a7c13b516 ("Cygwin: fsync: Return EINVAL for special files.") Signed-off-by: Ta

Re: [PATCH] Cygwin: dsp: Fix a problem that fcntl() does not take effect.

2023-01-19 Thread Takashi Yano
On Thu, 19 Jan 2023 22:10:05 +0900 Takashi Yano wrote: > Previously, fhandler_dev_dsp (OSS) has a problem that fcntl() does > not take effect at all. This patch fixes the issue. > > Sighed-off-by: Takashi Yano Sorry, s/Sighed/Signed/g -- Takashi Yano

[PATCH] Cygwin: dsp: Fix a problem that fcntl() does not take effect.

2023-01-19 Thread Takashi Yano
Previously, fhandler_dev_dsp (OSS) has a problem that fcntl() does not take effect at all. This patch fixes the issue. Sighed-off-by: Takashi Yano --- winsup/cygwin/fhandler/dsp.cc | 12 winsup/cygwin/local_includes/fhandler.h | 2 ++ 2 files changed, 14 insertions

Re: [PATCH] Cygwin: pinfo: Additional fix for CTTY behavior.

2023-01-10 Thread Takashi Yano
with a change in behavior that implements linux functionality: opening a tty should not automatically cause it to become the controlling tty for the process. */ if (newfd > 2) flags |= O_NOCTTY; ? These codes might be able to be deleted. I'll check if these are not needed. -- Takashi Yano

Re: [PATCH] Cygwin: pinfo: Additional fix for CTTY behavior.

2023-01-10 Thread Takashi Yano
On Mon, 9 Jan 2023 10:25:33 +0100 Corinna Vinschen wrote: > On Dec 28 17:35, Takashi Yano wrote: > > The commit 25c4ad6ea52f did not fix the CTTY behavior enough. For > > example, in the following test case, TTY will be associated as > > a CTTY on the second open() cal

Re: newlib-cygwin master shortlog missing cygwin release tags

2023-01-02 Thread Takashi Yano
getting? Recently, some branches other than master are used for the releases. -++-> master (cygwin-3.5.0-dev) \\ \\---> cygwin-3_4-branch \ \] cygwin-3_3-branch (cygwin-3_3_6-release etc.) You can access them by e.g.: git log origin/cygwin-3_4-branch git log origin/cygwin-3_3-branch -- Takashi Yano

[PATCH] Cygwin: pinfo: Additional fix for CTTY behavior.

2022-12-28 Thread Takashi Yano
Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/termios.cc | 1 - winsup/cygwin/pinfo.cc| 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler/termios.cc b/winsup/cygwin/fhandler/termios.cc index f94e20ff6..5b92cdd31 100644 --- a/win

Re: [PATCH] Cygwin: console: Make the console accessible from other terminals.

2022-12-22 Thread Takashi Yano
On Thu, 22 Dec 2022 13:50:59 +0100 Corinna Vinschen wrote: > On Dec 22 18:06, Takashi Yano wrote: > > On Wed, 21 Dec 2022 13:56:25 +0100 > > Corinna Vinschen wrote: > > > However, there's something broken with these patches in terms of > > > debugging: > &

[PATCH v3] Cygwin: console: Make the console accessible from other terminals.

2022-12-22 Thread Takashi Yano
in console. Reviewed-by: Corinna Vinschen Signed-off-by: Takashi Yano --- winsup/cygwin/devices.cc| 24 +- winsup/cygwin/devices.in| 24 +- winsup/cygwin/fhandler/console.cc | 474 ++-- winsup/cygwin/fhandler/pty.cc | 4

Re: [PATCH] Cygwin: console: Make the console accessible from other terminals.

2022-12-22 Thread Takashi Yano
On Thu, 22 Dec 2022 18:06:03 +0900 Takashi Yano wrote: > On Wed, 21 Dec 2022 13:56:25 +0100 > Corinna Vinschen wrote: > > However, there's something broken with these patches in terms of > > debugging: > > > > With current origin/master: > > > > $ ls

[PATCH] Cygwin: console: Fix hangup of less on quit after the window is resized.

2022-12-22 Thread Takashi Yano
the mutex, cygwin loses the chance to release mutex. With this patch, the mutex is released just before calling kill_pgrp() and re-acquired when kill_pgrp() returns. Reported-by: Gregory Mason Signed-off-by: Takashi Yano --- winsup/cygwin/fhandler/console.cc | 4 winsup/cygwin/release/3.4.4

  1   2   3   4   5   6   7   8   9   >