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 81B567EE79 for ; Sat, 7 May 2016 16:24:16 +0200 (CEST) IronPort-PHdr: 9a23:otOArxcZ1s2AJEI4ZuMN/l0/lGMj4u6mDksu8pMizoh2WeGdxc6zbB7h7PlgxGXEQZ/co6odzbGG4ua4CSdfvd6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDjvcWDKFoUzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IeezAcq85Vb1VCig9eyBwvZWz9EqLcQzarEAbX2oKiB1QR0Dg7Rr6V5r1+GOus+t22CCXOYvtSr07RS6l949qTgPljGEMMDtvo0/NjcklriNBPBes7zZyxYnVfMnBNvdkeabQO9kXQ21AQu5eTSFHBZ69a48CSeEGOLAL/MHGu1ISoE7mVkGXD+T1x2oN3yeu0A== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jerome.benoit@grenouille.com; spf=Pass smtp.mailfrom=jerome.benoit@grenouille.com; spf=None smtp.helo=postmaster@laposte.grenouille.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jerome.benoit@grenouille.com) identity=pra; client-ip=91.121.8.57; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jerome.benoit@grenouille.com"; x-sender="jerome.benoit@grenouille.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jerome.benoit@grenouille.com designates 91.121.8.57 as permitted sender) identity=mailfrom; client-ip=91.121.8.57; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jerome.benoit@grenouille.com"; x-sender="jerome.benoit@grenouille.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@laposte.grenouille.com) identity=helo; client-ip=91.121.8.57; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jerome.benoit@grenouille.com"; x-sender="postmaster@laposte.grenouille.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AIBQCj+S1X/zkIeVtehA19gnuuEooCGoJEgzICgV0RAQEBAQEBAQFkJ4ItghUBAQMBDBdWBQsJAiEhAgIPSAYTiCMMAZBLnR2QVwEBAQcBAQEBHIpshz+CWQWYIoV9b4cmgXNljElFjnQCNiyCNoE3OjIBAYgeAQEB X-IPAS-Result: A0AIBQCj+S1X/zkIeVtehA19gnuuEooCGoJEgzICgV0RAQEBAQEBAQFkJ4ItghUBAQMBDBdWBQsJAiEhAgIPSAYTiCMMAZBLnR2QVwEBAQcBAQEBHIpshz+CWQWYIoV9b4cmgXNljElFjnQCNiyCNoE3OjIBAYgeAQEB X-IronPort-AV: E=Sophos;i="5.24,589,1454972400"; d="scan'208";a="217241874" Received: from ns37873.ovh.net (HELO laposte.grenouille.com) ([91.121.8.57]) by mail2-smtp-roc.national.inria.fr with ESMTP; 07 May 2016 16:24:15 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by laposte.grenouille.com (Postfix) with ESMTP id D957C7F798; Sat, 7 May 2016 16:24:12 +0200 (CEST) X-Virus-Scanned: spam & virus filtering at laposte.grenouille.com X-Spam-Flag: NO X-Spam-Score: -1.902 X-Spam-Level: Received: from laposte.grenouille.com ([127.0.0.1]) by localhost (ns37873.ovh.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nJqoTUEhTwse; Sat, 7 May 2016 16:23:52 +0200 (CEST) Date: Sat, 7 May 2016 16:23:47 +0200 From: =?UTF-8?B?SsOpcsO0bWU=?= Benoit To: "Soegtrop, Michael" Cc: "Yaron Minsky" , "caml-list@inria.fr" , "ocaml-core@googlegroups.com" Message-ID: <20160507162347.4e61aef7@nemesis> In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A172CEEFECE@IRSMSX102.ger.corp.intel.com> References: <0F7D3B1B3C4B894D824F5B822E3E5A172CEEEA4D@IRSMSX102.ger.corp.intel.com> <20160506234133.6f1cb28c@nemesis> <0F7D3B1B3C4B894D824F5B822E3E5A172CEEFECE@IRSMSX102.ger.corp.intel.com> Organization: Grenouille.com X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/QQA.6l+ZMTML.A/0KZL5j7q"; protocol="application/pgp-signature" Subject: Re: [Caml-list] How to handle system decencies in Ocaml (like O_ASYNC not implemented in cygwin) --Sig_/QQA.6l+ZMTML.A/0KZL5j7q Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, 7 May 2016 08:37:22 +0000 in <0F7D3B1B3C4B894D824F5B822E3E5A172CEEFECE@IRSMSX102.ger.corp.intel.com>, "Soegtrop, Michael" wrote: > Dear J=C3=A9r=C3=B4me, >=20 > it is easy to detect with preprocessor defines if O_ASYNC is > supported or not on the C level. I wondered what would be the most > appropriate way to inform OCaml of the situation. I guess I should > just call caml_failwith("O_ASYNC not supported by Cygwin") in the > async function on cygwin?=20 So you want to catch the system call specificities at runtime inside OCaml ?=20 Not sure it's a good idea to maintain a list of supported features, std functions flags, etc. linked to uname -o output inside OCaml.=20 Most FOSS software simply compile out code not supported by system X and rely on error handling in the underlying layer and propagate the error number, message in the upper layer.=20=20 > Maybe a "not supported" standard exception > would be a nice thing to handle system dependencies. Maybe I fail to understand what you want to achieve, Cygwin do not report an error that OCaml propagate if you use an unsupported flag with open() ? Regards,=20=20 --=20 J=C3=A9r=C3=B4me Benoit aka fraggle Piment Noir - http://piment-noir.org OpenPGP Key ID : 9FE9161D Key fingerprint : 9CA4 0249 AF57 A35B 34B3 AC15 FAA0 CB50 9FE9 161D --Sig_/QQA.6l+ZMTML.A/0KZL5j7q Content-Type: application/pgp-signature Content-Description: Signature digitale OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlct+nQACgkQ+qDLUJ/pFh1r1wCeMl22Y2fhxD60/q3hxE166f2j hBoAn3jb9UPCG6Ocqxcqs1bL/IlCNOsT =/Ext -----END PGP SIGNATURE----- --Sig_/QQA.6l+ZMTML.A/0KZL5j7q--