New FAQ entry about permissions since Cygwin 1.7.34

2015-10-06 Thread Ken Brown
geLog @@ -1,3 +1,7 @@ +2015-10-06 Ken Brown + + * faq-using.xml (faq.using.same-with-permissions): New entry. + 2015-09-07 Brian Inglis * faq-using.xml (faq.using.man): Replace makewhatis with mandb. diff --git a/winsup/doc/faq-using.xml b/winsup/doc/faq-using.xml index 76

Re: New FAQ entry about permissions since Cygwin 1.7.34

2015-10-20 Thread Ken Brown
On 10/20/2015 3:25 PM, Corinna Vinschen wrote: Hi Ken, On Oct 6 16:41, Ken Brown wrote: There have been several recent threads on the cygwin list stemming from the permissions change in 1.7.34. I've pointed people to the FAQ about ssh public key authentication, which is not the first

Trivial fix to last change

2015-12-11 Thread Ken Brown
cygwin1.dll doesn't build on x86 after the last commit (eed35ef). The trivial patch attached fixes it. Ken From 1cd61c54994b2ba6c6ec1d1f8f1249f5f8fd4af3 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Fri, 11 Dec 2015 17:08:28 -0500 Subject: [PATCH] Fix regparm attribute of fhandler

Fix 'make distclean'

2016-06-05 Thread Ken Brown
o be restored before one can rebuild. The attached patch fixes both problems. Ken From 71c16ecc3126a41ae41cbf354428c64282952951 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 5 Jun 2016 12:58:22 -0400 Subject: [PATCH] Allow 'make distclean' to clean winsup/cygwin MIME-Version

Declaration of crypt

2016-06-08 Thread Ken Brown
e right feature-test macro in the patch. It's marked XSI by Posix, but using __XSI_VISIBLE didn't work. Ken P.S. Is cygwin-patches OK for this sort of thing, or should I have sent it to the newlib list? From 91ed7816e771a78170555db246e0e35dc6d2ca3e Mon Sep 17 00:00:00 2001 From: Ke

Re: Declaration of crypt

2016-06-09 Thread Ken Brown
On 6/9/2016 5:00 AM, Corinna Vinschen wrote: Hi Ken, On Jun 8 17:18, Ken Brown wrote: According to Posix, including should bring in the declaration of crypt. The glibc and FreeBSD headers are consistent with this, but Cygwin's aren't. $ cat test.c #include int main (void) {

Re: Declaration of crypt

2016-06-09 Thread Ken Brown
t, but Cygwin's crypt.h simply has 'char *block'. FreeBSD and glibc also use 'char *block', so I did the same. Or would you rather follow Posix here? Thanks a lot and sorry again, No problem. Revised patch attached. Ken From e6ab8bbf44d1042df3dd9e989967a649523d193d

Documentation patch: Clarify Cygwin's support for Win32 paths

2016-08-23 Thread Ken Brown
The attached patch is the one promised in https://www.cygwin.com/ml/cygwin/2016-08/msg00431.html Ken From e46d88d4141737f7f75ec1fb60b6e404f598a965 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Tue, 23 Aug 2016 13:24:49 -0400 Subject: [PATCH] Clarify Cygwin's support for Win32 paths

Add _PC_CASE_INSENSITIVE flag to pathconf

2016-10-20 Thread Ken Brown
0 This test was done, obviously, on a system with the obcaseinsensitive registry key set to 0, and with /tmp/a non-existent. I also tested with the registry key set to 1, with the expected results. Ken From 04b507edbfbbaade6ef19ba9302ac9a758886995 Mon Sep 17 00:00:00 2001 From: Ken Brown Dat

Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE

2017-08-06 Thread Ken Brown
From 45060307b1e8e06a522cd95e9567155e98dda832 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sun, 6 Aug 2017 17:40:43 -0400 Subject: [PATCH] Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE --- newlib/libc/include/machine/setjmp.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/newlib

Re: Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE

2017-08-06 Thread Ken Brown
On 8/6/2017 5:46 PM, Ken Brown wrote: The attached patch fixes the issue reported here: https://cygwin.com/ml/cygwin/2017-08/msg00060.html I'm not sure if I was correct in including RTEMS or if this should have been Cygwin only. If the former, I probably should have sent this to

renameat2

2017-08-18 Thread Ken Brown
file or directory bar Ken From 23edb25c9c0b6a21aefb10372db945807b2b8e3f Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Thu, 17 Aug 2017 09:12:15 -0400 Subject: [PATCH] cygwin: Implement renameat2 Define the RENAME_* flags in as defined on Linux in , but support only RENAME_NOREPLACE. --- newlib

Re: renameat2

2017-08-18 Thread Ken Brown
x27;t see how we can ever do RENAME_WHITEOUT). Thanks for the feedback. Revised patch attached. From 136b0dfd53e147002e134048658d20f452402c9f Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Thu, 17 Aug 2017 09:12:15 -0400 Subject: [PATCH] cygwin: Implement renameat2 Define the RENAME_NOREPLACE

Re: renameat2

2017-08-18 Thread Ken Brown
Hi Corinna, On 8/18/2017 11:15 AM, Corinna Vinschen wrote: Hi Ken, On Aug 18 09:21, Ken Brown wrote: Linux has a system call 'renameat2' which is like renameat but has an extra 'flags' argument. In particular, one can pass the RENAME_NOREPLACE flag to cause the rename to

Re: renameat2

2017-08-19 Thread Ken Brown
Hi Corinna, On 8/19/2017 5:57 AM, Corinna Vinschen wrote: Hi Ken, On Aug 18 18:24, Ken Brown wrote: Thanks for the improvements! A revised patch is attached. As you'll see, I still found a few places where I thought I needed to explicitly set the errno to EEXIST. Let me know if a

Re: renameat2

2017-08-19 Thread Ken Brown
On 8/19/2017 12:37 PM, Corinna Vinschen wrote: > Oh, one more thing. This is a question to Yaakov, too. > > diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h > index 5d8cb1092..331a1cf07 100644 > --- a/newlib/libc/include/stdio.h > +++ b/newlib/libc/include/stdio.h > @@ -384,

Re: renameat2

2017-08-19 Thread Ken Brown
On 8/19/2017 12:28 PM, Corinna Vinschen wrote: Doc changes coming? :) Attached. Ken From 0704541f1d29e0d9aa0af6e549f8ca0114a44a7c Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Sat, 19 Aug 2017 13:15:04 -0400 Subject: [PATCH] Document renameat2 --- winsup/cygwin/release/2.9.0 | 2

[PATCH 03/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::root

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/fhandler_process.cc | 2 +- winsup/cygwin/pinfo.cc| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 97436dd1b..08cc7ea92 100644 --- a/winsup/cygwin/fhand

[PATCH 11/12] cygwin: Remove comparison of 'this' to NULL in _pinfo::exists

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/fhandler_termios.cc | 2 +- winsup/cygwin/pinfo.cc| 2 +- winsup/cygwin/signal.cc | 2 +- winsup/cygwin/sigproc.cc | 5 +++-- winsup/cygwin/times.cc| 10 +++--- 5 files changed, 13 insertions(+), 8 deletions(-)

[PATCH 02/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fds

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/fhandler_process.cc | 2 +- winsup/cygwin/pinfo.cc| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index bbb44fa56..97436dd1b 100644 --- a/winsup/cygwin/fhand

[PATCH 01/12] cygwin: Remove comparisons of 'this' to 'NULL' in fhandler_dsp.cc

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/fhandler_dsp.cc | 55 +++ 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index 5ae3309f8..b5c685bf8 100644 --- a/winsup/cygwin/fhandler_dsp.cc +

[PATCH 12/12] cygwin: Remove workaround for GCC 6 null pointer check warnings

2017-09-16 Thread Ken Brown
--- winsup/cygwin/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 98727c019..add1de0e9 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -73,7 +73,7 @@ CRT0:=$(cygwin_build)/crt0.o

[PATCH 06/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::commune_request

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/pinfo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index e792a0a1c..a068bcc42 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -720,7 +720,7 @@ _pinfo::commune_request (_

[PATCH 07/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::pipe_fhandler

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/pinfo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index a068bcc42..72aa658eb 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -819,7 +819,7 @@ out: fhandler_pipe * _pi

[PATCH 08/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/fhandler_process.cc | 2 +- winsup/cygwin/pinfo.cc| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 7f122fbe4..360d8ea81 100644 --- a/winsup/cygwin/fhand

[PATCH 10/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::kill

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/signal.cc | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index fbd2b241e..016fce1de 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -260,7 +260,7 @@ _pin

[PATCH 04/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cwd

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/fhandler_process.cc | 2 +- winsup/cygwin/pinfo.cc| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 08cc7ea92..453e79b16 100644 --- a/winsup/cygwin/fhand

[PATCH 09/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::environ

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/fhandler_process.cc | 2 +- winsup/cygwin/pinfo.cc| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 360d8ea81..eb5a523ff 100644 --- a/winsup/cygwin/fhand

[PATCH 05/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cmdline

2017-09-16 Thread Ken Brown
Fix all callers. --- winsup/cygwin/external.cc | 2 +- winsup/cygwin/fhandler_process.cc | 2 +- winsup/cygwin/pinfo.cc| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index c81bdc0fa..6aae32aea 100644

[PATCH] cygcheck: Fix parsing of file names containing colons

2017-10-25 Thread Ken Brown
Up to now the function winsup/utils/dump_setup.cc:base skips past colons when parsing file names. As a result, a line like foo foo-1:2.3-4.tar.bz2 1 in /etc/setup/installed.db would cause 'cygcheck -cd foo' to report 4 as the installed version of foo insted of 1:2.3-4. This is not an issue no

Re: [PATCH] cygcheck: Fix parsing of file names containing colons

2017-10-25 Thread Ken Brown
On 10/25/2017 8:19 AM, Corinna Vinschen wrote: On Oct 25 14:11, Corinna Vinschen wrote: Hi Ken, On Oct 25 07:23, Ken Brown wrote: Up to now the function winsup/utils/dump_setup.cc:base skips past colons when parsing file names. As a result, a line like foo foo-1:2.3-4.tar.bz2 1 in /etc

Re: [PATCH] cygcheck: Fix parsing of file names containing colons

2017-10-25 Thread Ken Brown
On 10/25/2017 10:19 AM, Corinna Vinschen wrote: On Oct 25 09:38, Ken Brown wrote: On 10/25/2017 8:19 AM, Corinna Vinschen wrote: On Oct 25 14:11, Corinna Vinschen wrote: Hi Ken, On Oct 25 07:23, Ken Brown wrote: Up to now the function winsup/utils/dump_setup.cc:base skips past colons when

Re: [PATCH] Add FAQ 4.46 How do I fix find_fast_cwd warnings?

2017-11-12 Thread Ken Brown
On 11/12/2017 1:39 PM, Brian Inglis wrote: Having responded to some of these posts and being prompted by the suggestion in a reply to one by "Cyg simple", I attach an offering, in the off chance that anyone affected might actually check the FAQ or find it in a search. ;^> Even if they don't fin

Re: [PATCH] Add FAQ 4.46. How do I fix find_fast_cwd warnings?

2017-11-12 Thread Ken Brown
On 11/12/2017 4:27 PM, Brian Inglis wrote: +Some ancient Cygwin releases asked users to report problems that were + difficult to diagnose to the mailing list with the message: + +find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report +this problem to the public

Re: [PATCH setup v4 6/6] Display area and location of official mirrors

2017-12-10 Thread Ken Brown
On 12/10/2017 1:40 PM, Brian Inglis wrote: On 2017-12-10 10:49, Ken Brown wrote: Mirrors from mirrors.lst have area and location info, which we now display and add to the sort key. You didn't increase the list box width - are the hosts visible without scrolling? No, that was an over

Fix declaration of pthread_rwlock_* functions

2018-05-30 Thread Ken Brown
The attached patch fixes the second problem reported in https://cygwin.com/ml/cygwin/2018-05/msg00316.html, though I'm not sure it's the right fix. Ken From 4940baac08cd9339d771d9db90a880c61610ae4c Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Wed, 30 May 2018 16:19:01 -0400 Subje

Re: Fix declaration of pthread_rwlock_* functions

2018-06-01 Thread Ken Brown
On 6/1/2018 6:10 AM, Corinna Vinschen wrote: On May 30 16:28, Ken Brown wrote: The attached patch fixes the second problem reported in https://cygwin.com/ml/cygwin/2018-05/msg00316.html, though I'm not sure it's the right fix. Ken From 4940baac08cd9339d771d9db90a880c61610ae4c Mon

[PATCH 0/5] Implement clearenv

2018-06-04 Thread Ken Brown
tension, so __GNU_VISIBLE would seem to be the right guard. On the other hand, glibc declares clearenv() if _DEFAULT_SOURCE is defined, so maybe the guard should be relaxed if our goal is to emulate Linux. Yaakov? Ken Brown (5): Cygwin: Clarify some code in environ.cc Cygwin: Allow the

[PATCH 5/5] Cygwin: Document clearenv

2018-06-04 Thread Ken Brown
--- winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/release/2.10.1 | 1 + winsup/doc/posix.xml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index f0870

[PATCH 3/5] Cygwin: Implement the GNU extension clearenv

2018-06-04 Thread Ken Brown
--- winsup/cygwin/common.din | 1 + winsup/cygwin/environ.cc | 20 winsup/cygwin/include/cygwin/stdlib.h | 1 + 3 files changed, 22 insertions(+) diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din index 6e8bf9185..426cf172c 100644 ---

[PATCH 4/5] Cygwin: Remove workaround in environ.cc

2018-06-04 Thread Ken Brown
Commit ebd645e on 2001-10-03 made environ.cc:_addenv() add unneeded space at the end of the environment block to "work around problems with some buggy applications." This clutters the code and is presumably no longer needed. --- winsup/cygwin/environ.cc | 10 -- 1 file changed, 4 insertio

[PATCH 2/5] Cygwin: Allow the environment pointer to be NULL

2018-06-04 Thread Ken Brown
Following glibc, interpret this as meaning the environment is empty. --- winsup/cygwin/environ.cc | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index b452d21a5..8e6bbe561 100644 --- a/winsup/c

[PATCH 1/5] Cygwin: Clarify some code in environ.cc

2018-06-04 Thread Ken Brown
--- winsup/cygwin/environ.cc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 43225341c..b452d21a5 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -545,6 +545,7 @@ _getenv_r (struct _reent *

Re: [PATCH 2/5] Cygwin: Allow the environment pointer to be NULL

2018-06-04 Thread Ken Brown
On 6/4/2018 3:36 PM, Ken Brown wrote: Following glibc, interpret this as meaning the environment is empty. Sorry, please hold off on reviewing this patch. I just noticed that I missed at least one place (build_env()) where environ==NULL could cause a crash. I need to fix this and try to

[PATCH v2 4/6] Cygwin: Remove workaround in environ.cc

2018-06-06 Thread Ken Brown
Commit ebd645e on 2001-10-03 made environ.cc:_addenv() add unneeded space at the end of the environment block to "work around problems with some buggy applications." This clutters the code and is presumably no longer needed. --- winsup/cygwin/environ.cc | 10 -- 1 file changed, 4 insertio

[PATCH v2 6/6] Bump Cygwin DLL version to 2.11.0

2018-06-06 Thread Ken Brown
--- winsup/cygwin/include/cygwin/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 2991ab858..958acca3a 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/inc

[PATCH v2 2/6] Cygwin: Allow the environment pointer to be NULL

2018-06-06 Thread Ken Brown
Following glibc, interpret this as meaning the environment is empty. --- winsup/cygwin/environ.cc | 40 ++-- winsup/cygwin/pinfo.cc | 7 --- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.

[PATCH v2 3/6] Cygwin: Implement the GNU extension clearenv

2018-06-06 Thread Ken Brown
--- winsup/cygwin/common.din | 1 + winsup/cygwin/environ.cc | 20 winsup/cygwin/include/cygwin/stdlib.h | 3 +++ 3 files changed, 24 insertions(+) diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din index 6e8bf9185..426cf172c 100644 -

[PATCH v2 0/6] Implement clearenv

2018-06-06 Thread Ken Brown
the cases in which environ==NULL could be a problem. I did this by grepping the sources for 'cur_environ' and '__cygwin_environ', but it's still possible that I missed something. I've also incorporated the changes suggested by Corinna and Yaakov. Ken Brown (6):

[PATCH v2 1/6] Cygwin: Clarify some code in environ.cc

2018-06-06 Thread Ken Brown
--- winsup/cygwin/environ.cc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 43225341c..b452d21a5 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -545,6 +545,7 @@ _getenv_r (struct _reent *

[PATCH v2 5/6] Cygwin: Document clearenv and bump API minor

2018-06-06 Thread Ken Brown
Also add earlier "What changed" items to new-features.xml. --- winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/release/{2.10.1 => 2.11.0} | 1 + winsup/doc/new-features.xml | 20 winsup/doc/posix.xml | 1 + 4 files changed, 2

Re: getfacl output

2018-07-23 Thread Ken Brown
[Redirecting to cygwin-patches.] On 7/23/2018 11:06 AM, Corinna Vinschen wrote: On Jul 23 10:43, Ken Brown wrote: This is obviously very minor, but I bumped into it because of a failing emacs test. Cygwin's getfacl prints only one colon after "mask" and "other", but

Re: getfacl output

2018-07-23 Thread Ken Brown
On 7/23/2018 11:37 AM, Corinna Vinschen wrote: On Jul 23 11:15, Ken Brown wrote: [Redirecting to cygwin-patches.] On 7/23/2018 11:06 AM, Corinna Vinschen wrote: On Jul 23 10:43, Ken Brown wrote: This is obviously very minor, but I bumped into it because of a failing emacs test. Cygwin&#

Re: getfacl output

2018-07-24 Thread Ken Brown
On 7/23/2018 12:06 PM, Ken Brown wrote: On 7/23/2018 11:37 AM, Corinna Vinschen wrote: On Jul 23 11:15, Ken Brown wrote: [Redirecting to cygwin-patches.] On 7/23/2018 11:06 AM, Corinna Vinschen wrote: On Jul 23 10:43, Ken Brown wrote: This is obviously very minor, but I bumped into it

[PATCH] setfacl: Rename the option --file to --set-file, as on Linux

2018-08-16 Thread Ken Brown
Retain --file as an undocumented option for backwards compatibility. --- winsup/cygwin/release/2.11.0 | 2 ++ winsup/doc/new-features.xml | 4 winsup/doc/utils.xml | 4 ++-- winsup/utils/setfacl.c | 5 +++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/winsup

[PATCH] Cygwin: af_unix_spinlock_t: add initializer

2019-01-10 Thread Ken Brown
Also fix a typo. --- winsup/cygwin/fhandler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index d02b9a913..7e460701c 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -832,9 +832,10 @@ class fhandle

Re: [PATCH] Cygwin: af_unix_spinlock_t: add initializer

2019-01-10 Thread Ken Brown
On 1/10/2019 1:02 PM, Corinna Vinschen wrote: > On Jan 10 17:56, Ken Brown wrote: >> Also fix a typo. >> --- >> winsup/cygwin/fhandler.h | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/winsup/cygwin/fhandler.h b/wins

Re: [PATCH] Cygwin: af_unix_spinlock_t: add initializer

2019-01-10 Thread Ken Brown
On 1/10/2019 3:16 PM, Corinna Vinschen wrote: > On Jan 10 18:36, Ken Brown wrote: >> On 1/10/2019 1:02 PM, Corinna Vinschen wrote: >>> On Jan 10 17:56, Ken Brown wrote: >>>> Also fix a typo. >>>> --- >>>>winsup/cygwin/fhandler.h | 3 +

[PATCH fifo 0/8] Allow a FIFO to have multiple writers

2019-03-22 Thread Ken Brown
ould take to allow multiple readers. I'm not very optimistic about this, but my impression is that the multiple-writer case is more important in practice. Ken Ken Brown (8): Cygwin: FIFO: stop using overlapped I/O Cygwin: FIFO: allow multiple writers Cygwin: FIFO: add a spinlo

[PATCH fifo 1/8] Cygwin: FIFO: stop using overlapped I/O

2019-03-22 Thread Ken Brown
Make fhandler_fifo a derived class of fhandler_base instead of fhandler_base_overlapped. Replace the create_pipe macro, which is based on fhandler_pipe::create, by new create_pipe and open_pipe methods. These use NT functions instead of Win32 functions. Replace fifo_name by get_pipe_name, which r

[PATCH fifo 3/8] Cygwin: FIFO: add a spinlock

2019-03-22 Thread Ken Brown
Don't let listen_client_thread and raw_read access the client list simultaneously. --- winsup/cygwin/fhandler.h | 3 +++ winsup/cygwin/fhandler_fifo.cc | 34 +- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/

[PATCH fifo 8/8] Cygwin: FIFO: update select

2019-03-22 Thread Ken Brown
Add static functions peek_fifo, thread_fifo, start_thread_fifo, and fifo_cleanup to select.cc. These are based on the corresponding pipe functions, the main difference being that peek_fifo loops through the connected clients to see if any of them have data available for reading. Add the fhandler_

[PATCH fifo 5/8] Cygwin: FIFO: update clone and dup

2019-03-22 Thread Ken Brown
Deal with all clients. --- winsup/cygwin/fhandler.h | 8 +--- winsup/cygwin/fhandler_fifo.cc | 25 + 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index af5f500bf..0ebc44e0d 100644 --- a/winsup

[PATCH fifo 6/8] Cygwin: FIFO: update fixup_after_fork

2019-03-22 Thread Ken Brown
Fixup each client. Reset listen_client_thr and lct_termination_evt. --- winsup/cygwin/fhandler_fifo.cc | 9 + 1 file changed, 9 insertions(+) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index c295c2393..7a592aa0d 100644 --- a/winsup/cygwin/fhandler_fifo.c

[PATCH fifo 2/8] Cygwin: FIFO: allow multiple writers

2019-03-22 Thread Ken Brown
Introduce a 'fifo_client_handler' structure that can be used by a reader to communicate with a writer using an instance of the named pipe. An fhandler_fifo opened for reading creates a thread that does the following: - maintains a list of fifo_client_handlers - listens for_clients trying to con

[PATCH fifo 7/8] Cygwin: FIFO: update set_close_on_exec

2019-03-22 Thread Ken Brown
Deal with each client. --- winsup/cygwin/fhandler_fifo.cc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 7a592aa0d..2c20444c6 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -867,4

[PATCH fifo 4/8] Cygwin: FIFO: improve EOF detection

2019-03-22 Thread Ken Brown
Add a hit_eof method that tries to detect whether any clients are connected. Before concluding that there are none, it gives the listen_client thread time to update the client data. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_fifo.cc | 21 - 2 files chang

Re: [PATCH fifo 0/8] Allow a FIFO to have multiple writers

2019-03-23 Thread Ken Brown
On 3/23/2019 4:02 PM, Corinna Vinschen wrote: > Your patch series looks really good. For now I pushed it into the > topic/fifo branch as you suggested. Thanks. > Just be aware that it won't get much 3rd party testing this way, so as > soon as you feel more confident, let's move it into master.

[PATCH fifo 0/2] Add support for duplex FIFOs

2019-03-25 Thread Ken Brown
shell: $ mkfifo foo $ exec 7<>foo $ echo blah > foo $ read bar <&7 $ echo $bar blah Ken Ken Brown (2): Cygwin: FIFO: avoid crashes when cloning a client Cygwin: FIFO: add support for the duplex case winsup/cygwin/fhandler.h | 7 ++- winsup/cygwin/

[PATCH fifo 1/2] Cygwin: FIFO: avoid crashes when cloning a client

2019-03-25 Thread Ken Brown
fhandler_fifo::clone called fhandler_base::clone on each client fhandler. But those fhandlers are actually fhandler_fifo objects, so when fhandler_base::clone calls copyto, it's actually fhandler_fifo::copyto that gets called. This can lead to mysterious crashes. Fix this by simply calling clone

[PATCH fifo 2/2] Cygwin: FIFO: add support for the duplex case

2019-03-25 Thread Ken Brown
If a FIFO is opened with O_RDWR access, create the pipe with read/write access, and make the first client have the handle of that pipe as its I/O handle. Adjust fhandler_fifo::raw_read to account for the result of trying to read from that client if there's no data. --- winsup/cygwin/fhandler.h

Re: [PATCH fifo 0/2] Add support for duplex FIFOs

2019-03-26 Thread Ken Brown
Hi Corinna, On 3/26/2019 4:36 AM, Corinna Vinschen wrote: > Hi Ken, > > On Mar 25 23:06, Ken Brown wrote: >> The second patch in this series enables opening a FIFO with O_RDWR >> access. The underlying Windows named pipe is creted with duplex >> access, and its handl

[PATCH] Cygwin: document the recent FIFO changes

2019-03-27 Thread Ken Brown
--- winsup/cygwin/release/3.1.0 | 14 ++ winsup/doc/new-features.xml | 12 2 files changed, 26 insertions(+) create mode 100644 winsup/cygwin/release/3.1.0 diff --git a/winsup/cygwin/release/3.1.0 b/winsup/cygwin/release/3.1.0 new file mode 100644 index 0..1f017b

[PATCH] Cygwin: FIFO: implement clear_readahead

2019-03-27 Thread Ken Brown
Make fhandler_base::clear_readahead virtual, and implement fhandler_fifo::clear_readahead. This is called by dtable::fixup_after_exec; it clears the readahead in each client. --- winsup/cygwin/fhandler.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhan

Re: [PATCH fifo 0/2] Add support for duplex FIFOs

2019-03-28 Thread Ken Brown
On 3/28/2019 4:13 PM, Corinna Vinschen wrote: > On Mar 28 19:01, Achim Gratz wrote: >> Corinna Vinschen writes: >>> Done. I also pushed out new dev snapshots. >> >> No good deed goes unpunished… >> >> Whith the 20190327 snapshot our main data processing application is >> broken. It looks like it

Re: [PATCH fifo 0/2] Add support for duplex FIFOs

2019-03-29 Thread Ken Brown
On 3/29/2019 3:17 AM, Achim Gratz wrote: > Ken Brown writes: >>> I'm pretty sure Ken would be happy about an STC. >> >> Yes, please. Barring that, is there any chance I could see the relevant >> code, >> or at least enough of it so that I can see how FI

Re: [PATCH fifo 2/2] Cygwin: FIFO: add support for the duplex case

2019-03-30 Thread Ken Brown
Hi Takashi, On 3/30/2019 9:30 AM, Takashi Yano wrote: > Hi Ken, > > Do these patches enable to open FIFO multiple times with O_RDWR? > mc (midnight commander) tries to open FIFO twice with O_RDWR if > SHELL=/bin/tcsh, but fails. > https://cygwin.com/ml/cygwin/2017-03/msg00188.html No, I'm sorry.

Re: [PATCH fifo 0/2] Add support for duplex FIFOs

2019-04-03 Thread Ken Brown
On 4/3/2019 8:33 AM, Achim Gratz wrote: > Achim Gratz writes: >> OK, a bit more info: The whole thing runs from a perl script (actually a >> module) that opens pipes to gnuplot and ghostscript. This code is >> _really_ old and has seen a lot of Cygwin releases, so it has options to >> either use t

[PATCH 03/14] Cygwin: FIFO: remember the type of the fhandler

2019-04-14 Thread Ken Brown
Add data members 'reader', 'writer', and 'duplexer' to the fhandler_fifo class. Set them in fhandler_fifo::open. ('duplexer' replaces the previous '_duplexer'.) This will be useful in later commits. --- winsup/cygwin/fhandler.h | 2 +- winsup/cygwin/fhandler_fifo.cc | 14 --

[PATCH 00/14] FIFO bug fixes and code simplifications

2019-04-14 Thread Ken Brown
Ken Brown (14): Cygwin: FIFO: rename client[] to fc_handler[] Cygwin: FIFO: hit_eof: add a call to fifo_client_lock Cygwin: FIFO: remember the type of the fhandler Cygwin: FIFO: fix a thinko in listen_client_thread Cygwin: FIFO: fix the error checking in raw_read Cygwin: check for

[PATCH 04/14] Cygwin: FIFO: fix a thinko in listen_client_thread

2019-04-14 Thread Ken Brown
--- winsup/cygwin/fhandler_fifo.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 258c3cf8a..764420ffd 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -362,7 +362,10 @

[PATCH 11/14] Cygwin: FIFO: fix clone

2019-04-14 Thread Ken Brown
After copyto is called, make the new fhandler's pipe_name point to the new fhandler's pipe_name_buf, which is a *copy* of the old fhandler's pipe_name_buf. Previously, get_pipe_name would return the wrong result after a clone/dup, causing create_pipe_instance and open_pipe to fail. Also, stop the

[PATCH 13/14] Cygwin: FIFO: improve raw_write

2019-04-14 Thread Ken Brown
Don't set the write end of the pipe to non-blocking mode if the FIFO is opened in blocking mode. In fhandler_fifo::raw_write in blocking mode, wait for the write to complete rather than returning -1 with EAGAIN. If the amount to write is large, write in smaller chunks (of size determined by a new

[PATCH 07/14] Cygwin: FIFO: code simplification: don't overload get_handle

2019-04-14 Thread Ken Brown
Rename fhandler_fifo::get_handle(int) to get_fc_handle(int), and remove fhandler_fifo::get_handle(void). --- winsup/cygwin/fhandler.h | 7 --- winsup/cygwin/select.cc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h ind

[PATCH 06/14] Cygwin: check for STATUS_PENDING in fhandler_base::raw_read

2019-04-14 Thread Ken Brown
If NtReadFile returns STATUS_PENDING, wait for the read to complete. This can happen, for instance, in the case of a FIFO opened with O_RDRW. --- winsup/cygwin/fhandler.cc | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/f

[PATCH 02/14] Cygwin: FIFO: hit_eof: add a call to fifo_client_lock

2019-04-14 Thread Ken Brown
The second check of nconnected needs to be protected by a lock as well as the first. --- winsup/cygwin/fhandler_fifo.cc | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 901696444..70551e

[PATCH 10/14] Cygwin: FIFO: use a retry loop when opening a writer

2019-04-14 Thread Ken Brown
There may be short periods when there's no pipe instance available. Keep trying. --- winsup/cygwin/fhandler_fifo.cc | 52 -- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 479021e

[PATCH 01/14] Cygwin: FIFO: rename client[] to fc_handler[]

2019-04-14 Thread Ken Brown
The word "client" suggests something that holds a handle to the client side of the pipe (in Windows terminology). But our fifo_client_handlers hold a handle the server side of the pipe, and they *connect* to clients. --- winsup/cygwin/fhandler.h | 20 +++ winsup/cygwin/fhandler_fifo.cc

[PATCH 08/14] Cygwin: FIFO: fix fifo_client_handler::close

2019-04-14 Thread Ken Brown
Make sure that fhandler_base::close rather than fhandler_fifo::close is called on the fhandler. Also, delete the fhandler, since we allocated it. --- winsup/cygwin/fhandler_fifo.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygw

[PATCH 05/14] Cygwin: FIFO: fix the error checking in raw_read

2019-04-14 Thread Ken Brown
If the pipe is empty, we can get either ERROR_NO_DATA or ERROR_PIPE_LISTENING. --- winsup/cygwin/fhandler_fifo.cc | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 764420ffd..2da579b95 100644 ---

[PATCH 09/14] Cygwin: FIFO: fix the use of the read_ready event

2019-04-14 Thread Ken Brown
Make read_ready a manual reset event. It should always be set shortly after startup of the listen_client thread and remain set until the thread terminates. (We don't want writers to connect without being recorded in the client handler list.) Remove the unnecessary code that checks for read_ready

[PATCH 12/14] Cygwin: FIFO: start the listen_client thread when duping a reader

2019-04-14 Thread Ken Brown
Otherwise it doesn't get started until the dup'd fd tries to read, which delays client connections. --- winsup/cygwin/fhandler_fifo.cc | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index a

[PATCH 14/14] Cygwin: FIFO: fix and simplify listen_client_thread

2019-04-14 Thread Ken Brown
Remove fifo_client_handler::connect and move its code into listen_client_thread. That way we can check the return status when a client handler's connect_evt is signaled. Previously we incorrectly assumed there was a successful connection. Also simplify listen_client_thread in the following ways:

[PATCH v2 13/14] Cygwin: FIFO: improve raw_write

2019-04-15 Thread Ken Brown
Don't set the write end of the pipe to non-blocking mode if the FIFO is opened in blocking mode. In fhandler_fifo::raw_write in blocking mode, wait for the write to complete rather than returning -1 with EAGAIN. If the amount to write is large, write in smaller chunks (of size determined by a new

Re: [PATCH 00/14] FIFO bug fixes and code simplifications

2019-04-17 Thread Ken Brown
On 4/17/2019 1:23 PM, Achim Gratz wrote: > Corinna Vinschen writes: >> Pushed with v2 of patch 13. Developer snaps should be up shortly. > > I gave the snapshot some testing today. > > The good news is that the named FIFO branch of our code works correctly > again and is faster than going throug

[PATCH] Cygwin: FIFO: avoid hang after exec

2019-04-18 Thread Ken Brown
Define fhandler:fifo::fixup_after_exec, which sets listen_client_thr and lct_termination_evt to NULL. This forces the listen_client thread to restart on the first attempt to read after an exec. Previously the exec'd process could hang in fhandler_fifo::raw_read. --- winsup/cygwin/fhandler.h

Re: [PATCH 00/14] FIFO bug fixes and code simplifications

2019-04-18 Thread Ken Brown
On 4/17/2019 2:58 PM, Achim Gratz wrote: > Ken Brown writes: >> Thanks for testing. I have STCs for fork and exec that I used when first >> writing the code, and I forgot to retest those after the recent changes. I >> just >> tried, and the fork test succeeds but the

Re: Cygwin patches (was Re: [PATCH 00/14] FIFO bug fixes and code simplifications)

2019-04-18 Thread Ken Brown
On 4/18/2019 3:04 PM, Corinna Vinschen wrote: > Ken, you have an account on sware and check-in rights to the cygwin repo > anyway, so you don't really need me to push patches. > > If you feel up to the task, you can also go ahead and review and > ultimately push patches from others. This also app

[PATCH 3/5] Cygwin: FIFO: avoid WFMO error in listen_client_thread

2019-04-20 Thread Ken Brown
Don't set lct_termination_evt to NULL too early in fhandler_fifo::stop_listen_client. Doing so leads to an "Invalid Handle" error in WFMO. --- winsup/cygwin/fhandler_fifo.cc | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cy

[PATCH 4/5] Cygwin: FIFO: close connect_evt handles as soon as possible

2019-04-20 Thread Ken Brown
Keeping them open too long can cause an attempt to close them twice after a fork or exec. --- winsup/cygwin/fhandler_fifo.cc | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 0e4bf3aee..3ee30

  1   2   3   4   5   >