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 place

New FAQ entry about permissions since Cygwin 1.7.34

2015-10-06 Thread Ken Brown
@@ -1,3 +1,7 @@ +2015-10-06 Ken Brown <kbr...@cornell.edu> + + * faq-using.xml (faq.using.same-with-permissions): New entry. + 2015-09-07 Brian Inglis <brian.ing...@systematicsw.ab.ca> * faq-using.xml (faq.using.man): Replace makewhatis with mandb. diff --git a/wi

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 <kbr...@cornell.edu> Date: Fri, 11 Dec 2015 17:08:28 -0500 Subject: [PATCH] Fix regparm att

Fix 'make distclean'

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

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) { const char

Re: Declaration of crypt

2016-06-09 Thread Ken Brown
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 Mon Sep 17 00:00:00 2001 From: Ken Brown <

Declaration of crypt

2016-06-08 Thread Ken Brown
-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: Ken Brown <kbr...@cornell.

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 <kbr...@cornell.edu> Date: Tue, 23 Aug 2016 13:24:49 -0400 Subject: [PATCH] Clarify Cygwin's s

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 <k

Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE

2017-08-06 Thread Ken Brown
45060307b1e8e06a522cd95e9567155e98dda832 Mon Sep 17 00:00:00 2001 From: Ken Brown <kbr...@cornell.edu> 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(-)

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

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 fail with EEXIST

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 any

Re: renameat2

2017-08-18 Thread Ken Brown
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 <kbr...@cornell.edu> Date: Thu, 17 Aug 2017 09:12:15 -0400 Subject: [PATCH] cygwin: Implement renameat2

renameat2

2017-08-18 Thread Ken Brown
e3f Mon Sep 17 00:00:00 2001 From: Ken Brown <kbr...@cornell.edu> 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/libc/include/stdio.h| 3 +++ wins

[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 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 ---

[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 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 ---

[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 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 *

[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 ---

[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 @@

[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 ---

[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 ---

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 > @@

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 <kbr...@cornell.edu> Date: Sat, 19 Aug 2017 13:15:04 -0400 Subject: [PATCH] Document renameat2 --- winsup/

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

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

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 oversight

[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

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

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 Subject: [PATCH

[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

[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

[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 ---

[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

[PATCH 0/5] Implement clearenv

2018-06-04 Thread Ken Brown
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 environment pointer

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

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 Sep 17 00

[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

[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
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): Cygwin: Clarify some code in environ.cc

[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,

[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 +++

[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

[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

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 Linu

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's

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

[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

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 +

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 FIFOs a

[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

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

2019-03-25 Thread Ken Brown
: $ 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/fhand

[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

[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

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 ha

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

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

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

[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

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 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 ---

[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

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

2019-03-22 Thread Ken Brown
le 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 spinlock Cygwin: FIFO: improve EOF

[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

[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

[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

[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 ---

[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

[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

[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

[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

[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

[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 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

[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

[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

[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

[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

[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

[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

[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 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

[PATCH draft 5/6] Cygwin: remove the fhandler_base_overlapped class

2019-05-26 Thread Ken Brown
There are no longer any classes derived from it. Also remove the 'was_nonblocking' flag, which was needed only for fhandler_base_overlapped. --- winsup/cygwin/fhandler.cc | 383 -- winsup/cygwin/fhandler.h | 75 +--- winsup/cygwin/syscalls.cc | 1 - 3

[PATCH draft 3/6] Cygwin: fhandler_pipe: set the blocking mode of the Windows pipe

2019-05-26 Thread Ken Brown
Add methods 'set_pipe_non_blocking' and 'fcntl' to keep the blocking mode of the Windows pipe in sync with that of the fhandler_pipe object. This is used for pipes created with the 'pipe' and 'pipe2' system calls. --- winsup/cygwin/fhandler.h | 2 ++ winsup/cygwin/fhandler_pipe.cc | 34

[PATCH draft 4/6] Cygwin: fhandler_pipe: fix permission problem

2019-05-26 Thread Ken Brown
The read handles of pipes created by CreateNamedPipe don't have FILE_WRITE_ATTRIBUTES access unless the pipe is created with PIPE_ACCESS_DUPLEX. This causes set_pipe_non_blocking to fail on such handles. To fix this, add a helper function nt_create, which uses NtCreateNamedPipeFile instead of

[PATCH draft 2/6] Cygwin: fhandler_pipe: add raw_read and raw_write

2019-05-26 Thread Ken Brown
--- winsup/cygwin/fhandler.h | 2 + winsup/cygwin/fhandler_pipe.cc | 164 + 2 files changed, 166 insertions(+) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index bdfe4a272..b9cc7b471 100644 --- a/winsup/cygwin/fhandler.h +++

[PATCH draft 1/6] Cygwin: fhandler_pipe: derive from fhandler_base

2019-05-26 Thread Ken Brown
Make minimal changes so that the build still succeeds. Previously fhandler_pipe was derived from fhandler_base_overlapped, which we are going to remove in a future commit. --- winsup/cygwin/fhandler.h | 5 ++--- winsup/cygwin/fhandler_pipe.cc | 11 +-- 2 files changed, 7

[PATCH draft 0/6] Remove the fhandler_base_overlapped class

2019-05-26 Thread Ken Brown
all the sample pipe programs in Kerrisk's book "The Linux Programming Interface: Linux and UNIX System Programming Handbook". I've also run emacs-X11, gdb, git, make, etc., so far without problems. Ken Brown (6): Cygwin: fhandler_pipe: derive from fhandler_base Cygwin: fhandler

[PATCH draft 6/6] Cygwin: add fhandler_base::npfs_handle

2019-05-26 Thread Ken Brown
This gets a handle to the Windows named pipe file system directory. It replaces the three identical functions of the same name in the classes fhandler_pipe, fhandler_fifo, and fhandler_socket_unix. --- winsup/cygwin/fhandler.cc | 30 + winsup/cygwin/fhandler.h

  1   2   3   >