[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pthread_setname_np documentation
From: |
Eric Gallager |
Subject: |
Re: pthread_setname_np documentation |
Date: |
Wed, 4 Sep 2024 08:05:07 -0400 |
On Tue, Sep 3, 2024 at 4:31 PM Bruno Haible <bruno@clisp.org> wrote:
>
> Hi Eric,
>
> > Hi, I'm writing about gnulib's documentation for pthread_setname_np:
> > https://www.gnu.org/software/gnulib/manual/html_node/pthread_005fsetname_005fnp.html
> > It mentions NetBSD 10.0 as a platform where the function has a
> > different signature, however, I recently discovered that there is
> > another platform where this is true: on my version of macOS, the
> > function exists, and takes just 1 argument: a string for the name of
> > the thread. Here's the contents of my system's manpage for it:
> >
> > PTHREAD_SETNAME_NP(3)
> > Library Functions Manual
> >
> > PTHREAD_SETNAME_NP(3)
> >
> > NAME
> > pthread_setname_np -- set the thread name
> >
> > SYNOPSIS
> > #include <pthread.h>
> >
> > void
> > pthread_setname_np(const char *name);
>
> Thanks. I'm applying the doc fix below.
>
> > I notice that the gnulib documentation page says that Mac OS X 10.5
> > didn't have this function, so I'm guessing it must have been
> > introduced in 10.6? I'm not quite sure where to find the history of
> > it, though...
>
> The data that we use [1] shows that this function was absent in
> Mac OS X 10.5 and present in Mac OS X 10.13. It would be possible
> to track it down more precisely through [2], but that's not worth
> the investigation since Mac OS X 10.13 is already a couple of years old.
One thing I'd note here would be to review the odd way macOS version
numbers (fail to) align these days; I'm still on Big Sur, which has
the function, and is macOS 11, although it would have been macOS 10.16
under the old versioning scheme. So, make sure you're not getting
10.13 mixed up with macOS 13, or 10.14 mixed up with macOS 14. Also,
I've received some additional confirmation from someone on a chat
server I'm in that the function was originally added in 10.6, which
fits with what I was assuming, since the code that inspired me to file
this comes from the Snow Leopard days, anyways.
>
> Bruno
>
> [1]
> https://git.savannah.gnu.org/gitweb/?p=gnulib/maint-tools.git;a=tree;f=platforms/various-symlists
> [2] https://github.com/apple-oss-distributions/distribution-macOS
>
>
> 2024-09-03 Bruno Haible <bruno@clisp.org>
>
> doc: More details about pthread_setname_np.
> Reported by Eric Gallager <egall@gwmail.gwu.edu> in
> <https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00017.html>.
> * doc/glibc-functions/pthread_setname_np.texi: Mention the different
> signature on macOS.
>
> diff --git a/doc/glibc-functions/pthread_setname_np.texi
> b/doc/glibc-functions/pthread_setname_np.texi
> index 965a026660..4b1dcdb737 100644
> --- a/doc/glibc-functions/pthread_setname_np.texi
> +++ b/doc/glibc-functions/pthread_setname_np.texi
> @@ -17,7 +17,8 @@
> glibc 2.11, Mac OS X 10.5, FreeBSD 12.0, OpenBSD 7.5, Minix 3.1.8, AIX 7.1,
> HP-UX 11.31, Solaris 11.0, Cygwin 1.7.x, mingw, MSVC 14.
> @item
> This function has a different signature on some platforms:
> -NetBSD 10.0.
> +macOS 14, NetBSD 10.0.
> +On macOS the function takes only one argument, the name.
> On NetBSD the second argument is interpreted as a @code{printf} format
> string,
> with the third argument as parameter.
> @end itemize
>
>
>