Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix cygwin compilation failure due to nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing
Date: Wed, 18 Dec 2013 19:18:00 -0000	[thread overview]
Message-ID: <20131218191757.GC30010@calimero.vinschen.de> (raw)
In-Reply-To: <83zjnyaupt.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]

On Dec 18 20:18, Eli Zaretskii wrote:
> > Date: Wed, 18 Dec 2013 18:31:55 +0100
> > From: Corinna Vinschen <vinschen@redhat.com>
> > 
> > > So lifting the 260-char limit means both go to Unicode _and_ use the
> > > \\?\ format of file names, is that right?
> > 
> > Right.
> > 
> > > If so, it probably means
> > > that CRT functions that accept wchar_t arrays as file names (_wfopen
> > > etc.) cannot be used with such long file names, and one needs to call
> > > the Win32 APIs directly.  Correct?
> > 
> > I don't know, but I doubt it.  The filenames in case of calling the
> > _wfopen functions are probably sent directly to the underlying WIn32
> > functions.
> 
> I don't think they can do that, because it would mean that relative
> file names, "../foo", etc. are forbidden for _wfopen.  The CRT
> functions must go through file-name normalization, so unless they
> detect \\?\ file names up front and refrain from any processing, the
> long file names will not work, because the normalization routines are
> where these limitations live, AFAIK.

There's a lot of theory here.  Did you actually *try* it?  I just
did:

===========================================
#include <stdio.h>
#include <errno.h>

int main(void)
{
  FILE *fp;

  fp = _wfopen (L"\\\\?\\C:\\Windows\\System32\\ntdll.dll", L"r");
  if (!fp)
    printf ("_wfopen w/ long pathname fails, errno = %d\n", errno);
  else
    {
      printf ("_wfopen w/ long pathname works\n");
      fclose(fp);
    }
   return 0;
}
===========================================


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-12-18 19:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <52ab8d0e.8aa2420a.30ff.ffffd8f1SMTPIN_ADDED_BROKEN@mx.google.com>
2013-12-16 17:13 ` Pedro Alves
2013-12-16 22:50   ` Pierre Muller
2013-12-18 11:20   ` Corinna Vinschen
     [not found]     ` <83bo0ecgdw.fsf@gnu.org>
2013-12-18 16:07       ` Corinna Vinschen
2013-12-18 17:03         ` Eli Zaretskii
2013-12-18 17:18           ` Corinna Vinschen
2013-12-18 17:29             ` Eli Zaretskii
2013-12-18 17:31               ` Corinna Vinschen
2013-12-18 18:19                 ` Eli Zaretskii
2013-12-18 19:18                   ` Corinna Vinschen [this message]
2013-12-18 20:01                     ` Eli Zaretskii
2013-12-18 20:54                       ` Corinna Vinschen
2013-12-19 18:33                         ` Eli Zaretskii
2013-12-28  3:17                           ` Joel Brobecker
2013-12-28  9:02                             ` Eli Zaretskii
2013-12-13 22:41 Pierre Muller
2013-12-16  2:21 ` Yao Qi
2013-12-16 18:05   ` Pedro Alves
2013-12-17  0:43     ` Yao Qi
2013-12-17  8:43       ` Pierre Muller
2013-12-18  3:37 ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131218191757.GC30010@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox