pthread_attr_init: default value of inhertished flag

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

pthread_attr_init: default value of inhertished flag

Carmelo Amoroso
Hi,
according to the man pages, the default value for the inheritsched
flag sholud be
PTHREAD_EXPLICIT_SCHED, while a call to pthread_attr_init returns
PTHREAD_INHERIT_SCHED.
This is due to the pthread_attr_init that memset to 0 all the
pthread_attr struct
and the bit ATTR_FLAG_NOTINHERITSCHED is not set in the flags field.

Looking at the POSIX standard, the default value is "unspecified"...
so what is the correct
value defined by glibc/Linux ? is the man page wrong or is it a bug into glibc?

Best regards,
Carmelo
Reply | Threaded
Open this post in threaded view
|

Re: pthread_attr_init: default value of inhertished flag

Jakub Jelinek
On Tue, Jun 19, 2007 at 02:20:44PM +0200, Carmelo Amoroso wrote:

> according to the man pages, the default value for the inheritsched
> flag sholud be
> PTHREAD_EXPLICIT_SCHED, while a call to pthread_attr_init returns
> PTHREAD_INHERIT_SCHED.
> This is due to the pthread_attr_init that memset to 0 all the
> pthread_attr struct
> and the bit ATTR_FLAG_NOTINHERITSCHED is not set in the flags field.
>
> Looking at the POSIX standard, the default value is "unspecified"...
> so what is the correct
> value defined by glibc/Linux ? is the man page wrong or is it a bug into
> glibc?

man page is wrong.

        Jakub