Re: [RFC] libgpiod public API reviews needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2018-01-22 12:12 GMT+01:00 Arnd Bergmann <arnd@xxxxxxxx>:
> On Mon, Jan 22, 2018 at 12:02 PM, Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>> 2018-01-22 10:25 GMT+01:00 Arnd Bergmann <arnd@xxxxxxxx>:
>>>
>>> - on x86, the structures are incompatible between 32-bit and 64-bit
>>>   user space, as the former has no padding.
>>
>> Is this really an issue? Do distros really ship the same bytecode for
>> 32 and 64 bit architecures? I have never run into such problems
>> despite having used different python bindings for C libraries (I'm not
>> sure however how many of them dealt with any visible C structs).
>
> It's a huge issue, yes. You should be able to run an 32-bit distro
> or just a standalone 32-bit binary with a 64-bit kernel. This driver
> is otherwise written carefully to allow that, and it will work on all
> other architectures AFAICT, just not on x86.
>

Besides using struct timespec, I have other structs in gpiod.h which
would pose problems for ctypes-based python bindings - for example
struct gpiod_line_request_config which contains a pointer (C string).
If instead of using ctypes, I'd just use python's C extension modules,
is there any other trap caused by different data layout between 32 and
64 bit architectures that I should be aware of?

Also: if python bindings are the only victim of that - I'm ok with
timespec. It's up to bindings to provide a correct interface after
all, isn't it?

Best regards,
Bartosz Golaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux