RFC: adding fd-passing to win32
Thiago Macieira
thiago at kde.org
Mon Aug 8 16:19:45 UTC 2022
On Monday, 8 August 2022 04:40:22 PDT Marc-André Lureau wrote:
> FDs are not HANDLEs, we shouldn't mix the two (a mistake commonly observed
> and annoying to clean up).
I never claimed otherwise. My point is that the wire format is an
implementation detail.
> If some day Windows sockets learn SCM_RIGHT, we should transfer FDs values.
Highly doubtful. It's doubtful that it'll learn that Linux-specific feature and
it's doubtful that file descriptor values will be transferable. They aren't on
Linux anyway: the file descriptor value is not retained. You get a new file
descriptor locally, which happens to map to the same kernel-side structure.
> We could eventually use 'h' for FDs or HANDLEs or SOCKETs (or other kind as
> necessary), the "handle array" contains the type details. But then 'h'
> implementation will be different on Windows, regardless of potentially
> future same SCM_RIGHT support. I think it's a better idea to treat HANDLEs
> as a different type.
I disagree.
Let's make this easier for you:
If you use 'h' and just make the reference implementation work, then all the
implementations that use it will automatically gain the functionality. You'll
only need to do code reviews, without a spec change, with most of the changes
restricted to win32-specific files. You'll need to update the implementations
that do D-Bus socket directly, but similarly they will not have any user API
change and applications should work unmodified.
If you use 'H', you'll first need to start with a spec update and you'll need
to convince people like Simon and myself, who don't have as extensive Windows
knowledge, that it is needed (and this thread is pointing that we aren't
getting convinced). You'll need code reviews throughout the implementation to
support a new type. Then you'll need to update the API in libdbus-1, then all
the implementations that use it, including fixing them where they expect to
know the full population of D-Bus types but now don't. That is a much tougher
ask.
Maybe your objective has never been to retain source compatibility across
platforms. But then please explain why that is not a goal.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel DCAI Cloud Engineering
More information about the dbus
mailing list