delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/04/12/21:03:26

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Mon, 12 Apr 1999 21:01:55 -0400
To: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>
Cc: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: struct stat st_dev question
Message-ID: <19990412210155.C2833@cygnus.com>
References: <199904122339 DOT SAA16654 AT modi DOT xraylith DOT wisc DOT edu>
Mime-Version: 1.0
X-Mailer: Mutt 0.95.3i
In-Reply-To: <199904122339.SAA16654@modi.xraylith.wisc.edu>; from Mumit Khan on Mon, Apr 12, 1999 at 06:39:13PM -0500

Hmm.  st_dev should be a disk's volume serial number, at least
from my reading of the code in fhandler.cc.

If it's always returning 4096, that's a bug.

-chris

On Mon, Apr 12, 1999 at 06:39:13PM -0500, Mumit Khan wrote:
>I'm trying to debug a problem with egcs and the causes seems to be the
>fact that the st_dev member of struct stat is always set to 4096. This 
>is with Cygwin b20.1 DLL (and needs to be since egcs-1.2 needs to work
>with b20.1 as well as any future release). Can anyone confirm if this 
>is indeed intended? 
>
>Here's a simple test case:
>
>=== cut here
>
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <stdio.h>
>
>  int main (int argc, char *argv[]) {
>    const char *path = (argc >= 2) ? argv[1] : "/";
>    struct stat s;
>    int i = stat (path, &s);
>    printf ("stat (%s) = %d\n", path, i);
>    printf ("inode = %d\n", s.st_ino);
>    printf ("%s.st_dev = %d\n", path, s.st_dev);
>
>    return 0;
>  }
>
>=== to here
>
>  $ ./stdev-test-cyg / 
>  stat (/) = 0
>  inode = 22896814
>  /.st_dev = 4096
>  $ ./stdev-test-cyg //d
>  stat (//d) = 0
>  inode = 22642860
>  //d.st_dev = 4096
>  $ ./stdev-test-cyg //u 
>  stat (//u) = 0
>  inode = 13213796
>  //u.st_dev = 4096
>
>Microsoft's runtime does report different device id's.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019