This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

stat'ing "/" vs "//"


Looks like current release of Cygwin stat returns 0 for both "/" and
"//" whereas MSVC and other POSIX runtimes produce -1 for "//". Is
this by design? My shortened version of POSIX doesn't say much about
leading "//" other than saying it's allowed. Can someone check what
the current dev version says?

Here's a trivial test case:

  #include <sys/types.h>
  #include <sys/stat.h>
  #include <stdio.h>

  int 
  main (int argc, char *argv[]) 
  {
    struct stat s;
    printf ("stat (/) = %d\n", stat ("/", &s));
    printf ("stat (//) = %d\n", stat ("//", &s));
    return 0;
  }

Regards,
Mumit