[Mesa-dev] [PATCH 02/14] vc4, vc5: add ETIME fallback define
Emil Velikov
emil.l.velikov at gmail.com
Fri Jan 19 16:53:46 UTC 2018
On 18 January 2018 at 21:51, Greg V <greg at unrelenting.technology> wrote:
> On 01/18/2018 22:49, Dylan Baker wrote:
>>
>> Quoting Emil Velikov (2018-01-18 10:40:40)
>>>
>>> On 18 January 2018 at 17:13, Dylan Baker <dylan at pnwbakers.com> wrote:
>>>>
>>>> I'm not sure how Emil feels about this (and the related patches) but I
>>>> think it
>>>> might be better to handle this at the build system level, for meson it
>>>> would
>>>> look something like (in the top level meson.build):
>>>>
>>>> if cc.get_define('ETIME') == ''
>>>> pre_args += '-DETIME=ETIMEDOUT'
>>>> endif
>>>>
>>>> Which should be a permanent fix. Emil can probably provide an autotools
>>>> equivalent.
>>>>
>>> I'm not sure how the above works on meson - the define can come from
>>> multiple places.
>>> Surely meson does not check every header available on the system?
>>
>> It doesn't, it checks for defines the preprocessor knows about, if you
>> need to
>> check specific headers there's `has_header_symbol`.
>>
>> Maybe this isn't feasible, but it really feels like having to define ETIME
>> all
>> over the tree if it's not defined is fragile and ugly. I'm with you and
>> Eric
>> that FreeBSD really should solve this themselves.
>
> Looks like OpenBSD and DragonFly don't define ETIME either, but NetBSD and
> illumos do.
>
For our intent and purposes we can consider DragonFly == FreeBSD.
Good call on the OpenBSD/NetBSD side - I knew there was at lease one
BSD that does define it.
Search through OpenBSD's github shows rather disturbing information:
- a config file defines(?) ETIME as -1. could be some perl 'glitch' [1]
- perl states/checks(?) that ETIME is in errno.h [2]
- in DRM-land they have local fallbacks for ETIME and ERESTARTSYS [3]
- their libcxx errno.h provides ETIME (with weird value) [4]
- the official (?) errno.h does not provide ETIME [5]
I'd say that's enough time spent from me on the topic for this year.
I'll let others decide if we should opt for the check_compile/errno.h
trick mentioned elsewhere or not.
I'm still inclined to get BSDs on board with the POSIX spec though,
even if Linux might be abusing it a bit;-)
> BTW, Elf_Nhdr landed:
> https://github.com/freebsd/freebsd/commit/f629be4b4612a8942dd5a2e7db8b68397d1186cd
> :)
Time to pop the champagne :-)
-Emil
[1] https://github.com/openbsd/ports/blob/cc28e46deedf48a5208812530e4044684f78c223/infrastructure/db/config.site#L1024
[2] https://github.com/openbsd/src/blob/d4b582fc080d383f46b27338980e667145e5d4ab/gnu/usr.bin/perl/ext/POSIX/lib/POSIX.pm#L258
[3] https://github.com/openbsd/src/blob/e2f403d15ab190a455dd9d4efca30d7dfb7cc64f/sys/dev/pci/drm/drm_linux.h#L280
[4] https://github.com/openbsd/src/blob/5271000b44abe23907b73bbb3aa38ddf4a0bce08/lib/libcxx/include/errno.h#L218
[5] https://github.com/openbsd/src/blob/84eb796f31be5cb26d74c92cc2583b24360b30b0/sys/sys/errno.h#L119
More information about the mesa-dev
mailing list