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 correct value for

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/cygwin/dtable.cc > > @@ -600,7

Re: [PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Brian Inglis
On 2023-07-07 03:44, Corinna Vinschen wrote: Hi Mark, On Jul 7 00:41, Mark Geisert wrote: The current version of cannot be compiled by Clang due to the use of __builtin* functions. Their presence here was a dubious optimization anyway, so their usage has been converted to standard library

Re: [PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Corinna Vinschen
On Jul 7 16:46, Jon Turney wrote: > On 07/07/2023 10:44, Corinna Vinschen wrote: > > Hi Mark, > > > > On Jul 7 00:41, Mark Geisert wrote: > > > The current version of cannot be compiled by Clang due to > > > the use of __builtin* functions. Their presence here was a dubious > > > optimization

Re: [PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Jon Turney
On 07/07/2023 10:44, Corinna Vinschen wrote: Hi Mark, On Jul 7 00:41, Mark Geisert wrote: The current version of cannot be compiled by Clang due to the use of __builtin* functions. Their presence here was a dubious optimization anyway, so their usage has been converted to standard library

Re: [PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Corinna Vinschen
On Jul 7 03:13, Mark Geisert wrote: > Hi Corinna, > > Corinna Vinschen wrote: > > On Jul 7 00:41, Mark Geisert wrote: > > > The current version of cannot be compiled by Clang due to > > > the use of __builtin* functions. Their presence here was a dubious > > > optimization anyway, so their

Re: [PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Mark Geisert
Hi Corinna, Corinna Vinschen wrote: On Jul 7 00:41, Mark Geisert wrote: The current version of cannot be compiled by Clang due to the use of __builtin* functions. Their presence here was a dubious optimization anyway, so their usage has been converted to standard library functions. A

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

2023-07-07 Thread Corinna Vinschen
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 correct value for /dev/console, > /dev/conout, /dev/conin or /dev/ptmx. > > This patch

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

2023-07-07 Thread Corinna Vinschen
Hi Takashi, 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/cygwin/dtable.cc > @@ -600,7 +600,13 @@ fh_alloc (path_conv& pc) > case FH_TTY: > if

Re: [PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Corinna Vinschen
Hi Mark, On Jul 7 00:41, Mark Geisert wrote: > The current version of cannot be compiled by Clang due to > the use of __builtin* functions. Their presence here was a dubious > optimization anyway, so their usage has been converted to standard > library functions. A popcnt (population count of

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

2023-07-07 Thread Corinna Vinschen
On Jul 7 12:30, Takashi Yano wrote: > 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

[PATCH] Cygwin: Make gcc-specific code in compiler-agnostic

2023-07-07 Thread Mark Geisert
The current version of cannot be compiled by Clang due to the use of __builtin* functions. Their presence here was a dubious optimization anyway, so their usage has been converted to standard library functions. A popcnt (population count of 1 bits in a word) function is provided here because