On 05. 05. 2024. 08:32, Willy Tarreau wrote:
> On Sun, May 05, 2024 at 07:49:55AM +0200, ???? ??????? wrote:
>> ??, 5 ??? 2024 ?. ? 02:05, Miroslav Zagorac <z...@fly-etf.net>:
>>> I think that this patch is not satisfactory because, for example, Solaris
>>> 11.4.0.0.1.15.0 (from 2018) has _POSIX_TIMERS and _POSIX_THREAD_CPUTIME
>>> defined, but does not have the pthread_getcpuclockid() function; while
>>> solaris
>>> 11.4.42.0.0.111.0 (from 2022) has that function.
>>>
>>
>> I'm trying to build on this vmactions/solaris-vm: Use Solaris in github
>> actions <https://github.com/vmactions/solaris-vm>
>> it does not have pthread_getcpuclockid()
> 
> I'm wondering what the point of defining _POSIX_THREAD_CPUTIME can be
> then :-/
> 

The pthread_getcpuclockid() function is declared in the include file
/usr/include/pthread.h.  The only difference between the two "versions" of
Solaris 11.4 is that the newer version has a declaration and the older one
does not.

However, _POSIX_THREAD_CPUTIME is defined in the /usr/include/unistd.h file as
-1 in the UNIX 03 block of options that are not supported in Solaris 11.4.

/* Unsupported UNIX 03 options */
#if defined(_XPG6)
..
#define _POSIX_THREAD_CPUTIME (-1)
..
#endif


An explanation of that definition can be found here:

https://docs.oracle.com/cd/E88353_01/html/E37842/unistd-3head.html

"If a symbolic constant is defined with the value -1, the option is not
supported. Headers, data types, and function interfaces required only for the
option need not be supplied. An application that attempts to use anything
associated only with the option is considered to be requiring an extension.

If a symbolic constant is defined with a value greater than zero, the option
is always supported when the application is executed. All headers, data types,
and functions are present and operate as specified.

If a symbolic constant is defined with the value zero, all headers, data
types, and functions are present. The application can check at runtime to see
whether the option is supported by calling fpathconf(), pathconf(), or
sysconf() with the indicated name parameter."

-- 
Miroslav Zagorac

What can change the nature of a man?

Reply via email to