]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/pthread_setname_np.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / pthread_setname_np.3
index 71eabff92ca8113b355f39007b5198d82a2adbc9..790d040eab450a66cc73429e7a36174e35526259 100644 (file)
@@ -23,7 +23,7 @@
 .\" the source, must acknowledge the copyright and authors of this work.
 .\" %%%LICENSE_END
 .\"
-.TH PTHREAD_SETNAME_NP 3 2015-07-23 "Linux" "Linux Programmer's Manual"
+.TH PTHREAD_SETNAME_NP 3 2019-03-06 "Linux" "Linux Programmer's Manual"
 .SH NAME
 pthread_setname_np, pthread_getname_np \- set/get the name of a thread
 .SH SYNOPSIS
@@ -46,7 +46,7 @@ function can be used to set a unique name for a thread,
 which can be useful for debugging
 multithreaded applications.
 The thread name is a meaningful C language string, whose length is
-restricted to 16 characters, including the terminating null byte (\(aq\\0\(aq).
+restricted to 16 characters, including the terminating null byte (\(aq\e0\(aq).
 The
 .I thread
 argument specifies the thread whose name is to be changed;
@@ -114,7 +114,8 @@ T}  Thread safety   MT-Safe
 .TE
 .sp 1
 .SH CONFORMING TO
-These functions are nonstandard GNU extensions.
+These functions are nonstandard GNU extensions;
+hence the suffix "_np" (nonportable) in the names.
 .SH NOTES
 .BR pthread_setname_np ()
 internally writes to the thread-specific
@@ -125,7 +126,7 @@ filesystem:
 .IR /proc/self/task/[tid]/comm .
 .BR pthread_getname_np ()
 retrieves it from the same location.
-.SH EXAMPLE
+.SH EXAMPLES
 .PP
 The program below demonstrates the use of
 .BR pthread_setname_np ()
@@ -164,8 +165,8 @@ THREADFOO
 
 #define NAMELEN 16
 
-#define errExitEN(en, msg) \\
-            do { errno = en; perror(msg); exit(EXIT_FAILURE); \\
+#define errExitEN(en, msg) \e
+            do { errno = en; perror(msg); exit(EXIT_FAILURE); \e
         } while (0)
 
 static void *
@@ -190,7 +191,7 @@ main(int argc, char **argv)
     if (rc != 0)
         errExitEN(rc, "pthread_getname_np");
 
-    printf("Created a thread. Default name is: %s\\n", thread_name);
+    printf("Created a thread. Default name is: %s\en", thread_name);
     rc = pthread_setname_np(thread, (argc > 1) ? argv[1] : "THREADFOO");
     if (rc != 0)
         errExitEN(rc, "pthread_setname_np");
@@ -201,13 +202,13 @@ main(int argc, char **argv)
                             (argc > 2) ? atoi(argv[1]) : NAMELEN);
     if (rc != 0)
         errExitEN(rc, "pthread_getname_np");
-    printf("The thread name after setting it is %s.\\n", thread_name);
+    printf("The thread name after setting it is %s.\en", thread_name);
 
     rc = pthread_join(thread, NULL);
     if (rc != 0)
         errExitEN(rc, "pthread_join");
 
-    printf("Done\\n");
+    printf("Done\en");
     exit(EXIT_SUCCESS);
 }
 .EE