From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 54F34BC2F for ; Mon, 29 Nov 2004 07:18:09 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAT6I8jp012197 for ; Mon, 29 Nov 2004 07:18:08 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA12245 for ; Mon, 29 Nov 2004 07:18:08 +0100 (MET) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAT6I6BE019724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 29 Nov 2004 07:18:07 +0100 Received: from davidb by mail.davidb.org with local (Exim 4.42 #1 (Debian)) id 1CYerN-0004sa-2x; Sun, 28 Nov 2004 22:18:05 -0800 Date: Sun, 28 Nov 2004 22:18:05 -0800 From: David Brown To: Ian Zimmerman Cc: caml-list@inria.fr Subject: Re: [Caml-list] stat in Unix library Message-ID: <20041129061805.GA18644@old.davidb.org> References: <87y8glecwv.fsf@buug.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y8glecwv.fsf@buug.org> User-Agent: Mutt/1.5.6i X-Miltered: at concorde with ID 41AABF20.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41AABF1E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 caml-list:01 zimmerman:01 wrote:01 struct:01 kernels:01 ocaml:01 damning:01 largefile:01 bindings:01 lstat:01 unix:01 unix:01 integer:01 integer:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: 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