summaryrefslogtreecommitdiff
path: root/nuttx/sched/pthread_getschedparam.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched/pthread_getschedparam.c')
-rw-r--r--nuttx/sched/pthread_getschedparam.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/nuttx/sched/pthread_getschedparam.c b/nuttx/sched/pthread_getschedparam.c
index 462c6c320..c376fd400 100644
--- a/nuttx/sched/pthread_getschedparam.c
+++ b/nuttx/sched/pthread_getschedparam.c
@@ -1,8 +1,8 @@
-/********************************************************************************************
+/****************************************************************************
* pthread_getschedparam.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <sys/types.h>
#include <pthread.h>
@@ -44,46 +44,46 @@
#include <debug.h>
#include "pthread_internal.h"
-/********************************************************************************************
+/****************************************************************************
* Definitions
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Private Type Declarations
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Global Variables
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Private Variables
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Private Functions
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Public Functions
- *********************************************************************************************/
+ *****************************************************************************/
-/********************************************************************************************
- * Function: pthread_getschedparam
+/****************************************************************************
+ * Name: pthread_getschedparam
*
* Description:
* The pthread_getschedparam() functions will get the scheduling policy and
* parameters of threads. For SCHED_FIFO and SCHED_RR, the only required
* member of the sched_param structure is the priority sched_priority.
*
- * The pthread_getschedparam() function will retrieve the scheduling policy
- * and scheduling parameters for the thread whose thread ID is given by
- * 'thread' and will store those values in 'policy' and 'param',
+ * The pthread_getschedparam() function will retrieve the scheduling
+ * policy and scheduling parameters for the thread whose thread ID is
+ * given by 'thread' and will store those values in 'policy' and 'param',
* respectively. The priority value returned from pthread_getschedparam()
* will be the value specified by the most recent pthread_setschedparam(),
* pthread_setschedprio(), or pthread_create() call affecting the target
- * thread. It will not reflect any temporary adjustments to its priority (such
- * as might result of any priority inheritance, for example).
+ * thread. It will not reflect any temporary adjustments to its priority
+ * (such as might result of any priority inheritance, for example).
*
* The policy parameter may have the value SCHED_FIFO, or SCHED_RR
* (SCHED_OTHER and SCHED_SPORADIC, in particular, are not supported).
@@ -101,9 +101,10 @@
*
* Assumptions:
*
- ********************************************************************************************/
+ ****************************************************************************/
-int pthread_getschedparam(pthread_t thread, FAR int *policy, FAR struct sched_param *param)
+int pthread_getschedparam(pthread_t thread, FAR int *policy,
+ FAR struct sched_param *param)
{
int ret;
@@ -128,7 +129,7 @@ int pthread_getschedparam(pthread_t thread, FAR int *policy, FAR struct sched_pa
*policy = sched_getscheduler((pid_t)thread);
if (*policy == ERROR)
{
- ret = *get_errno_ptr();
+ ret = get_errno();
}
}