c functions pthread_mutex_lock / pthread_setspecific are implemented in RHEL8.1?

Latest response

I want to know if these c functions are implemented in RHEL8.1 or not.
- pthread_mutex_lock
- pthread_setspecific

If implemented, where can I find manuals for them?
manpage says as follows;

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementa‐
tion of this interface may differ (consult the corresponding Linux manual page for
details of Linux behavior), or the interface may not be implemented on Linux.

Responses

The glibc-devel package supplies documentation as info files, and the latest documentation is also upstream at https://www.gnu.org/software/libc/manual/html_node/index.html#toc-Threads-1

info pthread_mutex_lock redirects to the 3P manpage, so I would assume the Linux implementation is the POSIX implementation.

info pthread_setspecific has a small section which is replicated upstream.

If you have more specific queries about the GNU C Library operation, you could read the source:

$ rpm -q glibc-headers
glibc-headers-2.28-101.el8.x86_64

$ egrep pthread_setspecific /usr/include/pthread.h
extern int pthread_setspecific (pthread_key_t __key,

$ egrep pthread_mutex_lock /usr/include/pthread.h
extern int pthread_mutex_lock (pthread_mutex_t *__mutex)

Thank you Jamie

manpage says
"
The Linux implementa‐ tion of this interface may differ (consult the corresponding Linux manual page for <<< (1)
details of Linux behavior), or the interface may not be implemented on Linux. <<< (2)
"
about (2)
I confirmed glibc-2.28-72.el8.s390x.rpm contains codes of these functions.
about (1)
RH or Linux don't provide documentation showing the "linux behavior"?
libc manual page does not show linux specific bahavior. Only way is to read code?

thank you,
Tadatoshi

Yes, that looks to be correct.

Thank you Jamie

Hi Jamie,

Questions about pthread manpage again.
It seems RH haven't changed the code to implement the functions pthread_setspecific and pthread_create.
Why RH left manpage describes as follows? If not changed it will be better removed?
"
The Linux implementa‐
tion of this interface may differ (consult the corresponding Linux manual page for
details of Linux behavior), or the interface may not be implemented on Linux.
"
Maybe because RH did not change code therefore not changed manpage, and this code is from upstream?
I checked SUSE also the same. If upstream is the same it is not by RH?
In pthread_create function manpage, manual title is changed to "Linux Programmer's Manual " and above is removed.

thank you in advance...

How to find and check upstream codes for pthread?

The upstream libc source is at: https://www.gnu.org/software/libc/sources.html

Thank you Jamie

Hello here again. it seems pthread_mutexattr_setpshared function is implemented to RHEL8.1 s390x but i can't find manpage for linux

rpm2cpio glibc-2.28-72.el8.s390x.rpm |cpio -it

/tmp/lib64 # nm libpthread-2.28.so | grep pthread_mutexattr_setpshared 000000000000c7f8 t .annobin_pthread_mutexattr_setpshared.c 000000000000c828 t .annobin_pthread_mutexattr_setpshared.c_end 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c_end.exit 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c_end.hot 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c_end.startup 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c_end.unlikely 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c.exit 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c.hot 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c.startup 0000000000006798 t .annobin_pthread_mutexattr_setpshared.c.unlikely 000000000000c828 t .annobin_pthread_mutexattr_setpshared.end 000000000000c7f8 t .annobin_pthread_mutexattr_setpshared.start 000000000000c7f8 T pthread_mutexattr_setpshared

The manual is provided in the man-pages package.

Thank you Jamie, I could find it in man page rpm. :)

Linux manpage for pthread_mutexattr_setpshared is not provided, but looking into section 3p it says refer getpshared manpage.

man ./usr/share/man/man3p/pthread_mutexattr_setpshared.3p.gz

PTHREAD_MUTEXATTR_SETPSHARED(3P) POSIX Programmer's Manual PTHREAD_MUTEXATTR_SETPSHARED(3P) : DESCRIPTION Refer to pthread_mutexattr_getpshared().

I could find description for set in get manpage.

man ./usr/share/man/man3/pthread_mutexattr_getpshared.3.gz

PTHREAD_MUTEXATTR_GETPSHARED(3) Linux Programmer's Manual PTHREAD_MUTEXATTR_GETPSHARED(3)

NAME pthread_mutexattr_getpshared, pthread_mutexattr_setpshared - get/set process-shared mutex attribute

Thank you

Glad to help :)