This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.5.0-1 Working Great Here


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]