comparison druntime/import/stdc/posix/sched.d @ 760:6f33b427bfd1

Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 12 Nov 2008 00:19:18 +0100
parents
children
comparison
equal deleted inserted replaced
759:d3eb054172f9 760:6f33b427bfd1
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 stdc.posix.sched;
10
11 private import stdc.posix.config;
12 public import stdc.posix.time;
13 public import 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
81 int sched_getparam(pid_t, sched_param*);
82 int sched_getscheduler(pid_t);
83 int sched_setparam(pid_t, in sched_param*);
84 int sched_setscheduler(pid_t, int, in sched_param*);
85
86 //
87 // Thread (THR)
88 //
89 /*
90 int sched_yield();
91 */
92
93 version( linux )
94 {
95 int sched_yield();
96 }
97 else version( darwin )
98 {
99 int sched_yield();
100 }
101 else version( freebsd )
102 {
103 int sched_yield();
104 }
105
106 //
107 // Scheduling (TPS)
108 //
109 /*
110 int sched_get_priority_max(int);
111 int sched_get_priority_min(int);
112 int sched_rr_get_interval(pid_t, timespec*);
113 */
114
115 version( linux )
116 {
117 int sched_get_priority_max(int);
118 int sched_get_priority_min(int);
119 int sched_rr_get_interval(pid_t, timespec*);
120 }
121 else version( darwin )
122 {
123 int sched_get_priority_min(int);
124 int sched_get_priority_max(int);
125 //int sched_rr_get_interval(pid_t, timespec*); // FIXME: unavailable?
126 }
127 else version( freebsd )
128 {
129 int sched_get_priority_min(int);
130 int sched_get_priority_max(int);
131 int sched_rr_get_interval(pid_t, timespec*);
132 }