Updated msys-1.0.dll to MSYS-g2a9892a
[msysgit.git] / include / sched.h
blob7fd1069d1fe8851359dd961ab4b0dca5f209b4bc
1 /* sched.h: scheduler interface for Cygwin
3 Copyright 2001 Red Hat, Inc.
5 Written by Robert Collins <rbtcollins@hotmail.com>
7 This file is part of Cygwin.
9 This software is a copyrighted work licensed under the terms of the
10 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
11 details. */
13 /* Written from the opengroup specifications */
15 #ifndef _SCHED_H
16 #define _SCHED_H
17 #include <time.h>
19 /* we return -1 and set errno on failure */
20 #define SCHED_FIFO 1
21 #define SCHED_RR 2
22 #define SCHED_OTHER 3
24 struct sched_param
26 int sched_priority;
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 /* max priority for policy */
34 int sched_get_priority_max (int);
35 /* min priority for policy */
36 int sched_get_priority_min (int);
37 /* get sched params for process */
38 int sched_getparam (pid_t, struct sched_param *);
39 /* get the scheduler for pid */
40 int sched_getscheduler (pid_t);
41 /* get the time quantum for pid */
42 int sched_rr_get_interval (pid_t, struct timespec *);
43 /* set the scheduling parameters */
44 int sched_setparam (pid_t, const struct sched_param *);
45 /* set the scheduler */
46 int sched_setscheduler (pid_t, int, const struct sched_param *);
47 /* yield the cpu */
48 int sched_yield (void);
50 #if defined(__INSIDE_CYGWIN__) || defined(__INSIDE_MSYS__)
51 /* These are private helper functions used to calculate scheduler settings and
52 * validate parameters */
54 /* check parameters for validity */
55 int valid_sched_parameters(const struct sched_param *);
56 /* set a single thread's priority */
57 int sched_set_thread_priority(HANDLE thread, int priority);
59 #endif /* __INSIDE_CYGWIN__ || __INSIDE_MSYS__*/
61 #ifdef __cplusplus
63 #endif
64 #endif /* _SCHED_H */