Re: connectx() function availability
Re: connectx() function availability
- Subject: Re: connectx() function availability
- From: Pavol Markovic <email@hidden>
- Date: Mon, 20 Mar 2017 20:49:22 +1300
Thanks Greg,
I've submitted the bug report: rdar://31142152
I have to correct myself after double-checking the sys headers, some functions have indeed availability and weak_import attributes expanded through macro __OSX_AVAILABLE_STARTING.
> On 18 Mar 2017, at 10:48, Greg Parker <email@hidden> wrote:
>
> Historically the libc headers have not used availability annotations. You should file a bug report asking that they do so, with a description of your specific use case.
>
>
>> On Mar 17, 2017, at 12:12 PM, Pavol Markovic <email@hidden> wrote:
>>
>> I didn't think about that possibility but it should be doable. Thanks!
>>
>> I still wonder why the function is not declared with weak_import attribute.
>> I have just searched all headers in sys folder and it's not used in any of them.
>> Is there a reason for that (i.e. keeping sys headers free of GNU C extensions)?
>>
>> PM
>>
>>> On 18 Mar 2017, at 04:33, Damien DeVille <email@hidden> wrote:
>>>
>>> Probably not ideal but if you have access to the source that uses `connectx` could you resolve the symbol at runtime on newer OS versions with dlopen/dlsym?
>>>
>>> On Fri, Mar 17, 2017, at 03:23 AM, Pavol Markovic wrote:
>>>> Hello,
>>>> I'm working on a product statically linking (non-system) libcurl and it
>>>> is crashing on OS X 10.8 due to missing _connectx symbol in
>>>> /usr/lib/libSystem.B.dylib
>>>>
>>>> Man page shows that:
>>>> The connectx() function call appeared in Darwin 15.0.0
>>>>
>>>> Why is connectx() function in <sys/socket.h> not marked for weak-linking?
>>>> As I understand it's recommended to use weak-linking when extending
>>>> dynamic library (libsystem-kernel.dylib in this case).
>>>>
>>>> As a result the libcurl cannot use connectx() fast tcp connect on 10.11
>>>> (and later) and at the same time targetting previous systems which do not
>>>> have this function at all.
>>>>
>>>> Any idea how to solve this except of doing preprocessor checks like:
>>>>
>>>> #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
>>>> # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
>>>> # define HAVE_DARWIN_CONNECTX 1
>>>> # endif
>>>> #elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
>>>> # if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 90000)
>>>> # define HAVE_DARWIN_CONNECTX 1
>>>> # endif
>>>> #elif defined(CONNECT_DATA_IDEMPOTENT) /* Fallback for other Darwin OS
>>>> */
>>>> # define HAVE_DARWIN_CONNECTX 1
>>>> #endif
>>>>
>>>> Best regards,
>>>> Pavol Markovic
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Darwin-dev mailing list (email@hidden)
>>>> Help/Unsubscribe/Update your Subscription:
>>>>
>>>> This email sent to email@hidden
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Darwin-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Darwin-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden