sched.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
  2. Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef _SCHED_H
  17. #define _SCHED_H 1
  18. #include <features.h>
  19. /* Get type definitions. */
  20. #include <bits/types.h>
  21. #define __need_timespec
  22. #include <time.h>
  23. /* Get system specific constant and data structure definitions. */
  24. #include <bits/sched.h>
  25. /* Define the real names for the elements of `struct sched_param'. */
  26. #define sched_priority __sched_priority
  27. __BEGIN_DECLS
  28. /* Set scheduling parameters for a process. */
  29. extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
  30. __THROW;
  31. /* Retrieve scheduling parameters for a particular process. */
  32. extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __THROW;
  33. /* Set scheduling algorithm and/or parameters for a process. */
  34. extern int sched_setscheduler (__pid_t __pid, int __policy,
  35. __const struct sched_param *__param) __THROW;
  36. /* Retrieve scheduling algorithm for a particular purpose. */
  37. extern int sched_getscheduler (__pid_t __pid) __THROW;
  38. /* Yield the processor. */
  39. extern int sched_yield (void) __THROW;
  40. /* Get maximum priority value for a scheduler. */
  41. extern int sched_get_priority_max (int __algorithm) __THROW;
  42. /* Get minimum priority value for a scheduler. */
  43. extern int sched_get_priority_min (int __algorithm) __THROW;
  44. /* Get the SCHED_RR interval for the named process. */
  45. extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
  46. /* These are Linux specific. */
  47. extern int __clone (int (*__fn) (void *__arg), void *__child_stack,
  48. int __flags, void *__arg, ...);
  49. extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
  50. size_t __child_stack_size, int __flags, void *__arg, ...);
  51. __END_DECLS
  52. #endif /* sched.h */