Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-06 Thread Willy Tarreau
On Sun, May 05, 2024 at 01:43:33PM +0200,  ??? wrote:
> updated patches.

Cool, thanks, now applied.

> I'll address reorg to "compat.h" a bit later, once it is settled in my head

No worries, I've seen your other comment about the need to include
pthread.h, and this alone would be a good reason for leaving the test
where it is for now.

Willy



Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Илья Шипицин
updated patches.

I'll address reorg to "compat.h" a bit later, once it is settled in my head

вс, 5 мая 2024 г. в 12:48, Илья Шипицин :

> I will test and send simplified patch, i.e. I'll patch directly clock.c
>
> if we want to move that macro to compat.h, I'd postpone that for some
> investigation
>
> 1) we will need to include "pthread.h" from compat.h (currently it's not
> true)
> 2) we will need to make sure compat.h is included everywhere (I do not see
> that include in clock.c)
>
> вс, 5 мая 2024 г. в 12:24, Willy Tarreau :
>
>> On Sun, May 05, 2024 at 11:15:24AM +0200,  ??? wrote:
>> > ??, 5 ??? 2024 ?. ? 10:42, Willy Tarreau :
>> >
>> > > On Sun, May 05, 2024 at 09:12:41AM +0200, Miroslav Zagorac wrote:
>> > > > 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 :
>> > > > >>> 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 
>> > > > >> 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.
>> > > (...)
>> > >
>> > > Ah excellent, that's quite useful! We're already doing that with
>> > > _POSIX_TIMERS. So I guess one just needs to try this instead:
>> > >
>> > > -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
>> > > defined(_POSIX_THREAD_CPUTIME
>> > > +#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
>> > > defined(_POSIX_THREAD_CPUTIME && (_POSIX_THREAD_CPUTIME >= 0)
>> > >
>> >
>> > that worked (I added closing bracket after second "defined")
>>
>> Ah yes indeed. Thanks for the test. Do you want to update you patch maybe,
>> since you can test it ?
>>
>> Thanks,
>> Willy
>>
>
From 3cc9c51ae6b22beeaaee89d1e5f69b99c6874f39 Mon Sep 17 00:00:00 2001
From: Ilia Shipitsin 
Date: Sun, 5 May 2024 13:41:32 +0200
Subject: [PATCH 3/3] CI: netbsd: limit scheduled workflow to parent repo only

it is not very useful for most of forks.
---
 .github/workflows/netbsd.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/netbsd.yml b/.github/workflows/netbsd.yml
index ea0345954..6514725e1 100644
--- a/.github/workflows/netbsd.yml
+++ b/.github/workflows/netbsd.yml
@@ -7,6 +7,7 @@ on:
 jobs:
   gcc:
 runs-on: ubuntu-latest
+if: ${{ github.repository_owner == 'haproxy' }}
 permissions:
   contents: read
 steps:
-- 
2.43.0.windows.1

From 3c6b1a9dadfcefad4d94a1ee3a288a2e36865a52 Mon Sep 17 00:00:00 2001
From: Ilia Shipitsin 
Date: Sun, 5 May 2024 13:39:33 +0200
Subject: [PATCH 2/3] CI: add Illumos scheduled workflow

this is very initial build only implementation.
---
 .github/workflows/illumos.yml | 24 
 1 file changed, 24 insertions(+)
 create mode 100644 .github/workflows/illumos.yml

diff --git a/.github/workflows/illumos.yml b/.github/workflows/illumos.yml
new file mode 100644
index 0..b0b5e4852
--- /dev/null
+++ b/.github/workflows/illumos.yml
@@ -0,0 +1,24 @@
+name: Illumos
+
+on:
+  schedule:
+- cron: "0 0 25 * *"
+
+jobs:
+  gcc:
+runs-on: ubuntu-latest
+if: ${{ github.repository_owner == 'haproxy' }}
+permissions:
+  contents: read
+steps:
+  - name: "Checkout repository"
+uses: actions/checkout@v4
+
+  - 

Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Илья Шипицин
I will test and send simplified patch, i.e. I'll patch directly clock.c

if we want to move that macro to compat.h, I'd postpone that for some
investigation

1) we will need to include "pthread.h" from compat.h (currently it's not
true)
2) we will need to make sure compat.h is included everywhere (I do not see
that include in clock.c)

вс, 5 мая 2024 г. в 12:24, Willy Tarreau :

> On Sun, May 05, 2024 at 11:15:24AM +0200,  ??? wrote:
> > ??, 5 ??? 2024 ?. ? 10:42, Willy Tarreau :
> >
> > > On Sun, May 05, 2024 at 09:12:41AM +0200, Miroslav Zagorac wrote:
> > > > 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 :
> > > > >>> 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 
> > > > >> 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.
> > > (...)
> > >
> > > Ah excellent, that's quite useful! We're already doing that with
> > > _POSIX_TIMERS. So I guess one just needs to try this instead:
> > >
> > > -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
> > > defined(_POSIX_THREAD_CPUTIME
> > > +#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
> > > defined(_POSIX_THREAD_CPUTIME && (_POSIX_THREAD_CPUTIME >= 0)
> > >
> >
> > that worked (I added closing bracket after second "defined")
>
> Ah yes indeed. Thanks for the test. Do you want to update you patch maybe,
> since you can test it ?
>
> Thanks,
> Willy
>


Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Willy Tarreau
On Sun, May 05, 2024 at 11:15:24AM +0200,  ??? wrote:
> ??, 5 ??? 2024 ?. ? 10:42, Willy Tarreau :
> 
> > On Sun, May 05, 2024 at 09:12:41AM +0200, Miroslav Zagorac wrote:
> > > 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 :
> > > >>> 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 
> > > >> 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.
> > (...)
> >
> > Ah excellent, that's quite useful! We're already doing that with
> > _POSIX_TIMERS. So I guess one just needs to try this instead:
> >
> > -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
> > defined(_POSIX_THREAD_CPUTIME
> > +#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
> > defined(_POSIX_THREAD_CPUTIME && (_POSIX_THREAD_CPUTIME >= 0)
> >
> 
> that worked (I added closing bracket after second "defined")

Ah yes indeed. Thanks for the test. Do you want to update you patch maybe,
since you can test it ?

Thanks,
Willy



Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Илья Шипицин
вс, 5 мая 2024 г. в 10:42, Willy Tarreau :

> On Sun, May 05, 2024 at 09:12:41AM +0200, Miroslav Zagorac wrote:
> > 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 :
> > >>> 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 
> > >> 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.
> (...)
>
> Ah excellent, that's quite useful! We're already doing that with
> _POSIX_TIMERS. So I guess one just needs to try this instead:
>
> -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
> defined(_POSIX_THREAD_CPUTIME
> +#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) &&
> defined(_POSIX_THREAD_CPUTIME && (_POSIX_THREAD_CPUTIME >= 0)
>

that worked (I added closing bracket after second "defined")


>
> Please note that it appears at a few places, so we'll probably have to
> move that painful definition in compat.h I think.
>


that makes sense


>
> Willy
>


Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Willy Tarreau
On Sun, May 05, 2024 at 09:12:41AM +0200, Miroslav Zagorac wrote:
> 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 :
> >>> 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 
> >> 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.
(...)

Ah excellent, that's quite useful! We're already doing that with
_POSIX_TIMERS. So I guess one just needs to try this instead:

-#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) && 
defined(_POSIX_THREAD_CPUTIME
+#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) && 
defined(_POSIX_THREAD_CPUTIME && (_POSIX_THREAD_CPUTIME >= 0)

Please note that it appears at a few places, so we'll probably have to
move that painful definition in compat.h I think.

Willy



Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Willy Tarreau
On Sun, May 05, 2024 at 08:52:08AM +0200,  ??? wrote:
> > 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.
> >
> 
> I did "find / -name pthread.h -exec cat {} ';' -print"
> and there was not declaration of pthread_getcpuclockid()
> 
> chances are that it is shipped in a lib, but the prototype is missing ...

Ah I had the impression based on your error output that the definition
was there and it was only the lib that was missing. Maybe I misread
but it looked like a link error.

Willy



Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Miroslav Zagorac
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 :
>>> 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 
>> 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?



Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Илья Шипицин
вс, 5 мая 2024 г. в 08:32, Willy Tarreau :

> On Sun, May 05, 2024 at 07:49:55AM +0200,  ??? wrote:
> > ??, 5 ??? 2024 ?. ? 02:05, Miroslav Zagorac :
> >
> > > 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(),
> _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 
> > 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.
>

I did "find / -name pthread.h -exec cat {} ';' -print"
and there was not declaration of pthread_getcpuclockid()

chances are that it is shipped in a lib, but the prototype is missing ...


>
> Willy
>


Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-05 Thread Willy Tarreau
On Sun, May 05, 2024 at 07:49:55AM +0200,  ??? wrote:
> ??, 5 ??? 2024 ?. ? 02:05, Miroslav Zagorac :
> 
> > 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(), _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 
> 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



Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-04 Thread Илья Шипицин
вс, 5 мая 2024 г. в 02:05, Miroslav Zagorac :

> 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(), _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 
it does not have pthread_getcpuclockid()



>
> Maybe it could be solved in a different way..
>
>
> Best regards,
>
> --
> Miroslav Zagorac
>
> What can change the nature of a man?
>


Re: [PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-04 Thread Miroslav Zagorac
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(), _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.

Maybe it could be solved in a different way..


Best regards,

-- 
Miroslav Zagorac

What can change the nature of a man?



[PATCH 1/3] BUILD: illumos: pthread_getcpuclockid is not available

2024-05-04 Thread Ilya Shipitsin
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(), _thread_clock_id[tid]);
 #else
-- 
2.45.0