delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/10/13:55:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 10 Jul 2003 13:54:12 -0400
From: Christopher Faylor <cgf-idd AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.0-1 Working Great Here
Message-ID: <20030710175412.GC6345@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <000001c346fd$4685a620$2101a8c0 AT BRAEMARINC DOT COM> <20030710160833 DOT GY12368 AT cygbert DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20030710160833.GY12368@cygbert.vinschen.de>
User-Agent: Mutt/1.4.1i

On Thu, Jul 10, 2003 at 06:08:33PM +0200, Corinna Vinschen wrote:
>On Thu, Jul 10, 2003 at 11:06:49AM -0500, Gary R Van Sickle wrote:
>> XPPro, NTFS.  Builds working GCC cross compiler and binutils just fine,
>> which covers a lot of intermediate territory.  Autoconf/Automake/Perl still
>> work.  I don't know if the tools thus built use 64-bit file APIs, since I
>> don't have any source files exceeding 4GB ;-).  And I've even been using the
>> snapshots.
>
>Please don't forget that 1.5.0 not only introduces 64 bit file offsets
>but also 32 bit uids and gids.  Testing this is pretty easy by changing
>/etc/passwd and /etc/group.  Just keep in mind that all tools not build
>for 1.5.0 will not like uids/gids > 64K...

Corinna has also suggested that it is now easy to create a huge text file
thanks to sparse file support with something like the (mildly tested) code
below.  Run it on an NTFS filesystem and you should get a 4G + 1 file.

cgf

#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>

int
main (int argc, char **argv)
{
  int fd = open("foo", O_CREAT | O_WRONLY, 0666);
  struct stat st;
  if (fd < 0)
    {
      perror ("open: Hey!");
      exit (1);
    }

  if (lseek (fd, 4LL * 1000 * 1000 * 1000, SEEK_SET) < (off_t) -1)
    {
      perror ("lseek: Hey!");
      exit (1);
    }
  if (write (fd, "a", 1) != 1)
    {
      perror ("write: Hey!");
      exit (1);
    }
  close (fd);
  if (stat ("foo", &st))
    {
      perror ("stat: Hey!");
      exit (1);
    }
  printf ("file size %llu\n", st.st_size);
  exit (0);
}

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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