Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section

@@ -19,11 +19,11 @@
  * CDDL HEADER END
  */
 
 /*
  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
- * Copyright 2016 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
  *
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 

@@ -137,10 +137,13 @@
 #define PTHREAD_ONCE_KEY_NP     (pthread_key_t)(-1)
 
 /* barriers */
 #define PTHREAD_BARRIER_SERIAL_THREAD   -2
 
+/* For pthread_{get,set}name_np(). */
+#define PTHREAD_MAX_NAMELEN_NP (32)
+
 #ifndef _ASM
 
 /*
  * cancellation cleanup structure
  */

@@ -207,10 +210,14 @@
         int *_RESTRICT_KYWD);
 extern int pthread_attr_setschedparam(pthread_attr_t *_RESTRICT_KYWD,
                 const struct sched_param *_RESTRICT_KYWD);
 extern int pthread_attr_getschedparam(const pthread_attr_t *_RESTRICT_KYWD,
                 struct sched_param *_RESTRICT_KYWD);
+extern int pthread_attr_setname_np(pthread_attr_t *_RESTRICT_KYWD,
+    const char *_RESTRICT_KYWD);
+extern int pthread_attr_getname_np(pthread_attr_t *_RESTRICT_KYWD,
+    char *_RESTRICT_KYWD, size_t);
 extern int pthread_create(pthread_t *_RESTRICT_KYWD,
                 const pthread_attr_t *_RESTRICT_KYWD, void * (*)(void *),
                 void *_RESTRICT_KYWD);
 extern int pthread_once(pthread_once_t *, void (*)(void));
 extern int pthread_join(pthread_t, void **);

@@ -229,10 +236,12 @@
 extern int pthread_key_create_once_np(pthread_key_t *, void (*)(void *));
 extern int pthread_key_delete(pthread_key_t);
 extern int pthread_setspecific(pthread_key_t, const void *);
 extern void *pthread_getspecific(pthread_key_t);
 extern pthread_t pthread_self(void);
+extern int pthread_setname_np(pthread_t, const char *);
+extern int pthread_getname_np(pthread_t, char *, size_t);
 
 /*
  * function prototypes - synchronization related calls
  */
 extern int pthread_mutexattr_init(pthread_mutexattr_t *);