This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Minor O_CLOEXEC optimization, "regression" fix
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: tromey at redhat dot com, ktietz at redhat dot com, gdb-patches at sourceware dot org
- Date: Wed, 9 Oct 2013 20:37:28 +0200
- Subject: Re: [patch] Minor O_CLOEXEC optimization, "regression" fix
- Authentication-results: sourceware.org; auth=none
- References: <20131008183214 dot GB27355 at host2 dot jankratochvil dot net> <87li23fsym dot fsf at fleche dot redhat dot com> <20131009131016 dot GA1603 at host2 dot jankratochvil dot net> <83hacqqsx7 dot fsf at gnu dot org> <87ob6ybcdc dot fsf at fleche dot redhat dot com> <83bo2yqrop dot fsf at gnu dot org> <20131009174124 dot GA20135 at host2 dot jankratochvil dot net> <837gdmqqbv dot fsf at gnu dot org>
On Wed, 09 Oct 2013 19:58:12 +0200, Eli Zaretskii wrote:
> Then why did you ask this upthread:
>
> > May one rely on MS-Windows fopen("","re") will fail with EINVAL if it fails
> > because of the "e" flag, Kai? It is in GDB function gdb_fopen_cloexec.
>
> ? That's what confused me. Sorry if I missed something.
I did not realize / expect O_CLOEXEC is 0 on MS-Windows. Also MS-Windows has
many build platforms like MinGW, Cygwin, ActiveState(?), 32 vs. 64 bit, native
vs. cross, there exist various sets of include files either original or stolen
by dirty room / clean room approaches, so when we talk about "MS-Windows" here
do not believe we cover all the possible ways how to build MS-Windows hosted
GDB.
Also I do not believe that every platform not supporting "e" has to return
EINVAL for it, some platform could IMO return a different error code, relying
on EINVAL for "e" is IMO not cross-platform compatible enough.
But whenever I try to build GDB on a non-Linux platform it fails for me anyway
so I do not much believe in the claimed and attempted wide platform
compatibility of GDB. Therefore I found it fine to make the code simpler and
more optimal on GNU/Linux when there is an agreement from other maintainer(s).
Regards,
Jan