sched.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* sched.h - POSIX scheduler header file */
  2. /* Copyright 1984-1994 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01b,05jan94,kdl  removed include of private/schedP.h.
  7. 01a,04nov93,dvs  written
  8. */
  9. #ifndef __INCschedh
  10. #define __INCschedh
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #include "time.h"
  15. #include "timers.h"
  16. /* scheduling policies */
  17. #define SCHED_FIFO 0x1 /* FIFO per priority scheduling policy */
  18. #define SCHED_RR 0x2 /* round robin scheduling policy */
  19. #define SCHED_OTHER 0x4 /* implementation defined; not currently used */
  20. /* high/low priority values per scheduling policy POSIX numbering */
  21. #define SCHED_FIFO_HIGH_PRI 255 /* POSIX highest priority for FIFO */
  22. #define SCHED_FIFO_LOW_PRI 0 /* POSIX lowest priority for FIFO */
  23. #define SCHED_RR_HIGH_PRI 255 /* POSIX highest priority for RR */
  24. #define SCHED_RR_LOW_PRI 0 /* POSIX lowest priority for RR */
  25. struct sched_param /* Scheduling parameter structure */
  26.     {
  27.     int sched_priority; /* scheduling priority */
  28.     };
  29. /* Function declarations */
  30. #if defined(__STDC__) || defined(__cplusplus)
  31. extern int sched_setparam (pid_t pid, const struct sched_param * param);
  32. extern int sched_getparam (pid_t pid, struct sched_param * param);
  33. extern int sched_setscheduler (pid_t pid, int policy, 
  34.        const struct sched_param * param);
  35. extern int sched_getscheduler (pid_t pid);
  36. extern int sched_yield (void);
  37. extern int sched_get_priority_max (int policy);
  38. extern int sched_get_priority_min (int policy);
  39. extern int sched_rr_get_interval (pid_t pid, struct timespec * interval);
  40. #else   /* __STDC__ */
  41. extern int sched_setparam ();
  42. extern int sched_getparam ();
  43. extern int sched_setscheduler ();
  44. extern int sched_getscheduler ();
  45. extern int sched_yield ();
  46. extern int sched_get_priority_max ();
  47. extern int sched_get_priority_min ();
  48. extern int sched_rr_get_interval ();
  49. #endif  /* __STDC__ */
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif /* __INCschedh */