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

@@ -18,10 +18,12 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Copyright 2018 Joyent, Inc.
  */
 
 #include <assert.h>
 #include <errno.h>
 #include <memory.h>

@@ -1629,10 +1631,12 @@
         struct timespec         new_timeout;
         struct timeval          tp;
         static time_t           prev_refresh = 0, next_refresh = 0;
         ns_server_status_t              changed = 0;
 
+        (void) pthread_setname_np(pthread_self(), "getldap_serverinfo");
+
         if (current_admin.debug_level >= DBG_ALL) {
                 logit("getldap_serverInfo_op()...\n");
         }
         switch (op) {
         case INFO_OP_CREATE:

@@ -2540,10 +2544,12 @@
         int             always = 1, err;
         int             first_time = 1;
         int             sig_done = 0;
         int             dbg_level;
 
+        (void) pthread_setname_np(pthread_self(), "getldap_refresh");
+
         if (current_admin.debug_level >= DBG_ALL) {
                 logit("getldap_refresh()...\n");
         }
 
         /*

@@ -2890,10 +2896,12 @@
 {
         char *addr = (char *)arg, *out = NULL;
         int up;
         rm_svr_t rms;
 
+        (void) pthread_setname_np(pthread_self(), "remove_server");
+
         up = contact_server(addr);
 
         rms.addr = addr;
         rms.up = up;