Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

root/trunk/tango/stdc/posix/sched.d

Revision 4378, 2.9 kB (checked in by fawzi, 3 years ago)

opensolaris support, stremlined large file support

  • Property svn:mime-type set to text/x-dsrc
  • Property svn:eol-style set to native
Line 
1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Public Domain
5  * License:   Public Domain
6  * Authors:   Sean Kelly
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  */
9 module tango.stdc.posix.sched;
10
11 private import tango.stdc.posix.config;
12 public import tango.stdc.posix.time;
13 public import tango.stdc.posix.sys.types;
14
15 extern (C):
16
17 //
18 // Required
19 //
20 /*
21 struct sched_param
22 {
23     int sched_priority (THR)
24     int sched_ss_low_priority (SS|TSP)
25     struct timespec sched_ss_repl_period (SS|TSP)
26     struct timespec sched_ss_init_budget (SS|TSP)
27     int sched_ss_max_repl (SS|TSP)
28 }
29
30 SCHED_FIFO
31 SCHED_RR
32 SCHED_SPORADIC (SS|TSP)
33 SCHED_OTHER
34
35 int sched_getparam(pid_t, sched_param*);
36 int sched_getscheduler(pid_t);
37 int sched_setparam(pid_t, in sched_param*);
38 int sched_setscheduler(pid_t, int, in sched_param*);
39 */
40
41 version( linux )
42 {
43     struct sched_param
44     {
45         int sched_priority;
46     }
47
48     const SCHED_OTHER   = 0;
49     const SCHED_FIFO    = 1;
50     const SCHED_RR      = 2;
51     //SCHED_SPORADIC (SS|TSP)
52 }
53 else version( darwin )
54 {
55     const SCHED_OTHER   = 1;
56     const SCHED_FIFO    = 4;
57     const SCHED_RR      = 2;
58     // SCHED_SPORADIC seems to be unavailable
59
60     private const __SCHED_PARAM_SIZE__ = 4;
61
62     struct sched_param
63     {
64         int                         sched_priority;
65         byte[__SCHED_PARAM_SIZE__]  opaque;
66     }
67 }
68 else version( freebsd )
69 {
70     struct sched_param
71     {
72         int sched_priority;
73     }
74
75     const SCHED_FIFO    = 1;
76     const SCHED_OTHER   = 2;
77     const SCHED_RR      = 3;
78     //SCHED_SPORADIC (SS|TSP)
79 }
80 else version( solaris )
81 {
82     struct sched_param
83     {
84         int     sched_priority;
85         int[8]  sched_pad;
86     }
87
88     const SCHED_FIFO    = 1;
89     const SCHED_OTHER   = 0;
90     const SCHED_RR      = 2;
91     //SCHED_SPORADIC ?
92 }
93
94 int sched_getparam(pid_t, sched_param*);
95 int sched_getscheduler(pid_t);
96 int sched_setparam(pid_t, in sched_param*);
97 int sched_setscheduler(pid_t, int, in sched_param*);
98
99 //
100 // Thread (THR)
101 //
102 /*
103 int sched_yield();
104 */
105
106 version( linux )
107 {
108     int sched_yield();
109 }
110 else version( darwin )
111 {
112     int sched_yield();
113 }
114 else version( freebsd )
115 {
116     int sched_yield();
117 }
118 else version( solaris )
119 {
120     int sched_yield();
121 }
122
123 //
124 // Scheduling (TPS)
125 //
126 /*
127 int sched_get_priority_max(int);
128 int sched_get_priority_min(int);
129 int sched_rr_get_interval(pid_t, timespec*);
130 */
131
132 version( linux )
133 {
134     int sched_get_priority_max(int);
135     int sched_get_priority_min(int);
136     int sched_rr_get_interval(pid_t, timespec*);
137 }
138 else version( darwin )
139 {
140     int sched_get_priority_min(int);
141     int sched_get_priority_max(int);
142     //int sched_rr_get_interval(pid_t, timespec*); // FIXME: unavailable?
143 }
144 else version( freebsd )
145 {
146     int sched_get_priority_min(int);
147     int sched_get_priority_max(int);
148     int sched_rr_get_interval(pid_t, timespec*);
149 }
150 else version( solaris )
151 {
152     int sched_get_priority_min(int);
153     int sched_get_priority_max(int);
154     int sched_rr_get_interval(pid_t, timespec*);
155 }
Note: See TracBrowser for help on using the browser.