Version française
Home     About     Download     Resources     Contact us    
Browse thread
stat in Unix library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] stat in Unix library
On Sun, Nov 28, 2004 at 04:06:56PM -0800, Ian Zimmerman wrote:

> The st_dev member of type Unix.stats is declared as int.  But according
> to the Single Unix spec, the corresponding member of the C struct has
> a defined type, dev_t; and in fact recent Linux kernels define dev_t
> to a 64 bit type, even on 32 bit architectures.  So it looks like
> the Ocaml function will lose the high order bits.

st_ino as an in is a more damning problem.  Linux, with XFS can easily have
inode numbers that exceed a 32-bit integer (especially a 31-bit integer).

Practically, on Linux, st_dev is still only using 16-bits on Linux, but
people are still trying to increase that.

Unix.LargeFile almost fixes everything, except for the st_dev, st_rdev, and
st_ino fields still being too small.  Increase those, and I would stop
having to put my own bindings to lstat in my programs :-)

Dave