On Sun, May 05, 2024 at 07:49:55AM +0200, ???? ??????? wrote: > ??, 5 ??? 2024 ?. ? 02:05, Miroslav Zagorac <z...@fly-etf.net>: > > > On 04. 05. 2024. 17:36, Ilya Shipitsin wrote: > > > this function is considered optional for POSIX and not implemented > > > on Illumos > > > > > > Reference: > > https://www.gnu.org/software/gnulib/manual/html_node/pthread_005fgetcpuclockid.html > > > According to > > https://github.com/cpredef/predef/blob/master/OperatingSystems.md Illumos > > > is identified by __illumos__ macro available since gcc-11 > > > --- > > > src/clock.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/src/clock.c b/src/clock.c > > > index ec2133c8b..f484c2d9c 100644 > > > --- a/src/clock.c > > > +++ b/src/clock.c > > > @@ -135,7 +135,7 @@ uint64_t now_cpu_time_thread(int thr) > > > /* set the clock source for the local thread */ > > > void clock_set_local_source(void) > > > { > > > -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) && > > defined(_POSIX_THREAD_CPUTIME) > > > +#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) && > > defined(_POSIX_THREAD_CPUTIME) && !defined(__illumos__) > > > #ifdef USE_THREAD > > > pthread_getcpuclockid(pthread_self(), &per_thread_clock_id[tid]); > > > #else > > > > Hello Ilya, > > > > 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 :-/ Just guessing, are you sure you're building with -pthread -lrt ? Just in case, please double-check with V=1. Solaris sets USE_RT, but maybe something else is needed. Willy