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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 952D27EE79 for ; Fri, 6 May 2016 10:48:36 +0200 (CEST) IronPort-PHdr: 9a23:miAf7xVDFkGtDbOFbDQHOZlaUbjV8LGtZVwlr6E/grcLSJyIuqrYZhOEt8tkgFKBZ4jH8fUM07OQ6PCxHzReqs7c+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8yVO1sD3Gf1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu2pN5g/GPZTBTEidmQ0/9HDtB/ZTALJ6GFWGjEdmx9MRgzE9w3SX5HrsyK8uPAriweAOsijB4szVDu+9aBzDFfNiSwHPjM9uimDj817jKtWpFS6oBFw35TTeKmUMuZzeuXWetZMFjkJZdpYSyEUWtD0VIAIFedUZes= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=michael.soegtrop@intel.com; spf=Pass smtp.mailfrom=michael.soegtrop@intel.com; spf=None smtp.helo=postmaster@mga01.intel.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of michael.soegtrop@intel.com) identity=pra; client-ip=192.55.52.88; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="michael.soegtrop@intel.com"; x-sender="michael.soegtrop@intel.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of michael.soegtrop@intel.com designates 192.55.52.88 as permitted sender) identity=mailfrom; client-ip=192.55.52.88; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="michael.soegtrop@intel.com"; x-sender="michael.soegtrop@intel.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mga01.intel.com) identity=helo; client-ip=192.55.52.88; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="michael.soegtrop@intel.com"; x-sender="postmaster@mga01.intel.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AnAACFWSxXkFg0N8BdgmyBH30Gpi+SQwENgXYXAQKFdgKBNDgUAQEBAQEBAQERAQEBAQcNCQkhJAuCLYIbJwYcQgEqViYBBBuIIQGdLaBmAQsBHYYhiFY2gkYLQBiCLgWYGgUBgS2cA0WOcR4BAYJYIIE1bIcuAX4BAQE X-IPAS-Result: A0AnAACFWSxXkFg0N8BdgmyBH30Gpi+SQwENgXYXAQKFdgKBNDgUAQEBAQEBAQERAQEBAQcNCQkhJAuCLYIbJwYcQgEqViYBBBuIIQGdLaBmAQsBHYYhiFY2gkYLQBiCLgWYGgUBgS2cA0WOcR4BAYJYIIE1bIcuAX4BAQE X-IronPort-AV: E=Sophos;i="5.24,586,1454972400"; d="scan'208,217";a="176862480" Received: from mga01.intel.com ([192.55.52.88]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 May 2016 10:48:34 +0200 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 06 May 2016 01:48:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,586,1455004800"; d="scan'208,217";a="973897762" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga002.fm.intel.com with ESMTP; 06 May 2016 01:48:29 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.35]) by IRSMSX152.ger.corp.intel.com ([169.254.6.54]) with mapi id 14.03.0248.002; Fri, 6 May 2016 09:48:28 +0100 From: "Soegtrop, Michael" To: "caml-list@inria.fr" Thread-Topic: How to handle system decencies in Ocaml (like O_ASYNC not implemented in cygwin) Thread-Index: AdGnc/7YnFxEt/vtTd6nHE/ZEtao0w== Date: Fri, 6 May 2016 08:48:27 +0000 Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A172CEEEA4D@IRSMSX102.ger.corp.intel.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: multipart/alternative; boundary="_000_0F7D3B1B3C4B894D824F5B822E3E5A172CEEEA4DIRSMSX102gercor_" MIME-Version: 1.0 Subject: [Caml-list] How to handle system decencies in Ocaml (like O_ASYNC not implemented in cygwin) --_000_0F7D3B1B3C4B894D824F5B822E3E5A172CEEEA4DIRSMSX102gercor_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Dear Ocaml users, I am working on compiling core with opam on cygwin. My plan is to integrate= this with the work of whitequark (MinGW cross opam for Linux) to have a Mi= nGW cross opam on cygwin. I already have a convenient script to setup cygwin with all modules and to = compile opam and it works fine. Just when compiling core, there are two Uni= x features not implemented in cygwin. One is O_ASYNC. It is easy to patch i= t away and also easy to make this system dependent in the C file (unix_stub= s.c), but I wonder how I could handle this in a portable way in the OCaml w= rapper. It looks like this: module Open_flags =3D struct external append : unit -> Int63.t =3D "unix_O_APPEND" external async : unit -> Int63.t =3D "unix_O_ASYNC" external cloexec : unit -> Int63.t =3D "unix_O_CLOEXEC" Is there some way to have async on normal Linux and not have it on cygwin? Btw.: Opam, batteries and 34 out of the 35 modules of core compile fine on = cygwin and the remaining module just has two errors, so I think it is worth= while to fix this. Best regards, Michael Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928 --_000_0F7D3B1B3C4B894D824F5B822E3E5A172CEEEA4DIRSMSX102gercor_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable

Dear Ocaml users,

 

I am working on compiling core with opam on cygwin. = My plan is to integrate this with the work of whitequark (MinGW cross opam = for Linux) to have a MinGW cross opam on cygwin.

 

I already have a convenient script to setup cygwin w= ith all modules and to compile opam and it works fine. Just when compiling = core, there are two Unix features not implemented in cygwin. One is O_ASYNC= . It is easy to patch it away and also easy to make this system dependent in the C file (unix_stubs.c), but = I wonder how I could handle this in a portable way in the OCaml wrapper. It= looks like this:

 

module Open_flags =3D struct

  external append    : unit ->= ; Int63.t =3D "unix_O_APPEND"

  external async     : u= nit -> Int63.t =3D "unix_O_ASYNC"

  external cloexec   : unit -> Int= 63.t =3D "unix_O_CLOEXEC"

 

Is there some way to have async on normal Linux and = not have it on cygwin?

 

Btw.: Opam, batteries and 34 out of the 35 modules o= f core compile fine on cygwin and the remaining module just has two errors,= so I think it is worthwhile to fix this.

Best regards,

Michael

 

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

--_000_0F7D3B1B3C4B894D824F5B822E3E5A172CEEEA4DIRSMSX102gercor_--