git: pthread: Add lwp_setname(2) and implement pthread_set_name_np(3)

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Thu Nov 19 00:39:53 PST 2015


commit 0ca59c3431dcb07cc5de00e279c574459aa3bc34
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Thu Nov 19 11:37:28 2015 +0800

    pthread: Add lwp_setname(2) and implement pthread_set_name_np(3)
    
    - Return thread name through kinfo.
    - Show thread name in ps(1) for 'Hc'.
    - Show thread name in top(1), if it is different from process name.

Summary of changes:
 bin/ps/extern.h                                   |  2 +-
 bin/ps/print.c                                    | 63 +++++++++++++++++++----
 bin/ps/ps.c                                       |  3 +-
 include/unistd.h                                  |  1 +
 lib/libc/sys/Makefile.inc                         |  2 +-
 lib/libc/sys/Symbol.map                           |  3 ++
 lib/libc/sys/{lwp_gettid.2 => lwp_setname.2}      | 56 +++++++++++++-------
 lib/libpthread/pthread_set_name_np.3              |  8 +--
 lib/libthread_xu/thread/thr_info.c                | 23 +++------
 sys/kern/init_sysent.c                            |  1 +
 sys/kern/kern_kinfo.c                             |  2 +
 sys/kern/kern_prot.c                              | 38 ++++++++++++++
 sys/kern/syscalls.c                               |  1 +
 sys/kern/syscalls.master                          |  1 +
 sys/sys/kinfo.h                                   |  2 +
 sys/sys/param.h                                   |  3 +-
 sys/sys/syscall.h                                 |  3 +-
 sys/sys/syscall.mk                                |  3 +-
 sys/sys/sysproto.h                                |  8 +++
 sys/sys/sysunion.h                                |  1 +
 test/{socket/checkfd => pthread/setname}/Makefile |  4 +-
 test/pthread/setname/pthread_setname.c            | 59 +++++++++++++++++++++
 usr.bin/top/m_dragonfly.c                         | 13 ++++-
 23 files changed, 240 insertions(+), 60 deletions(-)
 copy lib/libc/sys/{lwp_gettid.2 => lwp_setname.2} (68%)
 copy test/{socket/checkfd => pthread/setname}/Makefile (62%)
 create mode 100644 test/pthread/setname/pthread_setname.c

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0ca59c3431dcb07cc5de00e279c574459aa3bc34


-- 
DragonFly BSD source repository


More information about the Commits mailing list