X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:date:message-id:content-type
	:content-id:content-transfer-encoding:mime-version; q=dns; s=
	default; b=axXhw+kAvyVuj1uSK0An4Qilxh+yTvlh53wqnbpdiENYA21VsU615
	Oqs1j3xUcSwtvIqELdPSEe3LSJUp/d9G0O1vk7qUAz2yuTpOkGH6E4HHkJLdUPYP
	i8wkAazxypdxjkxHKf7ahgG5yz2aodVaW8AVesoVN2DVtmR7OE+pTA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:date:message-id:content-type
	:content-id:content-transfer-encoding:mime-version; s=default;
	 bh=rQ79wkW9MGWT3k94IzQ9UYEMmV8=; b=xZ53Sqe/wTOw7cI9fFPL9k/6npyz
	PAW3ktERRvEu7iU0a/NZ0FQAlQyzsJETROi8rZ4CHkgNqFf42tMkV3AkbQ9as2Rh
	F4765ZSIjuLnpr9DE56R8xO3MzJRaasGauBhJfQzexCWIuZdw0j9GGJyKDuy3GFU
	8YREuNIS2hXDwaw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-0.9 required=5.0 tests=AWL,BAYES_00,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=hoops, inline=e2, redefine?=
X-HELO: na01-bl2-obe.outbound.protection.outlook.com
From: Bill Zissimopoulos <billziss@navimatics.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: FUSE for Cygwin
Date: Fri, 17 Jun 2016 20:29:32 +0000
Message-ID: <D389ABB9.931F%billziss@navimatics.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=billziss@navimatics.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-office365-filtering-correlation-id: b2ebd71b-3db9-43e4-1d6b-08d396ee1722
x-microsoft-exchange-diagnostics: 1;CY1PR07MB2199;5:y1TTpsr5H1JRDGT2wO/SclDqIgSO2hQwOWt5XLsgDR2K8glLPursEAjDMBT+bRU3WRfz6xTlTzVzDiuIhaC50XtAsauN+BjrFN0it+xF2u6X9xaq0AQtb6Vrp9gYDuQLsi5+0qXpXt6MzllZnmIe1g==;24:Ul7VXBtjyamgO9Mt67Jbk0y3k5LYsagHNFsvzChddglTEiGt4rUHQF1h4jvicjgap/Ri8Irsc5uCFb+NCKmmKteAu//F/7mZqI0HPDpjabs=;7:VUELGzsD2K+EH347zyeUCxXDWM1OCqdHkZERwPZ4hDJWwxRiYMFA5lqwbZ0kFk9lQy6aYSfYkwnORysoAHlzIWBp+AjwNlHhieou13U+lUZYlYXd3G203BAyVIhUxHkdAIZi/C/o2YHyn92YcdAS5kbETr0oWx4LKcjWSObXRBQDpSPgcGKtEC9rcLY2dbH3MSnMgP5z8/p2afiX1wS9pw==
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2199;
x-microsoft-antispam-prvs: <CY1PR07MB21998FEAB487F92F8B7186E3BC570@CY1PR07MB2199.namprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(166708455590820);
x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040130)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041072)(6043046);SRVR:CY1PR07MB2199;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2199;
x-forefront-prvs: 09760A0505
x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(189002)(97736004)(87936001)(105586002)(106116001)(3280700002)(106356001)(36756003)(19580395003)(2906002)(5002640100001)(7846002)(107886002)(189998001)(110136002)(99286002)(5640700001)(8676002)(1730700003)(81156014)(81166006)(15975445007)(2351001)(101416001)(77096005)(10400500002)(102836003)(3846002)(6116002)(586003)(68736007)(54356999)(50986999)(66066001)(5004730100002)(8936002)(2900100001)(92566002)(86362001)(450100001)(2501003)(3660700001)(11100500001)(3480700004)(122556002)(94096001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR07MB2199;H:CY1PR07MB2199.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en;
received-spf: None (protection.outlook.com: navimatics.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-ID: <C0342A22AE82E44598E7A8BBFFC269EE@namprd07.prod.outlook.com>
MIME-Version: 1.0
X-OriginatorOrg: navimatics.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jun 2016 20:29:32.1976 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 21071be9-4f9a-413b-89ac-8353a5d2410a
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2199
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id u5HKU0LM012168

Hi, Herbert:

> > WinFsp provides three (3) different modes of integration:
[snip]
> i'm planning to make a suggestion of mode (4). It will be in addition or
> instead of (3) and will avoid those issues we touched.

I think (based on your earlier ask re: bindings to Python, Perl, etc.) I
may see what you mean with mode (4). Perhaps a libfuse Cygwin DLL that
presents an API *exactly* like the one from FUSE?

Currently WinFsp goes through a number of hoops to support the Win32 and
Cygwin environments with a single DLL. As a result a call to fuse_new is
really a call to fsp_fuse_new through a static inline function.

    static inline struct fuse *fuse_new(...)
    {
        return fsp_fuse_new(fsp_fuse_env(), ...);
    }

Fsp_fuse_env “captures” the environment (e.g. the local malloc/free) so
that the WinFsp DLL can remain environment independent. But this scheme
will not (and cannot) work for e.g. Python bindings that need to dlopen
the “fuse” library. Here is FUSEPY, as example:
    https://github.com/terencehonles/fusepy/blob/master/fuse.py#L66

If that is indeed your plan I would support it.

Creating a libfuse Cygwin DLL like that should be easy. Perhaps I can help
by making the “static inline” part a macro such as FSP_FUSE_STATIC_INLINE,
which one could redefine to __attribute__ ((visibility("default")))

Bill


