summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-11-22 00:03:36 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-11-22 00:03:36 +0300
commitf186efffe815fb74617aeaaafca5f081ea80126d (patch)
tree6ffe19d2be0d793d72c929a963247359e4f46ad4
parent5708cdcef697f65763f1f7c573b7ba3c2efa6e4b (diff)
downloadillumos-packaging-f186efffe815fb74617aeaaafca5f081ea80126d.tar.gz
libc: backport pthread_attr_get_np
-rw-r--r--libc/debian/libc1-illumos-i386.symbols3
-rw-r--r--libc/debian/libc1.symbols.illumos-amd643
-rw-r--r--libc/debian/patches/illumos-6501-pthread_attr_get_np.patch557
-rw-r--r--libc/debian/patches/series1
4 files changed, 564 insertions, 0 deletions
diff --git a/libc/debian/libc1-illumos-i386.symbols b/libc/debian/libc1-illumos-i386.symbols
index cd5dfe5..4afa142 100644
--- a/libc/debian/libc1-illumos-i386.symbols
+++ b/libc/debian/libc1-illumos-i386.symbols
@@ -1951,6 +1951,8 @@ libc.so.1 libc1-illumos-i386 #MINVER#
psignal@SUNW_0.7 2.10-1
pthread_atfork@SUNW_1.1 2.10-1
pthread_attr_destroy@SUNW_1.1 2.10-1
+ pthread_attr_get_np@DYSON_1 5.10.18.git.2a44663-4
+ pthread_attr_getdaemonstate_np@SUNWprivate_1.1 5.10.18.git.2a44663-4
pthread_attr_getdetachstate@SUNW_1.1 2.10-1
pthread_attr_getguardsize@SUNW_1.18 2.10-1
pthread_attr_getinheritsched@SUNW_1.1 2.10-1
@@ -1961,6 +1963,7 @@ libc.so.1 libc1-illumos-i386 #MINVER#
pthread_attr_getstackaddr@SUNW_1.1 2.10-1
pthread_attr_getstacksize@SUNW_1.1 2.10-1
pthread_attr_init@SUNW_1.1 2.10-1
+ pthread_attr_setdaemonstate_np@SUNWprivate_1.1 5.10.18.git.2a44663-4
pthread_attr_setdetachstate@SUNW_1.1 2.10-1
pthread_attr_setguardsize@SUNW_1.18 2.10-1
pthread_attr_setinheritsched@SUNW_1.1 2.10-1
diff --git a/libc/debian/libc1.symbols.illumos-amd64 b/libc/debian/libc1.symbols.illumos-amd64
index 529dc1a..9c61f29 100644
--- a/libc/debian/libc1.symbols.illumos-amd64
+++ b/libc/debian/libc1.symbols.illumos-amd64
@@ -1833,6 +1833,8 @@ libc.so.1 libc1 #MINVER#
psignal@SUNW_0.7 2.10-1
pthread_atfork@SUNW_1.1 2.10-1
pthread_attr_destroy@SUNW_1.1 2.10-1
+ pthread_attr_get_np@DYSON_1 5.10.18.git.2a44663-4
+ pthread_attr_getdaemonstate_np@SUNWprivate_1.1 5.10.18.git.2a44663-4
pthread_attr_getdetachstate@SUNW_1.1 2.10-1
pthread_attr_getguardsize@SUNW_1.18 2.10-1
pthread_attr_getinheritsched@SUNW_1.1 2.10-1
@@ -1843,6 +1845,7 @@ libc.so.1 libc1 #MINVER#
pthread_attr_getstackaddr@SUNW_1.1 2.10-1
pthread_attr_getstacksize@SUNW_1.1 2.10-1
pthread_attr_init@SUNW_1.1 2.10-1
+ pthread_attr_setdaemonstate_np@SUNWprivate_1.1 5.10.18.git.2a44663-4
pthread_attr_setdetachstate@SUNW_1.1 2.10-1
pthread_attr_setguardsize@SUNW_1.18 2.10-1
pthread_attr_setinheritsched@SUNW_1.1 2.10-1
diff --git a/libc/debian/patches/illumos-6501-pthread_attr_get_np.patch b/libc/debian/patches/illumos-6501-pthread_attr_get_np.patch
new file mode 100644
index 0000000..b526bc6
--- /dev/null
+++ b/libc/debian/patches/illumos-6501-pthread_attr_get_np.patch
@@ -0,0 +1,557 @@
+commit e56998eefc33ead0f12b364be915dd6bfc12a3f5
+Author: Robert Mustacchi <rm@joyent.com>
+Date: Mon Apr 11 08:27:29 2016 -0700
+
+ 6501 Implement pthread_attr_get_np() interface
+ Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
+ Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ Approved by: Garrett D'Amore <garrett@damore.org>
+
+Index: libc/usr/src/head/pthread.h
+===================================================================
+--- libc.orig/usr/src/head/pthread.h
++++ libc/usr/src/head/pthread.h
+@@ -21,6 +21,7 @@
+
+ /*
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
++ * Copyright 2016 Joyent, Inc.
+ *
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+@@ -332,6 +333,14 @@ extern int pthread_mutexattr_setrobust_n
+ extern int pthread_mutexattr_getrobust_np(
+ const pthread_mutexattr_t *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
+
++/*
++ * These are non-standardized extensions that we provide. Their origins are
++ * documented in their manual pages.
++ */
++#if !defined(_STRICT_SYMBOLS) || defined(__EXTENSIONS__)
++extern int pthread_attr_get_np(pthread_t, pthread_attr_t *);
++#endif /* !_STRICT_SYMBOLS || __EXTENSIONS__ */
++
+ #endif /* _ASM */
+
+ #ifdef __cplusplus
+Index: libc/usr/src/lib/libc/inc/thr_uberdata.h
+===================================================================
+--- libc.orig/usr/src/lib/libc/inc/thr_uberdata.h
++++ libc/usr/src/lib/libc/inc/thr_uberdata.h
+@@ -679,6 +679,7 @@ typedef struct ulwp {
+ void *ul_unwind_ret; /* used only by _ex_clnup_handler() */
+ #endif
+ tumem_t ul_tmem; /* used only by umem */
++ uint_t ul_ptinherit; /* pthreads sched inherit value */
+ } ulwp_t;
+
+ #define ul_cursig ul_cp.s.cursig /* deferred signal number */
+Index: libc/usr/src/lib/libc/port/mapfile-vers
+===================================================================
+--- libc.orig/usr/src/lib/libc/port/mapfile-vers
++++ libc/usr/src/lib/libc/port/mapfile-vers
+@@ -292,6 +292,7 @@ SYMBOL_VERSION DYSON_1 {
+ mkostemps;
+ program_invocation_name;
+ program_invocation_short_name;
++ pthread_attr_get_np;
+ qsort_r;
+ rawmemchr;
+ sendfile;
+@@ -2999,6 +3000,8 @@ $endif
+ pset_assign_forced;
+ pset_bind_lwp;
+ _psignal;
++ pthread_attr_getdaemonstate_np;
++ pthread_attr_setdaemonstate_np;
+ _pthread_setcleanupinit;
+ __putwchar_xpg5;
+ __putwc_xpg5;
+Index: libc/usr/src/lib/libc/port/threads/pthr_attr.c
+===================================================================
+--- libc.orig/usr/src/lib/libc/port/threads/pthr_attr.c
++++ libc/usr/src/lib/libc/port/threads/pthr_attr.c
+@@ -24,6 +24,10 @@
+ * Use is subject to license terms.
+ */
+
++/*
++ * Copyright 2015, Joyent, Inc.
++ */
++
+ #include "lint.h"
+ #include "thr_uberdata.h"
+ #include <sched.h>
+@@ -242,7 +246,8 @@ pthread_attr_setdaemonstate_np(pthread_a
+
+ /*
+ * pthread_attr_getdaemonstate_np: gets the daemon state.
+- * For now, this is a private interface in libc.
++ * For now, this is a private interface in libc, but it is exposed in the
++ * mapfile for the purposes of testing only.
+ */
+ int
+ pthread_attr_getdaemonstate_np(const pthread_attr_t *attr, int *daemonstate)
+@@ -366,7 +371,7 @@ pthread_attr_getschedpolicy(const pthrea
+ */
+ int
+ pthread_attr_setschedparam(pthread_attr_t *attr,
+- const struct sched_param *param)
++ const struct sched_param *param)
+ {
+ thrattr_t *ap;
+
+@@ -385,7 +390,7 @@ pthread_attr_setschedparam(pthread_attr_
+ #pragma weak _pthread_attr_getschedparam = pthread_attr_getschedparam
+ int
+ pthread_attr_getschedparam(const pthread_attr_t *attr,
+- struct sched_param *param)
++ struct sched_param *param)
+ {
+ thrattr_t *ap;
+
+@@ -437,7 +442,7 @@ pthread_attr_getguardsize(const pthread_
+ */
+ int
+ pthread_attr_setstack(pthread_attr_t *attr,
+- void *stackaddr, size_t stacksize)
++ void *stackaddr, size_t stacksize)
+ {
+ thrattr_t *ap;
+
+@@ -458,7 +463,7 @@ pthread_attr_setstack(pthread_attr_t *at
+ */
+ int
+ pthread_attr_getstack(const pthread_attr_t *attr,
+- void **stackaddr, size_t *stacksize)
++ void **stackaddr, size_t *stacksize)
+ {
+ thrattr_t *ap;
+
+@@ -470,3 +475,85 @@ pthread_attr_getstack(const pthread_attr
+ }
+ return (EINVAL);
+ }
++
++/*
++ * This function is a common BSD extension to pthread which is used to obtain
++ * the attributes of a thread that might have changed after its creation, for
++ * example, it's stack address.
++ *
++ * Note, there is no setattr analogue, nor do we desire to add one at this time.
++ * Similarly there is no native threads API analogue (nor should we add one for
++ * C11).
++ *
++ * The astute reader may note that there is a GNU version of this called
++ * pthread_getattr_np(). The two functions are similar, but subtley different in
++ * a rather important way. While the pthread_attr_get_np() expects to be given
++ * a pthread_attr_t that has had pthread_attr_init() called on in,
++ * pthread_getattr_np() does not. However, on GNU systems, where the function
++ * originates, the pthread_attr_t is not opaque and thus it is entirely safe to
++ * both call pthread_attr_init() and then call pthread_getattr_np() on the same
++ * attributes object. On illumos, since the pthread_attr_t is opaque, that would
++ * be a memory leak. As such, we don't provide it.
++ */
++int
++pthread_attr_get_np(pthread_t tid, pthread_attr_t *attr)
++{
++ int ret;
++ ulwp_t *self = curthread;
++ uberdata_t *udp = self->ul_uberdata;
++ ulwp_t *target = NULL;
++ thrattr_t *ap;
++
++ /*
++ * To ensure that information about the target thread does not change or
++ * disappear while we're trying to interrogate it, we grab the uwlp
++ * lock.
++ */
++ if (self->ul_lwpid == tid) {
++ ulwp_lock(self, udp);
++ target = self;
++ } else {
++ target = find_lwp(tid);
++ if (target == NULL)
++ return (ESRCH);
++ }
++
++ if (attr == NULL) {
++ ret = EINVAL;
++ goto out;
++ }
++
++ if ((ap = attr->__pthread_attrp) == NULL) {
++ ret = EINVAL;
++ goto out;
++ }
++
++ ap->stksize = target->ul_stksiz;
++ ap->stkaddr = target->ul_stk;
++ if (target->ul_usropts & THR_DETACHED) {
++ ap->detachstate = PTHREAD_CREATE_DETACHED;
++ } else {
++ ap->detachstate = PTHREAD_CREATE_JOINABLE;
++ }
++
++ if (target->ul_usropts & THR_DAEMON) {
++ ap->daemonstate = PTHREAD_CREATE_DAEMON_NP;
++ } else {
++ ap->daemonstate = PTHREAD_CREATE_NONDAEMON_NP;
++ }
++
++ if (target->ul_usropts & THR_BOUND) {
++ ap->scope = PTHREAD_SCOPE_SYSTEM;
++ } else {
++ ap->scope = PTHREAD_SCOPE_PROCESS;
++ }
++ ap->prio = target->ul_pri;
++ ap->policy = target->ul_policy;
++ ap->inherit = target->ul_ptinherit;
++ ap->guardsize = target->ul_guardsize;
++
++ ret = 0;
++out:
++ ulwp_unlock(target, udp);
++ return (ret);
++}
+Index: libc/usr/src/lib/libc/port/threads/pthread.c
+===================================================================
+--- libc.orig/usr/src/lib/libc/port/threads/pthread.c
++++ libc/usr/src/lib/libc/port/threads/pthread.c
+@@ -23,8 +23,9 @@
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+-
+-#pragma ident "%Z%%M% %I% %E% SMI"
++/*
++ * Copyright 2016 Joyent, Inc.
++ */
+
+ #include "lint.h"
+ #include "thr_uberdata.h"
+@@ -46,6 +47,22 @@ typedef struct __once {
+ #define once_flag oflag.pad32_flag[1]
+
+ static int
++_thr_setinherit(pthread_t tid, int inherit)
++{
++ ulwp_t *ulwp;
++ int error = 0;
++
++ if ((ulwp = find_lwp(tid)) == NULL) {
++ error = ESRCH;
++ } else {
++ ulwp->ul_ptinherit = inherit;
++ ulwp_unlock(ulwp, curthread->ul_uberdata);
++ }
++
++ return (error);
++}
++
++static int
+ _thr_setparam(pthread_t tid, int policy, int prio)
+ {
+ ulwp_t *ulwp;
+@@ -88,7 +105,7 @@ _thr_setparam(pthread_t tid, int policy,
+ #pragma weak _pthread_create = pthread_create
+ int
+ pthread_create(pthread_t *thread, const pthread_attr_t *attr,
+- void * (*start_routine)(void *), void *arg)
++ void * (*start_routine)(void *), void *arg)
+ {
+ ulwp_t *self = curthread;
+ const thrattr_t *ap = attr? attr->__pthread_attrp : def_thrattr();
+@@ -113,15 +130,25 @@ pthread_create(pthread_t *thread, const
+ error = _thrp_create(ap->stkaddr, ap->stksize, start_routine, arg,
+ flag, &tid, ap->guardsize);
+ if (error == 0) {
++ /*
++ * Record the original inheritence value for
++ * pthread_getattr_np(). We should always be able to find the
++ * thread.
++ */
++ (void) _thr_setinherit(tid, ap->inherit);
++
+ if (ap->inherit == PTHREAD_EXPLICIT_SCHED &&
+ (ap->policy != self->ul_policy ||
+- ap->prio != (self->ul_epri? self->ul_epri : self->ul_pri)))
++ ap->prio != (self->ul_epri ? self->ul_epri :
++ self->ul_pri))) {
+ /*
+ * The SUSv3 specification requires pthread_create()
+ * to fail with EPERM if it cannot set the scheduling
+ * policy and parameters on the new thread.
+ */
+ error = _thr_setparam(tid, ap->policy, ap->prio);
++ }
++
+ if (error) {
+ /*
+ * We couldn't determine this error before
+@@ -243,7 +270,7 @@ thr_getprio(thread_t tid, int *priority)
+ */
+ int
+ pthread_setschedparam(pthread_t tid,
+- int policy, const struct sched_param *param)
++ int policy, const struct sched_param *param)
+ {
+ return (_thr_setparam(tid, policy, param->sched_priority));
+ }
+Index: libc/usr/src/man/man3c/pthread_attr_get_np.3c
+===================================================================
+--- /dev/null
++++ libc/usr/src/man/man3c/pthread_attr_get_np.3c
+@@ -0,0 +1,198 @@
++.\"
++.\" 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 2016 Joyent, Inc.
++.\"
++.Dd Feb 07, 2015
++.Dt PTHREAD_ATTR_GET_NP 3C
++.Os
++.Sh NAME
++.Nm pthread_attr_get_np
++.Nd get pthread attributes of a running thread
++.Sh SYNOPSIS
++.In pthread.h
++.Ft int
++.Fo pthread_attr_get_np
++.Fa "pthread_t thread"
++.Fa "pthread_attr_t *attr"
++.Fc
++.Sh DESCRIPTION
++The
++.Fn pthread_attr_get_np
++function provides a way to get the attributes of the thread
++.Fa thread
++after it has been created. This function is most commonly used to obtain
++the actual location and size of a thread's stack.
++.Pp
++The attributes pointer,
++.Fa attr ,
++will be filled in with the current attributes for the thread. The
++attributes should be allocated by a call to
++.Xr pthread_attr_init 3C
++prior to calling the
++.Fn pthrad_attr_get_np
++function. When
++.Fa attr
++is done being used, it should be destroyed through a call to
++.Xr pthread_attr_destroy 3C .
++.Pp
++The attributes of the thread
++.Fa thread
++will be the same as those passed in at the time
++.Xr pthread_create 3C
++was called (or the default set if none were specified), except that the
++following values will be updated:
++.Bl -tag -width Sy
++.It Sy Thread Stack Size
++If no explicit stack size was specified, then
++.Fa attr
++will contain the actual size of the stack.
++.Pp
++If the size of the stack was specified, then it may have been changed to
++ensure that the required alignment of the platform is satisfied.
++.It Sy The Stack Address
++If no stack address was specified, then
++.Fa attr
++will contain the actual address of the stack that the system allocated
++for the thread.
++.It Sy Thread Detach State
++The detach state, whether or not the thread may be joined by a call to
++.Xr pthread_join 3C ,
++may have changed since the process was created due to a call to
++.Xr pthread_detach 3C .
++.Fa attr
++will reflect the current setting of
++.Fa thread .
++.It Sy Thread Scheduling Parameter
++The scheduling parameter attribute will be updated with the current
++scheduling parameter of
++.Fa thread .
++This is the same information as available through
++.Xr pthread_getschedparam 3C
++and it is the preferred interface for obtaining that information.
++.It Sy Thread Scheduling Policy
++The scheduling policy attribute of
++.Fa attr
++will be updated with the current scheduling policy being applied to the
++thread. This may have changed, for example, due to a call to
++.Xr pthread_setschedparam 3C .
++As with the thread's scheduling parameter, the preferred interface for
++obtaining this information is by using
++.Xr pthread_getschedparam 3C .
++.It Sy Thread Guard Size
++The value of the guard size attribute for the thread will be updated to
++reflect the actual size of the guard installed for
++.Fa thread .
++For more information on the guard size of a thread and its purpose, see
++.Xr pthread_attr_getguardsize 3C .
++.El
++.Sh RETURN VALUES
++Upon successful completion, the
++.Fn pthread_attr_get_np
++and
++.Fn pthread_getattr_np
++functions return
++.Sy 0 .
++Otherwise, an error number is returned to indicate the error.
++.Sh EXAMPLES
++The following program demonstrates how to use these functions to get
++the location and stack size of a newly created thread.
++.Bd -literal
++#include <assert.h>
++#include <errno.h>
++#include <pthread.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++static pthread_t g_thr;
++
++void *
++print_stackinfo(void *arg)
++{
++ int ret;
++ pthread_attr_t attr;
++ pthread_t *thrp = arg;
++ void *stk;
++ size_t stksize;
++
++ if (pthread_attr_init(&attr) != 0) {
++ fprintf(stderr, "failed to init attr: %s\\n",
++ strerror(errno));
++ exit(1);
++ }
++
++ if (pthread_attr_get_np(*thrp, &attr) != 0) {
++ fprintf(stderr, "failed to get thread attributes: %s\\n",
++ strerror(errno));
++ exit(1);
++ }
++
++ ret = pthread_attr_getstackaddr(&attr, &stk);
++ assert(ret == 0);
++ ret = pthread_attr_getstacksize(&attr, &stksize);
++ assert(ret == 0);
++ (void) printf("stack base is at %p, it is %d bytes large\\n",
++ stk, stksize);
++ return (NULL);
++}
++
++int
++main(void)
++{
++ int ret;
++
++ if ((ret = pthread_create(&g_thr, NULL, print_stackinfo,
++ &g_thr) != 0)) {
++ fprintf(stderr, "failed to create a thread: %s\\n",
++ strerror(errno));
++ exit(1);
++ }
++
++ pthread_join(g_thr, NULL);
++ return (0);
++}
++.Ed
++.Sh ERRORS
++The
++.Fn pthread_attr_get_np
++function will fail if:
++.Bl -tag -width Er
++.It Er EINVAL
++The pthread_attr_t object
++.Fa attr
++was not properly initialized with a call to
++.Xr pthread_attr_init 3C .
++.It Er ESRCH
++No thread could be found corresponding to the specified thread ID,
++.Fa thread .
++.El
++.Sh INTERFACE STABILITY
++.Sy Committed
++.Sh MT-LEVEL
++.Sy MT-Safe
++.Sh SEE ALSO
++.Xr pthread_attr_destroy 3C ,
++.Xr pthread_attr_getdetachstate 3C ,
++.Xr pthread_attr_getguardsize 3C ,
++.Xr pthread_attr_getinheritsched 3C ,
++.Xr pthread_attr_getschedparam 3C ,
++.Xr pthread_attr_getschedpolicy 3C ,
++.Xr pthread_attr_getscope 3C ,
++.Xr pthread_attr_getstackaddr 3C ,
++.Xr pthread_attr_getstacksize 3C ,
++.Xr pthread_attr_init 3C ,
++.Xr pthread_create 3C ,
++.Xr pthread_detach 3C ,
++.Xr pthread_getschedparam 3C ,
++.Xr pthread_setschedparam 3C ,
++.Xr attributes 5 ,
++.Xr threads 5
+Index: libc/usr/src/man/man3c/pthread_attr_init.3c
+===================================================================
+--- libc.orig/usr/src/man/man3c/pthread_attr_init.3c
++++ libc/usr/src/man/man3c/pthread_attr_init.3c
+@@ -9,7 +9,7 @@
+ .\" 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 PTHREAD_ATTR_INIT 3C "Apr 1, 2008"
++.TH PTHREAD_ATTR_INIT 3C "Dec 10, 2015"
+ .SH NAME
+ pthread_attr_init, pthread_attr_destroy \- initialize or destroy threads
+ attribute object
+@@ -28,7 +28,6 @@ cc -mt [ \fIflag\fR... ] \fIfile\fR... -
+ .fi
+
+ .SH DESCRIPTION
+-.sp
+ .LP
+ The function \fBpthread_attr_init()\fR initializes a thread attributes object
+ \fIattr\fR with the default value for all of the individual attributes used by
+@@ -73,13 +72,11 @@ implementation may cause \fBpthread_attr
+ implementation-dependent invalid value. The behavior of using the attribute
+ after it has been destroyed is undefined.
+ .SH RETURN VALUES
+-.sp
+ .LP
+ Upon successful completion, \fBpthread_attr_init()\fR and
+ \fBpthread_attr_destroy()\fR return a value of \fB0\fR. Otherwise, an error
+ number is returned to indicate the error.
+ .SH ERRORS
+-.sp
+ .LP
+ The \fBpthread_attr_init()\fR function will fail if:
+ .sp
+@@ -104,7 +101,6 @@ The \fBpthread_attr_destroy()\fR functi
+ .RE
+
+ .SH ATTRIBUTES
+-.sp
+ .LP
+ See \fBattributes\fR(5) for descriptions of the following attributes:
+ .sp
+@@ -124,9 +120,9 @@ Standard See \fBstandards\fR(5).
+ .TE
+
+ .SH SEE ALSO
+-.sp
+ .LP
+ \fBsysconf\fR(3C), \fBpthread_attr_getdetachstate\fR(3C),
++\fBpthread_attr_get_np\fR(3C),
+ \fBpthread_attr_getguardsize\fR(3C), \fBpthread_attr_getinheritsched\fR(3C),
+ \fBpthread_attr_getschedparam\fR(3C), \fBpthread_attr_getschedpolicy\fR(3C),
+ \fBpthread_attr_getscope\fR(3C), \fBpthread_attr_getstackaddr\fR(3C),
diff --git a/libc/debian/patches/series b/libc/debian/patches/series
index 208ba21..97e9c73 100644
--- a/libc/debian/patches/series
+++ b/libc/debian/patches/series
@@ -145,3 +145,4 @@ libc-math-include-ieeefp.patch
math.h-feature.patch
nameser.h-types.patch
libm-macro.patch
+illumos-6501-pthread_attr_get_np.patch