[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pthread_setname_np documentation
From: |
Bruno Haible |
Subject: |
Re: pthread_setname_np documentation |
Date: |
Tue, 03 Sep 2024 22:31:05 +0200 |
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.
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