delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/07/26/08:49:52

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Message-ID: <397EDE59.940915FB@cygnus.com>
Date: Wed, 26 Jul 2000 14:49:29 +0200
From: Corinna Vinschen <vinschen AT cygnus DOT com>
Reply-To: cygdev <cygwin-developers AT sources DOT redhat DOT com>
X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.14-SMP i686)
X-Accept-Language: de, en
MIME-Version: 1.0
To: Egor Duda <deo AT logos-m DOT ru>
CC: cygwin-dev <cygwin-developers AT sourceware DOT cygnus DOT com>
Subject: Re: st_blocks incorrect for files larger than 2Gbytes
References: <10678 DOT 000726 AT logos-m DOT ru>

Egor Duda wrote:
> 
> Hi!
> 
>   newlib  declares  off_t  as signed long and cygwin's stat calculates
> st_blocks   as
> 
>   buf->st_blocks = (buf->st_size + S_BLKSIZE-1) / S_BLKSIZE;
> 
> i.e. for file with size 2.164.854.784 bytes stat returns st_blocks=-2080187
> or  big  positive value, when assigned to (unsigned long). this may be
> fixed in a)newlib or b)cygwin or c)application
> 
> which way is preferable?

SUSv2 defines an own type blkcnt_t for that purpose. This
might be the best way.

Corinna

-- 
Corinna Vinschen
Cygwin Developer
Cygnus Solutions, a Red Hat company

- Raw text -


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