summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_getprio.c
diff options
context:
space:
mode:
authorJohn Birrell <jb@FreeBSD.org>1999-03-23 05:07:56 +0000
committerJohn Birrell <jb@FreeBSD.org>1999-03-23 05:07:56 +0000
commit58a7cc5d1be640708d2c5e05bf48a8ae379a8d3e (patch)
treeeea0761f32968ad5456e1c13f86e990df50fa554 /lib/libpthread/thread/thr_getprio.c
parentf5a78334492dccb1f3e9debe40f6e1deb14638fd (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_getprio.c')
-rw-r--r--lib/libpthread/thread/thr_getprio.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libpthread/thread/thr_getprio.c b/lib/libpthread/thread/thr_getprio.c
index 708b8f1adf75..b2c94d644e61 100644
--- a/lib/libpthread/thread/thr_getprio.c
+++ b/lib/libpthread/thread/thr_getprio.c
@@ -20,7 +20,7 @@
* THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -38,12 +38,11 @@
int
pthread_getprio(pthread_t pthread)
{
- int ret;
+ int policy, ret;
+ struct sched_param param;
- /* Find the thread in the list of active threads: */
- if ((ret = _find_thread(pthread)) == 0)
- /* Get the thread priority: */
- ret = pthread->pthread_priority;
+ if ((ret = pthread_getschedparam(pthread, &policy, &param)) == 0)
+ ret = param.sched_priority;
else {
/* Invalid thread: */
errno = ret;