From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id D9C1181799 for ; Sat, 27 Jul 2013 16:11:16 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of monnier.florent@gmail.com) identity=pra; client-ip=74.125.82.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="monnier.florent@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of monnier.florent@gmail.com designates 74.125.82.175 as permitted sender) identity=mailfrom; client-ip=74.125.82.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="monnier.florent@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f175.google.com) identity=helo; client-ip=74.125.82.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="postmaster@mail-we0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuoBAMHU81FKfVKvk2dsb2JhbABbgztQvV2BDggWDgEBAQEHCwsJFAQkgiQBAQQBQAEbHQEDAQsGBQsNLiIBEQEFAQ4BDQYbh3UBAwkGDJsbjE+Cf4QaChknDWSHdAEFDI9xB4QFA5dfgSmOPhYphDw6 X-IPAS-Result: AuoBAMHU81FKfVKvk2dsb2JhbABbgztQvV2BDggWDgEBAQEHCwsJFAQkgiQBAQQBQAEbHQEDAQsGBQsNLiIBEQEFAQ4BDQYbh3UBAwkGDJsbjE+Cf4QaChknDWSHdAEFDI9xB4QFA5dfgSmOPhYphDw6 X-IronPort-AV: E=Sophos;i="4.89,757,1367964000"; d="scan'208";a="27539253" Received: from mail-we0-f175.google.com ([74.125.82.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 27 Jul 2013 16:11:04 +0200 Received: by mail-we0-f175.google.com with SMTP id q58so2767118wes.34 for ; Sat, 27 Jul 2013 07:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kHmOIpWLR9KjmIAz5mitCHVTXYEbiMU9mBeuVN4Ihjo=; b=hvhg3JAjEpF1pQSjcp2FH0ZuABeBdRtEUSkMzojZKf8bcISP+DCzPWNJU7+s//Xr3t NCLQSwexJR1KSdDrA4d4xTFLNBEWnGx6LOkQp3F4hAY447PVm3rd9ulbROHZY/JQK8ud YLidqpukMH1HUtCs7R5uW9owFhSSWzRaHHqGIonAmBrPq46n8GoZTNnpJE3C6Uwwsq0X me0zDWHu+pJEzjrlLxoyOlc9gzJRV+w0CkTZeejCnBvRrqlXFrRv80x/e+V7LswJ2bLE ymXXtHbg+TD7+JIKBjHclJTIS+SJA9CaFjtMLID5xMKFEAnZx0/l23gk5TNqZyVmbwDh cP5A== MIME-Version: 1.0 X-Received: by 10.194.92.6 with SMTP id ci6mr13540440wjb.79.1374934264153; Sat, 27 Jul 2013 07:11:04 -0700 (PDT) Received: by 10.194.80.36 with HTTP; Sat, 27 Jul 2013 07:11:04 -0700 (PDT) In-Reply-To: <20130727083844.GA17235@notk.org> References: <20130727083844.GA17235@notk.org> Date: Sat, 27 Jul 2013 16:11:04 +0200 Message-ID: From: Florent Monnier To: Adrien Nader Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Validation-by: monnier.florent@gmail.com Subject: Re: [Caml-list] Re: portable truncate 2013/07/27, Adrien Nader wrote: > On Fri, Jul 26, 2013, Florent Monnier wrote: [...] >> I'm still not sure though that compiling with MSVC or MinGW can be >> considered equivalent. >> And actually they seem not considering this page: >> [2] http://caml.inria.fr/ocaml/portability.en.html > > The compiler differs but otherwise the differences are small. I have already understood that MinGW will produce a resulting binary that equivalently makes use of MS' OS libs. But as far as I have understood it also provide an additional layer which goal is to make easier to compile something that comes from the Unix world. As a result I expected to get a fully functional ocaml Unix module. > The libc > that is used on Windows is Microsoft's (actually called CRT); mingw* > provide some additions to that and apparently, ftruncate is provided. - truncate() DOES work on my computer - ftruncate() / _chsize() DOESN'T > In otherlibs/win32unix/unix.ml, you have: > let ftruncate fd len = invalid_arg "Unix.ftruncate not implemented" I see, I expected that a mingw variant would use "otherlibs/unix/" So it seems I was wrong again on that point too. > And in unistd.h, you have: [...] > __CRT_INLINE int ftruncate(int __fd, off32_t __length) > { > return _chsize (__fd, __length); > } [...] > Considering this, you should probably make a patch to add a file > win32unix/ftruncate.c which use the implementation above and replace the > implementation of ftruncate* in win32unix/unix.ml. Don't you think that "win32unix/" should remain as is for the MS compiler, and that mingw variant should just switch to "otherlibs/unix/" ? > I don't know what is the purpose of the __CRT_NO_INLINE define; I've > already asked and will propagate the answer when I get it. It would be > good to have truncate*() too. > > (and submit it to the bug tracker :-) ) I do have only one test machine with Windows Seven Starter to make tests. And I do not have the MS' compiler. Are there other people arround living in Rennes (the town where I live) that would accept to provide me access to other test machines under MS/Windows ? Like for example Windows 8 ? (So that I could do more serious tests.) I would be interested to access Mac OS X too, also for portability works. (Someone from the lug gave me a Mac in the past to make some portability work, but this machine is too old now for this kind of tasks.) -- Regards