summaryrefslogtreecommitdiff
path: root/sched.c
diff options
context:
space:
mode:
authorbje <bje>1998-07-23 14:23:46 +0000
committerbje <bje>1998-07-23 14:23:46 +0000
commit55d4602d22dc7d8fb274df3abeb19b2d16230ff1 (patch)
tree6507b1ef22a76c02614b527aa688b455fd25bd0d /sched.c
parentd0c8ee6a9ee8d7faef6cf9353c1244b9906cd743 (diff)
1998-07-24 Ben Elliston <bje@cygnus.com>
* sched.c: New file.
Diffstat (limited to 'sched.c')
-rw-r--r--sched.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/sched.c b/sched.c
new file mode 100644
index 0000000..b4cbc0d
--- /dev/null
+++ b/sched.c
@@ -0,0 +1,45 @@
+/*
+ * sched.c
+ *
+ * Description:
+ * POSIX thread functions that deal with thread scheduling.
+ */
+
+#include "pthread.h"
+
+int
+pthread_attr_setschedparam(pthread_attr_t *attr,
+ const struct sched_param *param)
+{
+ if (is_attr(attr) != 0 || param == NULL)
+ {
+ return EINVAL;
+ }
+
+ attr->priority = param->sched_priority;
+ return 0;
+}
+
+int pthread_attr_getschedparam(const pthread_attr_t *attr,
+ struct sched_param *param)
+{
+ if (is_attr(attr) != 0 || param == NULL)
+ {
+ return EINVAL;
+ }
+
+ param->sched_priority = attr->priority;
+ return 0;
+}
+
+int sched_get_priority_max(int policy)
+{
+ /* This is independent of scheduling policy in Win32. */
+ return THREAD_PRIORITY_HIGHEST;
+}
+
+int sched_get_priority_min(int policy)
+{
+ /* This is independent of scheduling policy in Win32. */
+ return THREAD_PRIORITY_LOWEST;
+}