From 8be9c34a92bc776d065a7b50661bf7bd5c764567 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Sat, 7 Jan 2023 05:25:00 +0000 Subject: Add {get,set}thrname(2) for putting thread names in the kernel and exposed in a new field returned by sysctl(KERN_PROC). Update pthread_{get,set}_name_np(3) to use the syscalls. Show them, when set, in ps -H and top -H output. libc and libpthread minor bumps ok mpi@, mvs@, deraadt@ --- lib/libc/Symbols.list | 4 ++++ lib/libc/shlib_version | 2 +- lib/libc/sys/Makefile.inc | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list index 833cdf655e9..c5b8794362e 100644 --- a/lib/libc/Symbols.list +++ b/lib/libc/Symbols.list @@ -115,6 +115,7 @@ _thread_sys_getsid _thread_sys_getsockname _thread_sys_getsockopt _thread_sys_getthrid +_thread_sys_getthrname _thread_sys_gettimeofday _thread_sys_getuid _thread_sys_ioctl @@ -206,6 +207,7 @@ _thread_sys_setrlimit _thread_sys_setrtable _thread_sys_setsid _thread_sys_setsockopt +_thread_sys_setthrname _thread_sys_settimeofday _thread_sys_setuid _thread_sys_shmat @@ -314,6 +316,7 @@ getsid getsockname getsockopt getthrid +getthrname gettimeofday getuid ioctl @@ -408,6 +411,7 @@ setrlimit setrtable setsid setsockopt +setthrname settimeofday setuid shmat diff --git a/lib/libc/shlib_version b/lib/libc/shlib_version index 9da1fafdd94..807e5659848 100644 --- a/lib/libc/shlib_version +++ b/lib/libc/shlib_version @@ -1,4 +1,4 @@ major=96 -minor=4 +minor=5 # note: If changes were made to include/thread_private.h or if system calls # were added/changed then librthread/shlib_version must also be updated. diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 6579bc1e58f..2f70b2b9463 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.167 2022/12/19 18:13:50 guenther Exp $ +# $OpenBSD: Makefile.inc,v 1.168 2023/01/07 05:24:58 guenther Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -91,9 +91,10 @@ DASM= ${ASM:.o=.do} # they just never want to set errno. ASM_NOERR=__get_tcb.o __set_tcb.o __threxit.o __thrsleep.o __thrwakeup.o \ getdtablecount.o getegid.o geteuid.o getgid.o getlogin_r.o \ - getpgrp.o getpid.o getppid.o getrtable.o getthrid.o getuid.o \ + getpgrp.o getpid.o getppid.o getrtable.o getthrid.o \ + getthrname.o getuid.o \ issetugid.o \ - sched_yield.o sync.o \ + sched_yield.o setthrname.o sync.o \ umask.o PASM_NOERR= ${ASM_NOERR:.o=.po} SASM_NOERR= ${ASM_NOERR:.o=.so} -- cgit v1.2.3