summaryrefslogtreecommitdiff
path: root/usr/src/man
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man')
-rw-r--r--usr/src/man/man1/ps.139
-rw-r--r--usr/src/man/man1m/prstat.1m8
-rw-r--r--usr/src/man/man3c/Makefile12
-rw-r--r--usr/src/man/man3c/pthread_attr_getname_np.3c105
-rw-r--r--usr/src/man/man3c/pthread_getname_np.3c124
-rw-r--r--usr/src/man/man3c/thr_getname.3c124
-rw-r--r--usr/src/man/man3lib/libproc.3lib60
-rw-r--r--usr/src/man/man3proc/Makefile15
-rw-r--r--usr/src/man/man3proc/Paddr_to_ctf.3proc3
-rw-r--r--usr/src/man/man3proc/Paddr_to_loadobj.3proc3
-rw-r--r--usr/src/man/man3proc/Paddr_to_map.3proc3
-rw-r--r--usr/src/man/man3proc/Pasfd.3proc3
-rw-r--r--usr/src/man/man3proc/Pclearfault.3proc3
-rw-r--r--usr/src/man/man3proc/Pclearsig.3proc3
-rw-r--r--usr/src/man/man3proc/Pcontent.3proc3
-rw-r--r--usr/src/man/man3proc/Pcreate.3proc3
-rw-r--r--usr/src/man/man3proc/Pcreate_agent.3proc3
-rw-r--r--usr/src/man/man3proc/Pcreate_error.3proc3
-rw-r--r--usr/src/man/man3proc/Pcred.3proc3
-rw-r--r--usr/src/man/man3proc/Pctlfd.3proc3
-rw-r--r--usr/src/man/man3proc/Pdelbkpt.3proc3
-rw-r--r--usr/src/man/man3proc/Pdelwapt.3proc3
-rw-r--r--usr/src/man/man3proc/Pdestroy_agent.3proc3
-rw-r--r--usr/src/man/man3proc/Penv_iter.3proc3
-rw-r--r--usr/src/man/man3proc/Pexecname.3proc3
-rw-r--r--usr/src/man/man3proc/Pfault.3proc3
-rw-r--r--usr/src/man/man3proc/Pfdinfo_iter.3proc3
-rw-r--r--usr/src/man/man3proc/Pgetareg.3proc3
-rw-r--r--usr/src/man/man3proc/Pgetauxval.3proc3
-rw-r--r--usr/src/man/man3proc/Pgetauxvec.3proc3
-rw-r--r--usr/src/man/man3proc/Pgetenv.3proc3
-rw-r--r--usr/src/man/man3proc/Pgrab.3proc3
-rw-r--r--usr/src/man/man3proc/Pgrab_core.3proc3
-rw-r--r--usr/src/man/man3proc/Pgrab_error.3proc3
-rw-r--r--usr/src/man/man3proc/Pgrab_file.3proc3
-rw-r--r--usr/src/man/man3proc/Pisprocdir.3proc3
-rw-r--r--usr/src/man/man3proc/Pissyscall.3proc3
-rw-r--r--usr/src/man/man3proc/Pldt.3proc3
-rw-r--r--usr/src/man/man3proc/Plmid.3proc3
-rw-r--r--usr/src/man/man3proc/Plookup_by_addr.3proc3
-rw-r--r--usr/src/man/man3proc/Plwp_getasrs.3proc3
-rw-r--r--usr/src/man/man3proc/Plwp_getname.3proc95
-rw-r--r--usr/src/man/man3proc/Plwp_getpsinfo.3proc3
-rw-r--r--usr/src/man/man3proc/Plwp_getregs.3proc3
-rw-r--r--usr/src/man/man3proc/Plwp_getspymaster.3proc3
-rw-r--r--usr/src/man/man3proc/Plwp_getxregs.3proc3
-rw-r--r--usr/src/man/man3proc/Plwp_iter.3proc3
-rw-r--r--usr/src/man/man3proc/Plwp_stack.3proc3
-rw-r--r--usr/src/man/man3proc/Pmapping_iter.3proc3
-rw-r--r--usr/src/man/man3proc/Pobjname.3proc3
-rw-r--r--usr/src/man/man3proc/Pplatform.3proc3
-rw-r--r--usr/src/man/man3proc/Ppltdest.3proc3
-rw-r--r--usr/src/man/man3proc/Ppriv.3proc3
-rw-r--r--usr/src/man/man3proc/Ppsinfo.3proc3
-rw-r--r--usr/src/man/man3proc/Prd_agent.3proc3
-rw-r--r--usr/src/man/man3proc/Pread.3proc3
-rw-r--r--usr/src/man/man3proc/Prelease.3proc3
-rw-r--r--usr/src/man/man3proc/Preopen.3proc3
-rw-r--r--usr/src/man/man3proc/Preset_maps.3proc3
-rw-r--r--usr/src/man/man3proc/Psecflags.3proc3
-rw-r--r--usr/src/man/man3proc/Psetbkpt.3proc3
-rw-r--r--usr/src/man/man3proc/Psetcred.3proc3
-rw-r--r--usr/src/man/man3proc/Psetfault.3proc3
-rw-r--r--usr/src/man/man3proc/Psetflags.3proc3
-rw-r--r--usr/src/man/man3proc/Psetpriv.3proc3
-rw-r--r--usr/src/man/man3proc/Psetrun.3proc3
-rw-r--r--usr/src/man/man3proc/Psetsignal.3proc3
-rw-r--r--usr/src/man/man3proc/Psetsysentry.3proc3
-rw-r--r--usr/src/man/man3proc/Psetwapt.3proc3
-rw-r--r--usr/src/man/man3proc/Psetzoneid.3proc3
-rw-r--r--usr/src/man/man3proc/Psignal.3proc3
-rw-r--r--usr/src/man/man3proc/Pstack_iter.3proc3
-rw-r--r--usr/src/man/man3proc/Pstate.3proc3
-rw-r--r--usr/src/man/man3proc/Pstatus.3proc3
-rw-r--r--usr/src/man/man3proc/Pstopstatus.3proc3
-rw-r--r--usr/src/man/man3proc/Psymbol_iter.3proc3
-rw-r--r--usr/src/man/man3proc/Psync.3proc3
-rw-r--r--usr/src/man/man3proc/Psysentry.3proc3
-rw-r--r--usr/src/man/man3proc/Puname.3proc3
-rw-r--r--usr/src/man/man3proc/Pupdate_maps.3proc3
-rw-r--r--usr/src/man/man3proc/Pupdate_syms.3proc3
-rw-r--r--usr/src/man/man3proc/Pwrite.3proc3
-rw-r--r--usr/src/man/man3proc/Pzonename.3proc3
-rw-r--r--usr/src/man/man4/proc.414
84 files changed, 687 insertions, 131 deletions
diff --git a/usr/src/man/man1/ps.1 b/usr/src/man/man1/ps.1
index f0f01d4c54..3c838729fd 100644
--- a/usr/src/man/man1/ps.1
+++ b/usr/src/man/man1/ps.1
@@ -44,9 +44,9 @@
.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright (c) 2013 Gary Mills
-.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright (c) 2018, Joyent, Inc.
.\"
-.TH PS 1 "Jun 13, 2017"
+.TH PS 1 "August 22, 2018"
.SH NAME
ps \- report process status
.SH SYNOPSIS
@@ -882,14 +882,14 @@ is a version of the argument list as it was passed to the command when it
started, or is a version of the arguments as they might have been modified by
the application. Applications cannot depend on being able to modify their
argument list and having that modification be reflected in the output of
-\fBps\fR. The Solaris implementation limits the string to 80 bytes; the string
+\fBps\fR. The illumos implementation limits the string to 80 bytes; the string
is the version of the argument list as it was passed to the command when it
started.
.RE
.sp
.LP
-The following names are recognized in the Solaris implementation:
+The following names are recognized in the illumos implementation:
.sp
.ne 2
.na
@@ -1049,6 +1049,16 @@ one line to be printed for each lwp in the process.
.sp
.ne 2
.na
+\fB\fBlwpname\fR\fR
+.ad
+.RS 11n
+The name of the lwp, if set. Requesting this formatting option causes
+one line to be printed for each lwp in the process.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBnlwp\fR\fR
.ad
.RS 11n
@@ -1173,8 +1183,8 @@ The data model of the process, printed in the same manner as via
.sp
.LP
-Only \fBcomm\fR and \fBargs\fR are allowed to contain blank characters; all
-others, including the Solaris implementation variables, are not.
+Only \fBcomm\fR, \fBlwpname\fR, and \fBargs\fR are allowed to contain blank
+characters; all others, including the illumos implementation variables, are not.
.sp
.LP
The following table specifies the default header to be used in the POSIX locale
@@ -1196,12 +1206,12 @@ group GROUP time TIME
nice NI tty TT
pcpu %CPU user USER
pgid PGID vsz VSZ
-pid PID
+pid PID
.TE
.sp
.LP
-The following table lists the Solaris implementation format specifiers and the
+The following table lists the illumos implementation format specifiers and the
default header used with each.
.sp
@@ -1221,12 +1231,13 @@ fname COMMAND rss RSS
gid GID ruid RUID
lgrp LGRP s S
lwp LWP sid SID
-nlwp NLWP stime STIME
-opri PRI taskid TASKID
-osz SZ uid UID
-pmem %MEM wchan WCHAN
-pri PRI zone ZONE
-ctid CTID zoneid ZONEID
+lwpname LWPNAME stime STIME
+nlwp NLWP taskid TASKID
+opri PRI uid UID
+osz SZ wchan WCHAN
+pmem %MEM zone ZONE
+pri PRI zoneid ZONEID
+ctid CTID
.TE
.SH EXAMPLES
diff --git a/usr/src/man/man1m/prstat.1m b/usr/src/man/man1m/prstat.1m
index a5f02621cf..d181c9a55f 100644
--- a/usr/src/man/man1m/prstat.1m
+++ b/usr/src/man/man1m/prstat.1m
@@ -1,10 +1,11 @@
'\" te
.\" Copyright (c) 2013 Gary Mills
.\" Copyright (c) 2006, 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2018, Joyent, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PRSTAT 1M "Nov 14, 2014"
+.TH PRSTAT 1M "September 1, 2018"
.SH NAME
prstat \- report active process statistics
.SH SYNOPSIS
@@ -580,11 +581,12 @@ The name of the process (name of executed file).
.sp
.ne 2
.na
-\fBLWPID\fR
+\fBLWP\fR
.ad
.sp .6
.RS 4n
-The \fBlwp\fR \fBID\fR of the \fBlwp\fR being reported.
+The \fBlwp\fR \fBID\fR of the \fBlwp\fR being reported, as well as the LWP
+name if any is set.
.RE
.sp
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile
index 2c890a7f47..9d1c679e65 100644
--- a/usr/src/man/man3c/Makefile
+++ b/usr/src/man/man3c/Makefile
@@ -307,6 +307,7 @@ MANFILES= __fbufsize.3c \
pthread_attr_getdetachstate.3c \
pthread_attr_getguardsize.3c \
pthread_attr_getinheritsched.3c \
+ pthread_attr_getname_np.3c \
pthread_attr_getschedparam.3c \
pthread_attr_getschedpolicy.3c \
pthread_attr_getscope.3c \
@@ -332,6 +333,7 @@ MANFILES= __fbufsize.3c \
pthread_equal.3c \
pthread_exit.3c \
pthread_getconcurrency.3c \
+ pthread_getname_np.3c \
pthread_getschedparam.3c \
pthread_getspecific.3c \
pthread_join.3c \
@@ -475,6 +477,7 @@ MANFILES= __fbufsize.3c \
termios.3c \
thr_create.3c \
thr_exit.3c \
+ thr_getname.3c \
thr_getconcurrency.3c \
thr_getprio.3c \
thr_join.3c \
@@ -1092,6 +1095,7 @@ MANLINKS= FD_CLR.3c \
pthread_attr_setdetachstate.3c \
pthread_attr_setguardsize.3c \
pthread_attr_setinheritsched.3c \
+ pthread_attr_setname_np.3c \
pthread_attr_setschedparam.3c \
pthread_attr_setschedpolicy.3c \
pthread_attr_setscope.3c \
@@ -1128,6 +1132,7 @@ MANLINKS= FD_CLR.3c \
pthread_rwlockattr_destroy.3c \
pthread_rwlockattr_setpshared.3c \
pthread_setconcurrency.3c \
+ pthread_setname_np.3c \
pthread_setschedparam.3c \
pthread_setspecific.3c \
pthread_spin_init.3c \
@@ -1291,6 +1296,7 @@ MANLINKS= FD_CLR.3c \
thr_continue.3c \
thr_getspecific.3c \
thr_keycreate_once.3c \
+ thr_setname.3c \
thr_setconcurrency.3c \
thr_setprio.3c \
thr_setspecific.3c \
@@ -2140,6 +2146,8 @@ pthread_attr_setguardsize.3c := LINKSRC = pthread_attr_getguardsize.3c
pthread_attr_setinheritsched.3c := LINKSRC = pthread_attr_getinheritsched.3c
+pthread_attr_setname_np.3c := LINKSRC = pthread_attr_getname_np.3c
+
pthread_attr_setschedparam.3c := LINKSRC = pthread_attr_getschedparam.3c
pthread_attr_setschedpolicy.3c := LINKSRC = pthread_attr_getschedpolicy.3c
@@ -2174,6 +2182,8 @@ pthread_condattr_destroy.3c := LINKSRC = pthread_condattr_init.3c
pthread_setconcurrency.3c := LINKSRC = pthread_getconcurrency.3c
+pthread_setname_np.3c := LINKSRC = pthread_getname_np.3c
+
pthread_setschedparam.3c := LINKSRC = pthread_getschedparam.3c
pthread_setspecific.3c := LINKSRC = pthread_getspecific.3c
@@ -2408,6 +2418,8 @@ thr_setspecific.3c := LINKSRC = thr_keycreate.3c
thr_continue.3c := LINKSRC = thr_suspend.3c
+thr_setname.3c := LINKSRC = thr_getname.3c
+
timegm.3c := LINKSRC = mktime.3c
timer_getoverrun.3c := LINKSRC = timer_settime.3c
diff --git a/usr/src/man/man3c/pthread_attr_getname_np.3c b/usr/src/man/man3c/pthread_attr_getname_np.3c
new file mode 100644
index 0000000000..fbac370410
--- /dev/null
+++ b/usr/src/man/man3c/pthread_attr_getname_np.3c
@@ -0,0 +1,105 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2018 Joyent, Inc.
+.\"
+.Dd "August 22, 2018"
+.Dt PTHREAD_ATTR_GETNAME_NP 3C
+.Os
+.Sh NAME
+.Nm pthread_attr_getname_np ,
+.Nm pthread_attr_setname_np
+.Nd get or set thread name attribute
+.Sh SYNOPSIS
+.In pthread.h
+.
+.Ft int
+.Fo pthread_attr_getname_np
+.Fa "pthread_attr_t *restrict attr"
+.Fa "char *name"
+.Fa "size_t len"
+.Fc
+.
+.Ft int
+.Fo pthread_attr_setname_np
+.Fa "pthread_attr_t *restrict attr"
+.Fa "const char *name"
+.Fc
+.
+.Sh DESCRIPTION
+The
+.Fn pthread_attr_setname_np
+and
+.Fn pthread_attr_getname_np
+functions, respectively, set and get the thread name attribute in
+.Fa attr
+to
+.Fa name .
+For
+.Fn pthread_attr_getname_np ,
+.Fa len
+is the size of
+.Fa name .
+Any threads created with
+.Xr pthread_create 3c
+using
+.Fa attr
+will have their name set to
+.Fa name
+upon creation.
+.Pp
+Thread names are limited to
+.Dv PTHREAD_MAX_NAMELEN_NP
+including the terminating NUL.
+They may only contain printable ASCII characters.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn pthread_attr_getname_np
+and
+.Fn pthread_attr_setname_np
+functions return
+.Sy 0 .
+Otherwise, an error number is returned to indicate the error.
+.Sh ERRORS
+The
+.Fn pthread_attr_getname_np
+function may fail with:
+.Bl -tag -width Er
+.It Er EINVAL
+The
+.Fa name
+argument is
+.Sy NULL .
+.It Er ERANGE
+The size of
+.Fa name
+as indicated by
+.Fa len
+is too small to contain the thread name.
+The buffer may be over-written with partial contents of the thread name.
+.El
+.Pp
+The
+.Fn pthread_attr_setname_np
+function may fail with:
+.Bl -tag -width Er
+.It Er ERANGE
+The length of name given in
+.Fa name
+exceeds the maximum size allowed.
+.El
+.Sh INTERFACE STABILITY
+.Sy Uncommitted
+.Sh MT-LEVEL
+.Sy MT-Safe
+.Sh SEE ALSO
+.Xr pthread_create 3c ,
+.Xr pthread_getname_np 3c
diff --git a/usr/src/man/man3c/pthread_getname_np.3c b/usr/src/man/man3c/pthread_getname_np.3c
new file mode 100644
index 0000000000..7404a4abfe
--- /dev/null
+++ b/usr/src/man/man3c/pthread_getname_np.3c
@@ -0,0 +1,124 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2018 Joyent, Inc.
+.\"
+.Dd "August 22, 2018"
+.Dt PTHREAD_GETNAME_NP 3C
+.Os
+.Sh NAME
+.Nm pthread_getname_np ,
+.Nm pthread_setname_np
+.Nd get or set the name of a thread
+.Sh SYNOPSIS
+.In pthread.h
+.
+.Ft int
+.Fo pthread_getname_np
+.Fa "pthread_t tid"
+.Fa "char *name"
+.Fa "size_t len"
+.Fc
+.
+.Ft int
+.Fo pthread_setname_np
+.Fa "pthread_t tid"
+.Fa "const char *name"
+.Fc
+.
+.Sh DESCRIPTION
+The
+.Fn pthread_getname_np
+and
+.Fn pthread_setname_np
+functions, respectively, get and set the names of the thread whose id is given
+by the
+.Fa tid
+parameter.
+For
+.Fn pthread_getname_np ,
+.Fa len
+indicates the size of
+.Fa name .
+.Pp
+Thread names are limited to
+.Dv PTHREAD_MAX_NAMELEN_NP
+including the terminating NUL.
+They may only contain printable ASCII characters.
+.Pp
+To clear a thread name, call
+.Fn pthread_setname_np
+with
+.Sy NULL .
+.Pp
+Unlike some other systems, threads do not inherit the process name by default.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn pthread_getname_np
+and
+.Fn pthread_setname_np
+functions return
+.Sy 0 .
+Otherwise, an error number is returned to indicate the error.
+If the thread identified by
+.Fa tid
+does not have a name set,
+.Fa pthread_getname_np
+will be set to an empty string (length = 0).
+.Sh ERRORS
+On failure, the contents of the buffer are undefined.
+Errors from
+.Xr open 2 ,
+.Xr read 2 ,
+or
+.Xr write 2
+are possible.
+In addition, the
+.Fn pthread_getname_np
+function will fail with:
+.Bl -tag -width Er
+.It Er EINVAL
+The
+.Fa name
+argument is
+.Sy NULL .
+.It Er ERANGE
+The size of
+.Fa name
+as given by
+.Fa len
+was not large enough to contain the name of the thread.
+.It Er ESRCH
+The thread
+.Fa tid
+was not found.
+.El
+.Pp
+The
+.Fn pthread_setname_np
+function will fail with:
+.Bl -tag -width Er
+.It Er ERANGE
+The length of
+.Fa name
+exceeds the maximum allowed size.
+.It Er ESRCH
+The thread
+.Fa tid
+was not found.
+.El
+.Sh INTERFACE STABILITY
+.Sy Uncommitted
+.Sh MT-LEVEL
+.Sy MT-Safe
+.Sh SEE ALSO
+.Xr pthread_attr_getname_np 3c ,
+.Xr pthread_create 3c
diff --git a/usr/src/man/man3c/thr_getname.3c b/usr/src/man/man3c/thr_getname.3c
new file mode 100644
index 0000000000..551e620d46
--- /dev/null
+++ b/usr/src/man/man3c/thr_getname.3c
@@ -0,0 +1,124 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2018 Joyent, Inc.
+.\"
+.Dd "August 22, 2018"
+.Dt THR_GETNAME 3C
+.Os
+.Sh NAME
+.Nm thr_getname ,
+.Nm thr_setname
+.Nd get or set the name of a thread
+.Sh SYNOPSIS
+.In thread.h
+.
+.Ft int
+.Fo thr_getname
+.Fa "thread_t tid"
+.Fa "char *name"
+.Fa "size_t len"
+.Fc
+.
+.Ft int
+.Fo thr_setname
+.Fa "thread_t tid"
+.Fa "const char *name"
+.Fc
+.
+.Sh DESCRIPTION
+The
+.Fn thr_getname
+and
+.Fn thr_setname
+functions, respectively, get and set the names of the thread whose id is given
+by the
+.Fa tid
+parameter.
+For
+.Fn thr_getname ,
+.Fa len
+indicates the size of
+.Fa name .
+.Pp
+Thread names are limited to
+.Dv THREAD_NAME_MAX
+including the terminating NUL.
+They may only contain printable ASCII characters.
+.Pp
+To clear a thread name, call
+.Fn thr_setname
+with
+.Sy NULL .
+.Pp
+Unlike some other systems, threads do not inherit the process name by default.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn thr_getname
+and
+.Fn thr_setname
+functions return
+.Sy 0 .
+Otherwise, an error number is returned to indicate the error.
+If the thread identified by
+.Fa tid
+does not have a name set,
+.Fa thr_getname
+will be set to an empty string (length = 0).
+.Sh ERRORS
+On failure, the contents of the buffer are undefined.
+Errors from
+.Xr open 2 ,
+.Xr read 2 ,
+or
+.Xr write 2
+are possible.
+In addition, the
+.Fn thr_getname
+function will fail with:
+.Bl -tag -width Er
+.It Er EINVAL
+The
+.Fa name
+argument is
+.Sy NULL .
+.It Er ERANGE
+The size of
+.Fa name
+as given by
+.Fa len
+was not large enough to contain the name of the thread.
+.It Er ESRCH
+The thread
+.Fa tid
+was not found.
+.El
+.Pp
+The
+.Fn thr_setname
+function will fail with:
+.Bl -tag -width Er
+.It Er ERANGE
+The length of
+.Fa name
+exceeds the maximum allowed size.
+.It Er ESRCH
+The thread
+.Fa tid
+was not found.
+.El
+.Sh INTERFACE STABILITY
+.Sy Uncommitted
+.Sh MT-LEVEL
+.Sy MT-Safe
+.Sh SEE ALSO
+.Xr pthread_setname_np 3c ,
+.Xr thr_create 3c
diff --git a/usr/src/man/man3lib/libproc.3lib b/usr/src/man/man3lib/libproc.3lib
index 915febee0b..6b1e26eaf8 100644
--- a/usr/src/man/man3lib/libproc.3lib
+++ b/usr/src/man/man3lib/libproc.3lib
@@ -9,9 +9,9 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2015 Joyent, Inc.
+.\" Copyright 2018 Joyent, Inc.
.\"
-.Dd June 06, 2016
+.Dd August 31, 2018
.Dt LIBPROC 3LIB
.Os
.Sh NAME
@@ -217,34 +217,34 @@ manipulation of the process itself.
.It Sy Plmid_to_loadobj Ta Sy Plmid_to_map
.It Sy Plookup_by_addr Ta Sy Plookup_by_name
.It Sy Plwp_alt_stack Ta Sy Plwp_getfpregs
-.It Sy Plwp_getpsinfo Ta Sy Plwp_getregs
-.It Sy Plwp_getspymaster Ta Sy Plwp_main_stack
-.It Sy Plwp_setfpregs Ta Sy Plwp_setregs
-.It Sy Plwp_stack Ta Sy Pname_to_ctf
-.It Sy Pname_to_loadobj Ta Sy Pname_to_map
-.It Sy Pobjname Ta Sy Pobjname_resolved
-.It Sy Pplatform Ta Sy Ppltdest
-.It Sy Ppriv Ta Sy Ppsinfo
-.It Sy Pputareg Ta Sy Prd_agent
-.It Sy Pread Ta Sy Pread_string
-.It Sy Preset_maps Ta Sy Psetbkpt
-.It Sy Psecflags Ta Sy Psetcred
-.It Sy Psetfault Ta Sy Psetflags
-.It Sy Psetpriv Ta Sy Psetrun
-.It Sy Psetsignal Ta Sy Psetsysentry
-.It Sy Psetsysexit Ta Sy Psetwapt
-.It Sy Psetzoneid Ta Sy Psignal
-.It Sy Pstate Ta Sy Pstatus
-.It Sy Pstop Ta Sy Pstopstatus
-.It Sy Psync Ta Sy Psysentry
-.It Sy Psysexit Ta Sy Puname
-.It Sy Punsetflags Ta Sy Pupdate_maps
-.It Sy Pupdate_syms Ta Sy Pwait
-.It Sy Pwrite Ta Sy Pxecbkpt
-.It Sy Pxecwapt Ta Sy Pxlookup_by_addr
-.It Sy Pxlookup_by_addr_resolved Ta Sy Pxlookup_by_name
-.It Sy Pzonename Ta Sy Pzonepath
-.It Sy Pzoneroot Ta
+.It Sy Plwp_getname Ta Sy Plwp_getpsinfo
+.It Sy Plwp_getregs Ta Sy Plwp_getspymaster
+.It Sy Plwp_main_stack Ta Sy Plwp_setfpregs
+.It Sy Plwp_setregs Ta Sy Plwp_stack
+.It Sy Pname_to_ctf Ta Sy Pname_to_loadobj
+.It Sy Pname_to_map Ta Sy Pobjname
+.It Sy Pobjname_resolved Ta Sy Pplatform
+.It Sy Ppltdest Ta Sy Ppriv
+.It Sy Ppsinfo Ta Sy Pputareg
+.It Sy Prd_agent Ta Sy Pread
+.It Sy Pread_string Ta Sy Preset_maps
+.It Sy Psetbkpt Ta Sy Psecflags
+.It Sy Psetcred Ta Sy Psetfault
+.It Sy Psetflags Ta Sy Psetpriv
+.It Sy Psetrun Ta Sy Psetsignal
+.It Sy Psetsysentry Ta Sy Psetsysexit
+.It Sy Psetwapt Ta Sy Psetzoneid
+.It Sy Psignal Ta Sy Pstate
+.It Sy Pstatus Ta Sy Pstop
+.It Sy Pstopstatus Ta Sy Psync
+.It Sy Psysentry Ta Sy Psysexit
+.It Sy Puname Ta Sy Punsetflags
+.It Sy Pupdate_maps Ta Sy Pupdate_syms
+.It Sy Pwait Ta Sy Pwrite
+.It Sy Pxecbkpt Ta Sy Pxecwapt
+.It Sy Pxlookup_by_addr Ta Sy Pxlookup_by_addr_resolved
+.It Sy Pxlookup_by_name Ta Sy Pzonename
+.It Sy Pzonepath Ta Sy Pzoneroot Ta
.El
.Ss Thread interrogation and manipulation
The following routines obtain information about a thread and allow
diff --git a/usr/src/man/man3proc/Makefile b/usr/src/man/man3proc/Makefile
index 0984b6871f..e59e81fbf3 100644
--- a/usr/src/man/man3proc/Makefile
+++ b/usr/src/man/man3proc/Makefile
@@ -12,12 +12,12 @@
#
# Copyright 2011, Richard Lowe
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
-# Copyright 2015 Joyent, Inc.
+# Copyright 2018 Joyent, Inc.
#
include $(SRC)/Makefile.master
-MANSECT= 3proc
+MANSECT= 3proc
MANFILES= \
Lctlfd.3proc \
@@ -64,6 +64,7 @@ MANFILES= \
Plookup_by_addr.3proc \
Plwp_getasrs.3proc \
Plwp_getgwindows.3proc \
+ Plwp_getname.3proc \
Plwp_getpsinfo.3proc \
Plwp_getregs.3proc \
Plwp_getspymaster.3proc \
@@ -160,10 +161,10 @@ MANFILES= \
Pwrite.3proc \
Pxecbkpt.3proc \
Pzonename.3proc \
- ps_lgetregs.3proc \
- ps_pglobal_lookup.3proc \
- ps_pread.3proc \
- ps_pstop.3proc
+ ps_lgetregs.3proc \
+ ps_pglobal_lookup.3proc \
+ ps_pread.3proc \
+ ps_pstop.3proc
MANLINKS= \
@@ -265,7 +266,7 @@ MANLINKS= \
Pxlookup_by_name.3proc \
Pxsymbol_iter.3proc \
Pzonepath.3proc \
- Pzoneroot.3proc
+ Pzoneroot.3proc
ps_lgetfpregs.3proc := LINKSRC = ps_lgetregs.3proc
diff --git a/usr/src/man/man3proc/Paddr_to_ctf.3proc b/usr/src/man/man3proc/Paddr_to_ctf.3proc
index 5eb4183a23..0364940975 100644
--- a/usr/src/man/man3proc/Paddr_to_ctf.3proc
+++ b/usr/src/man/man3proc/Paddr_to_ctf.3proc
@@ -19,8 +19,9 @@
.Nm Plmid_to_ctf ,
.Nm Pname_to_ctf
.Nd lookup CTF data
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "ctf_file_t *"
.Fo Paddr_to_ctf
diff --git a/usr/src/man/man3proc/Paddr_to_loadobj.3proc b/usr/src/man/man3proc/Paddr_to_loadobj.3proc
index 6430d8eae4..54f129e110 100644
--- a/usr/src/man/man3proc/Paddr_to_loadobj.3proc
+++ b/usr/src/man/man3proc/Paddr_to_loadobj.3proc
@@ -19,8 +19,9 @@
.Nm Plmid_to_loadobj ,
.Nm Pname_to_loadobj
.Nd lookup loaded object information
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const rd_loadobj_t *"
.Fo Paddr_to_loadobj
diff --git a/usr/src/man/man3proc/Paddr_to_map.3proc b/usr/src/man/man3proc/Paddr_to_map.3proc
index d49067ee65..f9fcd6bc80 100644
--- a/usr/src/man/man3proc/Paddr_to_map.3proc
+++ b/usr/src/man/man3proc/Paddr_to_map.3proc
@@ -20,8 +20,9 @@
.Nm Plmid_to_map ,
.Nm Pname_to_map
.Nd lookup memory map information
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const prmap_t *"
.Fo Paddr_to_map
diff --git a/usr/src/man/man3proc/Pasfd.3proc b/usr/src/man/man3proc/Pasfd.3proc
index a5ae8a9dc4..501d006de4 100644
--- a/usr/src/man/man3proc/Pasfd.3proc
+++ b/usr/src/man/man3proc/Pasfd.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pasfd
.Nd obtain the process address space file descriptor
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pasfd
diff --git a/usr/src/man/man3proc/Pclearfault.3proc b/usr/src/man/man3proc/Pclearfault.3proc
index 0c1f7ed862..744b43f566 100644
--- a/usr/src/man/man3proc/Pclearfault.3proc
+++ b/usr/src/man/man3proc/Pclearfault.3proc
@@ -18,8 +18,9 @@
.Nm Pclearfault ,
.Nm Lclearfault
.Nd clear process and thread faults
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pclearfault
diff --git a/usr/src/man/man3proc/Pclearsig.3proc b/usr/src/man/man3proc/Pclearsig.3proc
index 577fcf9359..23f81df918 100644
--- a/usr/src/man/man3proc/Pclearsig.3proc
+++ b/usr/src/man/man3proc/Pclearsig.3proc
@@ -18,8 +18,9 @@
.Nm Pclearsig ,
.Nm Lclearsig
.Nd clear process signals
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pclearsig
diff --git a/usr/src/man/man3proc/Pcontent.3proc b/usr/src/man/man3proc/Pcontent.3proc
index 27d9d6742a..5ea261d53f 100644
--- a/usr/src/man/man3proc/Pcontent.3proc
+++ b/usr/src/man/man3proc/Pcontent.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pconent
.Nd obtain process content types available
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "core_content_t"
.Fo Pcontent
diff --git a/usr/src/man/man3proc/Pcreate.3proc b/usr/src/man/man3proc/Pcreate.3proc
index 6185e60d23..94552a1034 100644
--- a/usr/src/man/man3proc/Pcreate.3proc
+++ b/usr/src/man/man3proc/Pcreate.3proc
@@ -19,8 +19,9 @@
.Nm Pxcreate ,
.Nm Pcreate_callback
.Nd create and control a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "struct ps_prochandle *"
.Fo Pcreate
diff --git a/usr/src/man/man3proc/Pcreate_agent.3proc b/usr/src/man/man3proc/Pcreate_agent.3proc
index a421938e06..d492b38d51 100644
--- a/usr/src/man/man3proc/Pcreate_agent.3proc
+++ b/usr/src/man/man3proc/Pcreate_agent.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pcreate_agent
.Nd create the agent LWP
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pcreate_agent
diff --git a/usr/src/man/man3proc/Pcreate_error.3proc b/usr/src/man/man3proc/Pcreate_error.3proc
index 73a2538ec8..647294ef82 100644
--- a/usr/src/man/man3proc/Pcreate_error.3proc
+++ b/usr/src/man/man3proc/Pcreate_error.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pcreate_error
.Nd get Pcreate, Pxcreate error message string
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const char *"
.Fo Pcreate_error
diff --git a/usr/src/man/man3proc/Pcred.3proc b/usr/src/man/man3proc/Pcred.3proc
index bec0030fd4..a71ea1c16e 100644
--- a/usr/src/man/man3proc/Pcred.3proc
+++ b/usr/src/man/man3proc/Pcred.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pcred
.Nd obtain process credentials
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pcred
diff --git a/usr/src/man/man3proc/Pctlfd.3proc b/usr/src/man/man3proc/Pctlfd.3proc
index 66679f5aea..7a51968201 100644
--- a/usr/src/man/man3proc/Pctlfd.3proc
+++ b/usr/src/man/man3proc/Pctlfd.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pctlfd
.Nd obtain the process control file descriptor
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pctlfd
diff --git a/usr/src/man/man3proc/Pdelbkpt.3proc b/usr/src/man/man3proc/Pdelbkpt.3proc
index e00c5f7684..15e04a8f08 100644
--- a/usr/src/man/man3proc/Pdelbkpt.3proc
+++ b/usr/src/man/man3proc/Pdelbkpt.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pdelbkpt
.Nd clear a breakpoint in a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pdelbkpt
diff --git a/usr/src/man/man3proc/Pdelwapt.3proc b/usr/src/man/man3proc/Pdelwapt.3proc
index 4a3d23d4e9..38bd63cb24 100644
--- a/usr/src/man/man3proc/Pdelwapt.3proc
+++ b/usr/src/man/man3proc/Pdelwapt.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pdelwapt
.Nd remove a watchpoint in a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pdelwapt
diff --git a/usr/src/man/man3proc/Pdestroy_agent.3proc b/usr/src/man/man3proc/Pdestroy_agent.3proc
index 30c677204e..9d683a9b91 100644
--- a/usr/src/man/man3proc/Pdestroy_agent.3proc
+++ b/usr/src/man/man3proc/Pdestroy_agent.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pdestroy_agent
.Nd destroy the agent LWP
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Pdestroy_agent
diff --git a/usr/src/man/man3proc/Penv_iter.3proc b/usr/src/man/man3proc/Penv_iter.3proc
index 8dc616ee0f..658154d2ba 100644
--- a/usr/src/man/man3proc/Penv_iter.3proc
+++ b/usr/src/man/man3proc/Penv_iter.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Penv_iter
.Nd iterate process environment
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Penv_iter
diff --git a/usr/src/man/man3proc/Pexecname.3proc b/usr/src/man/man3proc/Pexecname.3proc
index f7560c7396..e6c205a421 100644
--- a/usr/src/man/man3proc/Pexecname.3proc
+++ b/usr/src/man/man3proc/Pexecname.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pexecname
.Nd obtain full path to process executable
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "char *"
.Fo Pexecname
diff --git a/usr/src/man/man3proc/Pfault.3proc b/usr/src/man/man3proc/Pfault.3proc
index 7c1d8ed99e..cb106a4d19 100644
--- a/usr/src/man/man3proc/Pfault.3proc
+++ b/usr/src/man/man3proc/Pfault.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pfault
.Nd enable and disable the tracing of faults
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "int"
.Fo Pfault
diff --git a/usr/src/man/man3proc/Pfdinfo_iter.3proc b/usr/src/man/man3proc/Pfdinfo_iter.3proc
index 055355e00c..cb03a77f48 100644
--- a/usr/src/man/man3proc/Pfdinfo_iter.3proc
+++ b/usr/src/man/man3proc/Pfdinfo_iter.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pfdinfo_iter
.Nd iterate open files in a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pfdinfo_iter
diff --git a/usr/src/man/man3proc/Pgetareg.3proc b/usr/src/man/man3proc/Pgetareg.3proc
index 1904ea73a0..e141b878fb 100644
--- a/usr/src/man/man3proc/Pgetareg.3proc
+++ b/usr/src/man/man3proc/Pgetareg.3proc
@@ -20,8 +20,9 @@
.Nm Lgetareg ,
.Nm Lputareg
.Nd set and get a register from a stopped process or thread
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pgetareg
diff --git a/usr/src/man/man3proc/Pgetauxval.3proc b/usr/src/man/man3proc/Pgetauxval.3proc
index 2d6122bfe7..5a4abadf0a 100644
--- a/usr/src/man/man3proc/Pgetauxval.3proc
+++ b/usr/src/man/man3proc/Pgetauxval.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pgetauxval
.Nd obtain auxiliary vector value
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pgetauxval
diff --git a/usr/src/man/man3proc/Pgetauxvec.3proc b/usr/src/man/man3proc/Pgetauxvec.3proc
index 348e01ea15..58801051a0 100644
--- a/usr/src/man/man3proc/Pgetauxvec.3proc
+++ b/usr/src/man/man3proc/Pgetauxvec.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pgetauxvec
.Nd obtain process auxiliary vector
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const auxv_t *"
.Fo Pgetauxvec
diff --git a/usr/src/man/man3proc/Pgetenv.3proc b/usr/src/man/man3proc/Pgetenv.3proc
index bb34119e6a..b72eea536c 100644
--- a/usr/src/man/man3proc/Pgetenv.3proc
+++ b/usr/src/man/man3proc/Pgetenv.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pgetenv
.Nd get process environment variable
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "char *"
.Fo Pgetenv
diff --git a/usr/src/man/man3proc/Pgrab.3proc b/usr/src/man/man3proc/Pgrab.3proc
index a6df2614e1..67109a85e2 100644
--- a/usr/src/man/man3proc/Pgrab.3proc
+++ b/usr/src/man/man3proc/Pgrab.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pgrab
.Nd grab and control a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "struct ps_prochandle *"
.Fo Pgrab
diff --git a/usr/src/man/man3proc/Pgrab_core.3proc b/usr/src/man/man3proc/Pgrab_core.3proc
index 2b864bd563..9cb01133dd 100644
--- a/usr/src/man/man3proc/Pgrab_core.3proc
+++ b/usr/src/man/man3proc/Pgrab_core.3proc
@@ -18,8 +18,9 @@
.Nm Pgrab_core ,
.Nm Pfgrab_core
.Nd grab a core file
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "struct ps_prochandle *"
.Fo Pgrab_core
diff --git a/usr/src/man/man3proc/Pgrab_error.3proc b/usr/src/man/man3proc/Pgrab_error.3proc
index 01be5d1ccf..0c22aaaaf3 100644
--- a/usr/src/man/man3proc/Pgrab_error.3proc
+++ b/usr/src/man/man3proc/Pgrab_error.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pgrab_error
.Nd get Pgrab error message string
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const char *"
.Fo Pgrab_error
diff --git a/usr/src/man/man3proc/Pgrab_file.3proc b/usr/src/man/man3proc/Pgrab_file.3proc
index fa3e3b31a9..1db5929459 100644
--- a/usr/src/man/man3proc/Pgrab_file.3proc
+++ b/usr/src/man/man3proc/Pgrab_file.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pgrab_file
.Nd grab and inspect an ELF object
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft struct ps_prochandle
.Fo Pgrab_file
diff --git a/usr/src/man/man3proc/Pisprocdir.3proc b/usr/src/man/man3proc/Pisprocdir.3proc
index 18aef39e5a..74d9d15428 100644
--- a/usr/src/man/man3proc/Pisprocdir.3proc
+++ b/usr/src/man/man3proc/Pisprocdir.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pisprocdir
.Nd determine if a directory is the /proc directory
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pisprocdir
diff --git a/usr/src/man/man3proc/Pissyscall.3proc b/usr/src/man/man3proc/Pissyscall.3proc
index 58b4d36950..2628b1fd90 100644
--- a/usr/src/man/man3proc/Pissyscall.3proc
+++ b/usr/src/man/man3proc/Pissyscall.3proc
@@ -18,8 +18,9 @@
.Nm Pissyscall ,
.Nm Pissyscall_prev
.Nd determine if instructions are system call instructions
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pissyscall
diff --git a/usr/src/man/man3proc/Pldt.3proc b/usr/src/man/man3proc/Pldt.3proc
index c39a0b6371..e702875c48 100644
--- a/usr/src/man/man3proc/Pldt.3proc
+++ b/usr/src/man/man3proc/Pldt.3proc
@@ -18,8 +18,9 @@
.Nm Pldt ,
.Nm proc_get_ldt
.Nd obtain local descriptor table of a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pldt
diff --git a/usr/src/man/man3proc/Plmid.3proc b/usr/src/man/man3proc/Plmid.3proc
index ecb9a9a00c..fb54231c1e 100644
--- a/usr/src/man/man3proc/Plmid.3proc
+++ b/usr/src/man/man3proc/Plmid.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Plmid
.Nd get the link-map identifier of an address
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plmid
diff --git a/usr/src/man/man3proc/Plookup_by_addr.3proc b/usr/src/man/man3proc/Plookup_by_addr.3proc
index b84879671d..d1b1593326 100644
--- a/usr/src/man/man3proc/Plookup_by_addr.3proc
+++ b/usr/src/man/man3proc/Plookup_by_addr.3proc
@@ -21,8 +21,9 @@
.Nm Plookup_by_name ,
.Nm Pxlookup_by_name
.Nd lookup symbols in a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plookup_by_addr
diff --git a/usr/src/man/man3proc/Plwp_getasrs.3proc b/usr/src/man/man3proc/Plwp_getasrs.3proc
index 85fa41e910..ea0fa5d2fc 100644
--- a/usr/src/man/man3proc/Plwp_getasrs.3proc
+++ b/usr/src/man/man3proc/Plwp_getasrs.3proc
@@ -18,8 +18,9 @@
.Nm Plwp_getasrs ,
.Nm Plwp_setasrs
.Nd get and set SPARCv9 ancillary state registers
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plwp_getasrs
diff --git a/usr/src/man/man3proc/Plwp_getname.3proc b/usr/src/man/man3proc/Plwp_getname.3proc
new file mode 100644
index 0000000000..961cc5257d
--- /dev/null
+++ b/usr/src/man/man3proc/Plwp_getname.3proc
@@ -0,0 +1,95 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2018 Joyent, Inc.
+.\"
+.Dd August 31, 2018
+.Dt PLWP_GETNAME 3PROC
+.Os
+.Sh NAME
+.Nm Plwp_getname
+.Nd get thread name
+.Sh LIBRARY
+.Lb libproc
+.Sh SYNOPSIS
+.In libproc.h
+.Ft int
+.Fo Plwp_getname
+.Fa "struct ps_prochandle *P"
+.Fa "lwpid_t lwpid"
+.Fa "char *buf"
+.Fa "size_t bufsize"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn Plwp_getname
+function returns the thread name in the supplied buffer, from the
+thread
+.Fa lwpid
+in the process handle
+.Fa P .
+.Pp
+If no thread name is set, the buffer is set to the empty string.
+The buffer should be at least
+.Dv THREAD_NAME_MAX
+in size.
+.Pp
+The
+.Fn Plwp_getname
+function only works on process handles that refer to active processes
+and core files, it does not work on process handles that refer to
+individual files.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn Plwp_getname
+function returns 0.
+Otherwise,
+.Sy -1
+is returned,
+.Sy errno
+is set to indicate the error.
+The buffer may be modified even if an error is returned.
+.Sh ERRORS
+For a full list of possible errors also see the
+.Sy DIAGNOSTICS
+section in
+.Xr proc 4 .
+.Pp
+The
+.Fn Plwp_getname
+function will fail if:
+.Bl -tag -width Er
+.It Er ENODATA
+.Fa P
+refers to a file handle obtained through
+.Xr Pgrab_file 3PROC .
+.It Er EINVAL
+The process handle
+.Fa P
+refers to a core file and the specified thread does not exist.
+.It Er ENOENT
+The process handle
+.Fa P
+refers to an active process and the specified thread does not exist.
+.Fa P
+.It Er ENAMETOOLONG
+The buffer is not sufficient to hold the thread name.
+.El
+.Sh INTERFACE STABILITY
+.Sy Uncommitted
+.Sh MT-LEVEL
+See
+.Sy LOCKING
+in
+.Xr libproc 3LIB .
+.Sh SEE ALSO
+.Xr libproc 3LIB ,
+.Xr proc 4
diff --git a/usr/src/man/man3proc/Plwp_getpsinfo.3proc b/usr/src/man/man3proc/Plwp_getpsinfo.3proc
index 4d7d64fca7..53b01ea1c2 100644
--- a/usr/src/man/man3proc/Plwp_getpsinfo.3proc
+++ b/usr/src/man/man3proc/Plwp_getpsinfo.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Plwp_getpsinfo
.Nd get thread specific ps information
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plwp_getpsinfo
diff --git a/usr/src/man/man3proc/Plwp_getregs.3proc b/usr/src/man/man3proc/Plwp_getregs.3proc
index 5d4e7766f7..e11f4f5fa2 100644
--- a/usr/src/man/man3proc/Plwp_getregs.3proc
+++ b/usr/src/man/man3proc/Plwp_getregs.3proc
@@ -20,8 +20,9 @@
.Nm Plwp_getregs ,
.Nm Plwp_setregs
.Nd get and set thread registers
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plwp_getfpregs
diff --git a/usr/src/man/man3proc/Plwp_getspymaster.3proc b/usr/src/man/man3proc/Plwp_getspymaster.3proc
index 8b7adbf418..762485ddda 100644
--- a/usr/src/man/man3proc/Plwp_getspymaster.3proc
+++ b/usr/src/man/man3proc/Plwp_getspymaster.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Plwp_getspymaster
.Nd get agent LWP spy master information
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plwp_getspymaster
diff --git a/usr/src/man/man3proc/Plwp_getxregs.3proc b/usr/src/man/man3proc/Plwp_getxregs.3proc
index e1801eedda..f1c191f99f 100644
--- a/usr/src/man/man3proc/Plwp_getxregs.3proc
+++ b/usr/src/man/man3proc/Plwp_getxregs.3proc
@@ -18,8 +18,9 @@
.Nm Plwp_getxregs ,
.Nm Plwp_setxregs
.Nd get and set extended register state
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plwp_getxregs
diff --git a/usr/src/man/man3proc/Plwp_iter.3proc b/usr/src/man/man3proc/Plwp_iter.3proc
index 15de2f12ea..487190b539 100644
--- a/usr/src/man/man3proc/Plwp_iter.3proc
+++ b/usr/src/man/man3proc/Plwp_iter.3proc
@@ -18,8 +18,9 @@
.Nm Plwp_iter ,
.Nm Plwp_iter_all
.Nd iterate over threads
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plwp_iter
diff --git a/usr/src/man/man3proc/Plwp_stack.3proc b/usr/src/man/man3proc/Plwp_stack.3proc
index 2cf3303ed2..77d84664c2 100644
--- a/usr/src/man/man3proc/Plwp_stack.3proc
+++ b/usr/src/man/man3proc/Plwp_stack.3proc
@@ -22,8 +22,9 @@
.Nm Lalt_stack ,
.Nm Lmain_stack
.Nd get thread stack information
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Plwp_stack
diff --git a/usr/src/man/man3proc/Pmapping_iter.3proc b/usr/src/man/man3proc/Pmapping_iter.3proc
index 7f2fb46124..6d43906ad4 100644
--- a/usr/src/man/man3proc/Pmapping_iter.3proc
+++ b/usr/src/man/man3proc/Pmapping_iter.3proc
@@ -20,8 +20,9 @@
.Nm Pobject_iter ,
.Nm Pobject_iter_resolved
.Nd iterate over process mappings and objects
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pmapping_iter
diff --git a/usr/src/man/man3proc/Pobjname.3proc b/usr/src/man/man3proc/Pobjname.3proc
index 4b75abb31a..300d4fa9dd 100644
--- a/usr/src/man/man3proc/Pobjname.3proc
+++ b/usr/src/man/man3proc/Pobjname.3proc
@@ -18,8 +18,9 @@
.Nm Pobjname ,
.Nm Pobjname_resolved
.Nd turn a virtual address into its mapped object
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "char *"
.Fo Pobjname
diff --git a/usr/src/man/man3proc/Pplatform.3proc b/usr/src/man/man3proc/Pplatform.3proc
index c17f9aabe9..82ff02bf3f 100644
--- a/usr/src/man/man3proc/Pplatform.3proc
+++ b/usr/src/man/man3proc/Pplatform.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pplatform
.Nd get platform string
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "char *"
.Fo Pplatform
diff --git a/usr/src/man/man3proc/Ppltdest.3proc b/usr/src/man/man3proc/Ppltdest.3proc
index 56eea82f85..98dd3e9dfe 100644
--- a/usr/src/man/man3proc/Ppltdest.3proc
+++ b/usr/src/man/man3proc/Ppltdest.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Ppltdest
.Nd determine PLT destination symbol
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const char *"
.Fo Ppltdest
diff --git a/usr/src/man/man3proc/Ppriv.3proc b/usr/src/man/man3proc/Ppriv.3proc
index f7adf48756..7f698f4db0 100644
--- a/usr/src/man/man3proc/Ppriv.3proc
+++ b/usr/src/man/man3proc/Ppriv.3proc
@@ -18,8 +18,9 @@
.Nm Ppriv ,
.Nm Ppriv_free
.Nd get and free process privilege sets
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Ppriv
diff --git a/usr/src/man/man3proc/Ppsinfo.3proc b/usr/src/man/man3proc/Ppsinfo.3proc
index 7032494b06..f3151c1789 100644
--- a/usr/src/man/man3proc/Ppsinfo.3proc
+++ b/usr/src/man/man3proc/Ppsinfo.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Ppsinfo
.Nd get process ps information
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const psinfo_t *"
.Fo Ppsinfo
diff --git a/usr/src/man/man3proc/Prd_agent.3proc b/usr/src/man/man3proc/Prd_agent.3proc
index 1fdc63ee6a..2de9dd3759 100644
--- a/usr/src/man/man3proc/Prd_agent.3proc
+++ b/usr/src/man/man3proc/Prd_agent.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Prd_agent
.Nd get librtld_db agent
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "rd_agent_t *"
.Fo Prd_agent
diff --git a/usr/src/man/man3proc/Pread.3proc b/usr/src/man/man3proc/Pread.3proc
index 5a1e449c31..89c6cd1758 100644
--- a/usr/src/man/man3proc/Pread.3proc
+++ b/usr/src/man/man3proc/Pread.3proc
@@ -18,8 +18,9 @@
.Nm Pread ,
.Nm Pread_string
.Nd read data from a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft ssize_t
.Fo Pread
diff --git a/usr/src/man/man3proc/Prelease.3proc b/usr/src/man/man3proc/Prelease.3proc
index 3d66a0d560..61fe282162 100644
--- a/usr/src/man/man3proc/Prelease.3proc
+++ b/usr/src/man/man3proc/Prelease.3proc
@@ -18,8 +18,9 @@
.Nm Prelease ,
.Nm Pfree
.Nd release a process control handle
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Prelease
diff --git a/usr/src/man/man3proc/Preopen.3proc b/usr/src/man/man3proc/Preopen.3proc
index 088480ab57..01beb6c0af 100644
--- a/usr/src/man/man3proc/Preopen.3proc
+++ b/usr/src/man/man3proc/Preopen.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Preopen
.Nd reopen a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Preopen
diff --git a/usr/src/man/man3proc/Preset_maps.3proc b/usr/src/man/man3proc/Preset_maps.3proc
index c842757319..2e110af1ee 100644
--- a/usr/src/man/man3proc/Preset_maps.3proc
+++ b/usr/src/man/man3proc/Preset_maps.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Preset_maps
.Nd reset memory mapping data after exec
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Preset_maps
diff --git a/usr/src/man/man3proc/Psecflags.3proc b/usr/src/man/man3proc/Psecflags.3proc
index 4f4b342146..9eaf3515d3 100644
--- a/usr/src/man/man3proc/Psecflags.3proc
+++ b/usr/src/man/man3proc/Psecflags.3proc
@@ -18,8 +18,9 @@
.Nm Psecflags ,
.Nm Psecflags_free
.Nd get and free process security flags
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psecflags
diff --git a/usr/src/man/man3proc/Psetbkpt.3proc b/usr/src/man/man3proc/Psetbkpt.3proc
index 430063ef1e..8ebdbe2cf9 100644
--- a/usr/src/man/man3proc/Psetbkpt.3proc
+++ b/usr/src/man/man3proc/Psetbkpt.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psetbkpt
.Nd set a breakpoint trap in a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psetbkpt
diff --git a/usr/src/man/man3proc/Psetcred.3proc b/usr/src/man/man3proc/Psetcred.3proc
index afc0ce65d6..15865707be 100644
--- a/usr/src/man/man3proc/Psetcred.3proc
+++ b/usr/src/man/man3proc/Psetcred.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psetcred
.Nd set process credentials
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psetcred
diff --git a/usr/src/man/man3proc/Psetfault.3proc b/usr/src/man/man3proc/Psetfault.3proc
index 7cb467c402..fff818b333 100644
--- a/usr/src/man/man3proc/Psetfault.3proc
+++ b/usr/src/man/man3proc/Psetfault.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psetfault
.Nd set fault tracing flags
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Psetfault
diff --git a/usr/src/man/man3proc/Psetflags.3proc b/usr/src/man/man3proc/Psetflags.3proc
index a91126442b..0affa7ab01 100644
--- a/usr/src/man/man3proc/Psetflags.3proc
+++ b/usr/src/man/man3proc/Psetflags.3proc
@@ -18,8 +18,9 @@
.Nm Psetflags ,
.Nm Punsetflags
.Nd set and unset process flags
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psetflags
diff --git a/usr/src/man/man3proc/Psetpriv.3proc b/usr/src/man/man3proc/Psetpriv.3proc
index 4d327280e4..bfaece0206 100644
--- a/usr/src/man/man3proc/Psetpriv.3proc
+++ b/usr/src/man/man3proc/Psetpriv.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psetpriv
.Nd set process privileges
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psetpriv
diff --git a/usr/src/man/man3proc/Psetrun.3proc b/usr/src/man/man3proc/Psetrun.3proc
index 68b6f92ebd..b21179156e 100644
--- a/usr/src/man/man3proc/Psetrun.3proc
+++ b/usr/src/man/man3proc/Psetrun.3proc
@@ -18,8 +18,9 @@
.Nm Psetrun ,
.Nm Lsetrun
.Nd run a stopped process or thread
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psetrun
diff --git a/usr/src/man/man3proc/Psetsignal.3proc b/usr/src/man/man3proc/Psetsignal.3proc
index 58745ffaa7..ae390200ca 100644
--- a/usr/src/man/man3proc/Psetsignal.3proc
+++ b/usr/src/man/man3proc/Psetsignal.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psetsignal
.Nd set signal tracing flags
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Psetsignal
diff --git a/usr/src/man/man3proc/Psetsysentry.3proc b/usr/src/man/man3proc/Psetsysentry.3proc
index 4c7cce76f4..5367d3f717 100644
--- a/usr/src/man/man3proc/Psetsysentry.3proc
+++ b/usr/src/man/man3proc/Psetsysentry.3proc
@@ -18,8 +18,9 @@
.Nm Psetsysentry ,
.Nm Psetsysexit
.Nd set system call tracing flags
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Psetsysentry
diff --git a/usr/src/man/man3proc/Psetwapt.3proc b/usr/src/man/man3proc/Psetwapt.3proc
index 4ef992cb77..e119d90841 100644
--- a/usr/src/man/man3proc/Psetwapt.3proc
+++ b/usr/src/man/man3proc/Psetwapt.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psetwapt
.Nd set a watchpoint in a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psetwapt
diff --git a/usr/src/man/man3proc/Psetzoneid.3proc b/usr/src/man/man3proc/Psetzoneid.3proc
index 7a83fc54fa..ef25c5d3b1 100644
--- a/usr/src/man/man3proc/Psetzoneid.3proc
+++ b/usr/src/man/man3proc/Psetzoneid.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psetzoneid
.Nd change processes zone id
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psetzoneid
diff --git a/usr/src/man/man3proc/Psignal.3proc b/usr/src/man/man3proc/Psignal.3proc
index 1ff90096f6..b4f1fe0b20 100644
--- a/usr/src/man/man3proc/Psignal.3proc
+++ b/usr/src/man/man3proc/Psignal.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Psignal
.Nd set signal tracing action
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psignal
diff --git a/usr/src/man/man3proc/Pstack_iter.3proc b/usr/src/man/man3proc/Pstack_iter.3proc
index bd3da0d7cd..bcb116dc27 100644
--- a/usr/src/man/man3proc/Pstack_iter.3proc
+++ b/usr/src/man/man3proc/Pstack_iter.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pstack_iter
.Nd iterate process stack frames
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pstack_iter
diff --git a/usr/src/man/man3proc/Pstate.3proc b/usr/src/man/man3proc/Pstate.3proc
index 9ec03c0c83..b91696c761 100644
--- a/usr/src/man/man3proc/Pstate.3proc
+++ b/usr/src/man/man3proc/Pstate.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pstate
.Nd obtain process handle state
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pstate
diff --git a/usr/src/man/man3proc/Pstatus.3proc b/usr/src/man/man3proc/Pstatus.3proc
index 7a917ee5a0..8f9b24de53 100644
--- a/usr/src/man/man3proc/Pstatus.3proc
+++ b/usr/src/man/man3proc/Pstatus.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pstatus
.Nd obtain process status structure
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft "const pstatus_t *"
.Fo Pstatus
diff --git a/usr/src/man/man3proc/Pstopstatus.3proc b/usr/src/man/man3proc/Pstopstatus.3proc
index 8ce88fb7a4..15f9f417f6 100644
--- a/usr/src/man/man3proc/Pstopstatus.3proc
+++ b/usr/src/man/man3proc/Pstopstatus.3proc
@@ -23,8 +23,9 @@
.Nm Lstop ,
.Nm Lwait
.Nd process and thread stop operations
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pdstop
diff --git a/usr/src/man/man3proc/Psymbol_iter.3proc b/usr/src/man/man3proc/Psymbol_iter.3proc
index 2378a19b9b..69e893a330 100644
--- a/usr/src/man/man3proc/Psymbol_iter.3proc
+++ b/usr/src/man/man3proc/Psymbol_iter.3proc
@@ -21,8 +21,9 @@
.Nm Psymbol_iter_by_name ,
.Nm Pxsymbol_iter
.Nd iterate symbols in a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psymbol_iter
diff --git a/usr/src/man/man3proc/Psync.3proc b/usr/src/man/man3proc/Psync.3proc
index cc5637eedc..be7fa46d71 100644
--- a/usr/src/man/man3proc/Psync.3proc
+++ b/usr/src/man/man3proc/Psync.3proc
@@ -18,8 +18,9 @@
.Nm Psync ,
.Nm Lsync
.Nd synchronize cached tracing flags and modifications
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Psync
diff --git a/usr/src/man/man3proc/Psysentry.3proc b/usr/src/man/man3proc/Psysentry.3proc
index fa7999e311..ca0a92369a 100644
--- a/usr/src/man/man3proc/Psysentry.3proc
+++ b/usr/src/man/man3proc/Psysentry.3proc
@@ -18,8 +18,9 @@
.Nm Psysentry ,
.Nm Psysexit
.Nd set system call entry and exit actions
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Psysentry
diff --git a/usr/src/man/man3proc/Puname.3proc b/usr/src/man/man3proc/Puname.3proc
index ba0779fdd4..f6134de653 100644
--- a/usr/src/man/man3proc/Puname.3proc
+++ b/usr/src/man/man3proc/Puname.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Puname
.Nd get uname information from a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Puname
diff --git a/usr/src/man/man3proc/Pupdate_maps.3proc b/usr/src/man/man3proc/Pupdate_maps.3proc
index 7fb482eae2..0f81eb30e2 100644
--- a/usr/src/man/man3proc/Pupdate_maps.3proc
+++ b/usr/src/man/man3proc/Pupdate_maps.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pupdate_maps
.Nd update address space mappings
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Pupdate_maps
diff --git a/usr/src/man/man3proc/Pupdate_syms.3proc b/usr/src/man/man3proc/Pupdate_syms.3proc
index 9e6e819aa5..ee7fdb7b6e 100644
--- a/usr/src/man/man3proc/Pupdate_syms.3proc
+++ b/usr/src/man/man3proc/Pupdate_syms.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pupdate_syms
.Nd update cached symbol tables
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft void
.Fo Pupdate_syms
diff --git a/usr/src/man/man3proc/Pwrite.3proc b/usr/src/man/man3proc/Pwrite.3proc
index 411dbb8aae..a98f02cd21 100644
--- a/usr/src/man/man3proc/Pwrite.3proc
+++ b/usr/src/man/man3proc/Pwrite.3proc
@@ -17,8 +17,9 @@
.Sh NAME
.Nm Pwrite
.Nd write data to the address space of a process
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft ssize_t
.Fo Pwrite
diff --git a/usr/src/man/man3proc/Pzonename.3proc b/usr/src/man/man3proc/Pzonename.3proc
index 0dc78d5959..828e107b98 100644
--- a/usr/src/man/man3proc/Pzonename.3proc
+++ b/usr/src/man/man3proc/Pzonename.3proc
@@ -19,8 +19,9 @@
.Nm Pzoneroot ,
.Nm Pzonepath
.Nd get zone name, root, and full object path
-.Sh SYNOPSIS
+.Sh LIBRARY
.Lb libproc
+.Sh SYNOPSIS
.In libproc.h
.Ft char *
.Fo Pzonename
diff --git a/usr/src/man/man4/proc.4 b/usr/src/man/man4/proc.4
index 59fd43f9a0..61279bdc75 100644
--- a/usr/src/man/man4/proc.4
+++ b/usr/src/man/man4/proc.4
@@ -1,11 +1,11 @@
'\" te
.\" Copyright 1989 AT&T
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
+.\" Copyright 2018, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PROC 4 "Jun 6, 2016"
+.TH PROC 4 "August 22, 2018"
.SH NAME
proc \- /proc, the process file system
.SH DESCRIPTION
@@ -894,12 +894,12 @@ typedef struct psinfo {
uintptr_t pr_argv; /* address of initial argument vector */
uintptr_t pr_envp; /* address of initial environment vector */
char pr_dmodel; /* data model of the process */
- lwpsinfo_t pr_lwp; /* information for representative lwp */
taskid_t pr_taskid; /* task id */
projid_t pr_projid; /* project id */
poolid_t pr_poolid; /* pool id */
zoneid_t pr_zoneid; /* zone id */
ctid_t pr_contract; /* process contract id */
+ lwpsinfo_t pr_lwp; /* information for representative lwp */
} psinfo_t;
.fi
.in -2
@@ -1484,6 +1484,14 @@ following entries:
Write-only control file. The messages written to this file affect the specific
lwp rather than the representative lwp, as is the case for the process's
\fBctl\fR file.
+.SS lwpname
+A buffer of \fBTHREAD_NAME_MAX\fR bytes representing the LWP name; the buffer is
+zero-filled if the thread name is shorter than the buffer. If no thread name is
+set, the buffer contains the empty string. A read with a buffer shorter than
+\fBTHREAD_NAME_MAX\fR bytes is not guaranteed to be NUL-terminated. Writing to
+this file will set the LWP name for the specific lwp. This file may not be
+present in older operating system versions. \fBTHREAD_NAME_MAX\fR may increase
+in the future; clients should be prepared for this.
.SS "lwpstatus"
.LP
lwp-specific state information. This file contains the \fBlwpstatus\fR