]> sourceware.org Git - newlib-cygwin.git/commitdiff
2010-04-01 Joel Sherrill <joel.sherrill@oarcorp.com>
authorJeff Johnston <jjohnstn@redhat.com>
Thu, 1 Apr 2010 18:33:37 +0000 (18:33 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Thu, 1 Apr 2010 18:33:37 +0000 (18:33 +0000)
        * libc/include/sched.h: Include prototypes for
        sched_* methods.
        * libc/include/sys/sched.h: Update to POSIX
        1003.1b-2008.  Rework constants to allow sharing
        between RTEMS and Cygwin.

newlib/ChangeLog
newlib/libc/include/sched.h
newlib/libc/include/sys/sched.h

index 4d6016200ff66fdf1af18b131936728424ef97d9..aa661b9635c50afcead7e37eb628ab1b65f7fed9 100644 (file)
@@ -1,3 +1,11 @@
+2010-04-01  Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * libc/include/sched.h: Include prototypes for
+       sched_* methods.
+       * libc/include/sys/sched.h: Update to POSIX
+       1003.1b-2008.  Rework constants to allow sharing
+       between RTEMS and Cygwin.
+
 2010-03-27  Corinna Vinschen  <corinna@vinschen.de>
 
        * libc/locale/locale.c (loadlocale): Optimize "EUC" charset check.
index a59a0f4bace90c9b48e6a10270d102d51664fbd2..504ad5274a495d9198ace76f637c1ece21b75fac 100644 (file)
@@ -1,11 +1,94 @@
+/*
+ *  Written by Joel Sherrill <joel@OARcorp.com>.
+ *
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  Permission to use, copy, modify, and distribute this software for any
+ *  purpose without fee is hereby granted, provided that this entire notice
+ *  is included in all copies of any software which is or includes a copy
+ *  or modification of this software.
+ *
+ *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
+ *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
+ *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
+ *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+ *
+ *  $Id$
+ */
+
 #ifndef _SCHED_H_
 #define _SCHED_H_
 
+#include <sys/types.h>
+#include <sys/sched.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <sys/sched.h>
+#if defined(_POSIX_PRIORITY_SCHEDULING)
+/*
+ *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803
+ */
+int sched_setparam(
+  pid_t                     __pid,
+  const struct sched_param *__param
+);
+
+/*
+ *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800
+ */
+int sched_getparam(
+  pid_t                     __pid,
+  struct sched_param       *__param
+);
+
+/*
+ *  XBD 13 - Set Scheduling Policy and Scheduling Parameters,
+ *         P1003.1b-2008, p. 1805
+ */
+int sched_setscheduler(
+  pid_t                     __pid,
+  int                       __policy,
+  const struct sched_param *__param
+);
+
+/*
+ *  XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801
+ */
+int sched_getscheduler(
+  pid_t                     __pid
+);
+
+/*
+ *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799
+ */
+int sched_get_priority_max(
+  int __policy
+);
+
+int sched_get_priority_min(
+  int  __policy
+);
+
+/*
+ *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802
+ */
+int sched_rr_get_interval(
+  pid_t             __pid,
+  struct timespec  *__interval
+);
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+
+#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
+
+/*
+ *  XBD 13 - Yield Processor, P1003.1b-2008, p. 1807
+ */
+int sched_yield( void );
+
+#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
 
 #ifdef __cplusplus
 }
index 540552199675c683c93fe8df2308a95ef8fdc9b8..58f99d6823f437e28d1b8481b40623b7f2b17390 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Written by Joel Sherrill <joel@OARcorp.com>.
  *
- *  COPYRIGHT (c) 1989-2000.
+ *  COPYRIGHT (c) 1989-2010.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  Permission to use, copy, modify, and distribute this software for any
  */
 
 
-#ifndef __POSIX_SYS_SCHEDULING_h
-#define __POSIX_SYS_SCHEDULING_h
+#ifndef _SYS_SCHED_H_
+#define _SYS_SCHED_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <sys/unistd.h>
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-/* Scheduling Policies, P1003.1b-1993, p. 250
-   NOTE:  SCHED_SPORADIC added by P1003.4b/D8, p. 34.  */
-
+/* Scheduling Policies */
+/* Open Group Specifications Issue 6 */
+#if defined(__CYGWIN__)
+#define SCHED_OTHER    3
+#else
 #define SCHED_OTHER    0
+#endif
+
 #define SCHED_FIFO     1
 #define SCHED_RR       2
 
 #if defined(_POSIX_SPORADIC_SERVER)
-#define SCHED_SPORADIC 
+#define SCHED_SPORADIC 4
 #endif
 
-/* Scheduling Parameters, P1003.1b-1993, p. 249
-   NOTE:  Fields whose name begins with "ss_" added by P1003.4b/D8, p. 33.  */
+/* Scheduling Parameters */
+/* Open Group Specifications Issue 6 */
 
 struct sched_param {
   int sched_priority;           /* Process execution scheduling priority */
 
-#if defined(_POSIX_SPORADIC_SERVER)
-  int ss_low_priority;          /* Low scheduling priority for sporadic */
+#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER)
+  int sched_ss_low_priority;    /* Low scheduling priority for sporadic */
                                 /*   server */
-  struct timespec ss_replenish_period; 
+  struct timespec sched_ss_repl_period;
                                 /* Replenishment period for sporadic server */
-  struct timespec ss_initial_budget;   /* Initial budget for sporadic server */
+  struct timespec sched_ss_init_budget;
+                               /* Initial budget for sporadic server */
+  int sched_ss_max_repl;       /* Maximum pending replenishments for */
+                               /* sporadic server */
 #endif
 };
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 #endif
 /* end of include file */
This page took 0.060013 seconds and 5 git commands to generate.