THR_GETNAME(3C) Standard C Library Functions THR_GETNAME(3C) NNAAMMEE tthhrr__ggeettnnaammee, tthhrr__sseettnnaammee - get or set the name of a thread SSYYNNOOPPSSIISS ##iinncclluuddee <> _i_n_t tthhrr__ggeettnnaammee(_t_h_r_e_a_d___t _t_i_d, _c_h_a_r _*_n_a_m_e, _s_i_z_e___t _l_e_n); _i_n_t tthhrr__sseettnnaammee(_t_h_r_e_a_d___t _t_i_d, _c_o_n_s_t _c_h_a_r _*_n_a_m_e); DDEESSCCRRIIPPTTIIOONN The tthhrr__ggeettnnaammee() and tthhrr__sseettnnaammee() functions, respectively, get and set the names of the thread whose id is given by the _t_i_d parameter. For tthhrr__ggeettnnaammee(), _l_e_n indicates the size of _n_a_m_e. Thread names are limited to THREAD_NAME_MAX including the terminating NUL. They may only contain printable ASCII characters. To clear a thread name, call tthhrr__sseettnnaammee() with NNUULLLL. Unlike some other systems, threads do not inherit the process name by default. RREETTUURRNN VVAALLUUEESS Upon successful completion, the tthhrr__ggeettnnaammee() and tthhrr__sseettnnaammee() functions return 00. Otherwise, an error number is returned to indicate the error. If the thread identified by _t_i_d does not have a name set, _t_h_r___g_e_t_n_a_m_e will be set to an empty string (length = 0). EERRRROORRSS On failure, the contents of the buffer are undefined. Errors from open(2), read(2), or write(2) are possible. In addition, the tthhrr__ggeettnnaammee() function will fail with: EINVAL The _n_a_m_e argument is NNUULLLL. ERANGE The size of _n_a_m_e as given by _l_e_n was not large enough to contain the name of the thread. ESRCH The thread _t_i_d was not found. The tthhrr__sseettnnaammee() function will fail with: ERANGE The length of _n_a_m_e exceeds the maximum allowed size. ESRCH The thread _t_i_d was not found. IINNTTEERRFFAACCEE SSTTAABBIILLIITTYY UUnnccoommmmiitttteedd MMTT--LLEEVVEELL MMTT--SSaaffee SSEEEE AALLSSOO pthread_setname_np(3c), thr_create(3c) illumos August 22, 2018 illumos