delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/09/05:32:49

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <F0793061A5B1D411AC9B08000628282304B7E9@cervin.grenoble.cstb.fr>
From: NOE Nicolas <n DOT noe AT cstb DOT fr>
To: "Cygwin (Adresse de messagerie)" <cygwin AT sourceware DOT cygnus DOT com>
Subject: latest release trouble using stat() with -mno-cygwin flag
Date: Tue, 9 Jan 2001 11:17:30 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)

Hello, 

I use stat() from sys/stat.h to get a file size in a C program,
compiling with -mno-cygwin flag. It used to work before I updated
to latest releases (cygwin, gcc and mingw), but now the stat
structure seems to be melted, since I always get 4 as st_size, and
that the real size seems to be in the st_atime field ! By the way,
everything works fine without -mno-cygwin flag.

Maybe I should ask my question on the mingw list, but I don't know
if the mingw included in cygwin distribution is just a copy of the
latest mingw release or if some things are changed. If the bug
comes from a faulty mingw, is there a safe way to remove my current
one (mingw-20001225-1.tar.gz) and reinstall a previous one ?

I use the command line : gcc -mno-cygwin -o stat stat.c and my test
program is the following (stat.c) :

#include <stdlib.h>
#include <stdio.h>

#include <sys/stat.h>

int main(int argc, char *argv[])
{
    	int		i;
	struct stat	buf;
	
	for (i = 1; i < argc; i++)
	    	if (stat(argv[i], &buf))
		    	fprintf(stderr, "stat(): error\n");
		else
			printf("%s size is %d\n", argv[i], buf.st_size);

	return 0;
}

Nicolas Noe (n DOT noe AT cstb DOT fr)

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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