]> git.proxmox.com Git - rustc.git/blame - vendor/libc/src/unix/newlib/horizon/mod.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / vendor / libc / src / unix / newlib / horizon / mod.rs
CommitLineData
5099ac24
FG
1//! ARMv6K Nintendo 3DS C Newlib definitions
2
3pub type c_char = u8;
4pub type c_long = i32;
5pub type c_ulong = u32;
6
7pub type wchar_t = ::c_uint;
8
5099ac24
FG
9pub type u_register_t = ::c_uint;
10pub type u_char = ::c_uchar;
11pub type u_short = ::c_ushort;
12pub type u_int = ::c_uint;
13pub type u_long = c_ulong;
14pub type ushort = ::c_ushort;
15pub type uint = ::c_uint;
16pub type ulong = c_ulong;
17pub type clock_t = c_ulong;
18pub type daddr_t = c_long;
19pub type caddr_t = *mut c_char;
20pub type sbintime_t = ::c_longlong;
5e7ed085 21pub type sigset_t = ::c_ulong;
5099ac24 22
5099ac24
FG
23s! {
24 pub struct sockaddr {
25 pub sa_family: ::sa_family_t,
26 pub sa_data: [::c_char; 26usize],
27 }
28
29 pub struct sockaddr_storage {
30 pub ss_family: ::sa_family_t,
31 pub __ss_padding: [::c_char; 26usize],
32 }
33
34 pub struct sockaddr_in {
35 pub sin_family: ::sa_family_t,
5e7ed085 36 pub sin_port: ::in_port_t,
5099ac24
FG
37 pub sin_addr: ::in_addr,
38 }
39
40 pub struct sockaddr_in6 {
41 pub sin6_family: ::sa_family_t,
42 pub sin6_port: ::in_port_t,
43 pub sin6_flowinfo: u32,
44 pub sin6_addr: ::in6_addr,
45 pub sin6_scope_id: u32,
46 }
47
48 pub struct sockaddr_un {
49 pub sun_len: ::c_uchar,
50 pub sun_family: ::sa_family_t,
51 pub sun_path: [::c_char; 104usize],
52 }
5e7ed085
FG
53
54 pub struct sched_param {
55 pub sched_priority: ::c_int,
56 }
57
58 pub struct stat {
59 pub st_dev: ::dev_t,
60 pub st_ino: ::ino_t,
61 pub st_mode: ::mode_t,
62 pub st_nlink: ::nlink_t,
63 pub st_uid: ::uid_t,
64 pub st_gid: ::gid_t,
65 pub st_rdev: ::dev_t,
66 pub st_size: ::off_t,
67 pub st_atim: ::timespec,
68 pub st_mtim: ::timespec,
69 pub st_ctim: ::timespec,
70 pub st_blksize: ::blksize_t,
71 pub st_blocks: ::blkcnt_t,
72 pub st_spare4: [::c_long; 2usize],
73 }
5099ac24
FG
74}
75
76pub const SIGEV_NONE: ::c_int = 1;
77pub const SIGEV_SIGNAL: ::c_int = 2;
78pub const SIGEV_THREAD: ::c_int = 3;
79pub const SA_NOCLDSTOP: ::c_int = 1;
80pub const MINSIGSTKSZ: ::c_int = 2048;
81pub const SIGSTKSZ: ::c_int = 8192;
82pub const SS_ONSTACK: ::c_int = 1;
83pub const SS_DISABLE: ::c_int = 2;
84pub const SIG_SETMASK: ::c_int = 0;
85pub const SIG_BLOCK: ::c_int = 1;
86pub const SIG_UNBLOCK: ::c_int = 2;
87pub const SIGHUP: ::c_int = 1;
88pub const SIGINT: ::c_int = 2;
89pub const SIGQUIT: ::c_int = 3;
90pub const SIGILL: ::c_int = 4;
91pub const SIGTRAP: ::c_int = 5;
92pub const SIGABRT: ::c_int = 6;
93pub const SIGEMT: ::c_int = 7;
94pub const SIGFPE: ::c_int = 8;
95pub const SIGKILL: ::c_int = 9;
96pub const SIGBUS: ::c_int = 10;
97pub const SIGSEGV: ::c_int = 11;
98pub const SIGSYS: ::c_int = 12;
99pub const SIGPIPE: ::c_int = 13;
100pub const SIGALRM: ::c_int = 14;
101pub const SIGTERM: ::c_int = 15;
102pub const SIGURG: ::c_int = 16;
103pub const SIGSTOP: ::c_int = 17;
104pub const SIGTSTP: ::c_int = 18;
105pub const SIGCONT: ::c_int = 19;
106pub const SIGCHLD: ::c_int = 20;
107pub const SIGCLD: ::c_int = 20;
108pub const SIGTTIN: ::c_int = 21;
109pub const SIGTTOU: ::c_int = 22;
110pub const SIGIO: ::c_int = 23;
111pub const SIGPOLL: ::c_int = 23;
112pub const SIGXCPU: ::c_int = 24;
113pub const SIGXFSZ: ::c_int = 25;
114pub const SIGVTALRM: ::c_int = 26;
115pub const SIGPROF: ::c_int = 27;
116pub const SIGWINCH: ::c_int = 28;
117pub const SIGLOST: ::c_int = 29;
118pub const SIGUSR1: ::c_int = 30;
119pub const SIGUSR2: ::c_int = 31;
120pub const NSIG: ::c_int = 32;
121pub const CLOCK_ENABLED: ::c_uint = 1;
122pub const CLOCK_DISABLED: ::c_uint = 0;
123pub const CLOCK_ALLOWED: ::c_uint = 1;
124pub const CLOCK_DISALLOWED: ::c_uint = 0;
125pub const TIMER_ABSTIME: ::c_uint = 4;
126pub const SOL_SOCKET: ::c_int = 65535;
127pub const MSG_OOB: ::c_int = 1;
128pub const MSG_PEEK: ::c_int = 2;
129pub const MSG_DONTWAIT: ::c_int = 4;
130pub const MSG_DONTROUTE: ::c_int = 0;
131pub const MSG_WAITALL: ::c_int = 0;
132pub const MSG_MORE: ::c_int = 0;
133pub const MSG_NOSIGNAL: ::c_int = 0;
134pub const SOL_CONFIG: ::c_uint = 65534;
135
136pub const _SC_PAGESIZE: ::c_int = 8;
137pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51;
138
139pub const PTHREAD_STACK_MIN: ::size_t = 4096;
140pub const WNOHANG: ::c_int = 1;
141
142pub const POLLIN: ::c_short = 0x0001;
143pub const POLLPRI: ::c_short = 0x0002;
144pub const POLLOUT: ::c_short = 0x0004;
145pub const POLLRDNORM: ::c_short = 0x0040;
146pub const POLLWRNORM: ::c_short = POLLOUT;
147pub const POLLRDBAND: ::c_short = 0x0080;
148pub const POLLWRBAND: ::c_short = 0x0100;
149pub const POLLERR: ::c_short = 0x0008;
150pub const POLLHUP: ::c_short = 0x0010;
151pub const POLLNVAL: ::c_short = 0x0020;
152
153pub const EAI_AGAIN: ::c_int = 2;
154pub const EAI_BADFLAGS: ::c_int = 3;
155pub const EAI_FAIL: ::c_int = 4;
156pub const EAI_SERVICE: ::c_int = 9;
157pub const EAI_SYSTEM: ::c_int = 11;
158pub const EAI_BADHINTS: ::c_int = 12;
159pub const EAI_PROTOCOL: ::c_int = 13;
160pub const EAI_OVERFLOW: ::c_int = 14;
161pub const EAI_MAX: ::c_int = 15;
162
163pub const AF_UNIX: ::c_int = 1;
164pub const AF_INET6: ::c_int = 23;
165
166pub const FIONBIO: ::c_ulong = 1;
167
168pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void;
169
5e7ed085
FG
170// For pthread get/setschedparam
171pub const SCHED_FIFO: ::c_int = 1;
172pub const SCHED_RR: ::c_int = 2;
173
174// For getrandom()
175pub const GRND_NONBLOCK: ::c_uint = 0x1;
176pub const GRND_RANDOM: ::c_uint = 0x2;
177
5099ac24
FG
178// Horizon OS works doesn't or can't hold any of this information
179safe_f! {
180 pub {const} fn WIFSTOPPED(_status: ::c_int) -> bool {
181 false
182 }
183
184 pub {const} fn WSTOPSIG(_status: ::c_int) -> ::c_int {
185 0
186 }
187
188 pub {const} fn WIFCONTINUED(_status: ::c_int) -> bool {
189 true
190 }
191
192 pub {const} fn WIFSIGNALED(_status: ::c_int) -> bool {
193 false
194 }
195
196 pub {const} fn WTERMSIG(_status: ::c_int) -> ::c_int {
197 0
198 }
199
200 pub {const} fn WIFEXITED(_status: ::c_int) -> bool {
201 true
202 }
203
204 pub {const} fn WEXITSTATUS(_status: ::c_int) -> ::c_int {
205 0
206 }
207
208 pub {const} fn WCOREDUMP(_status: ::c_int) -> bool {
209 false
210 }
211}
212
213extern "C" {
214 pub fn pthread_create(
215 native: *mut ::pthread_t,
216 attr: *const ::pthread_attr_t,
217 f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void,
218 value: *mut ::c_void,
219 ) -> ::c_int;
220
5e7ed085
FG
221 pub fn pthread_attr_getschedparam(
222 attr: *const ::pthread_attr_t,
223 param: *mut sched_param,
224 ) -> ::c_int;
225
226 pub fn pthread_attr_setschedparam(
227 attr: *mut ::pthread_attr_t,
228 param: *const sched_param,
229 ) -> ::c_int;
230
231 pub fn pthread_attr_getprocessorid_np(
232 attr: *const ::pthread_attr_t,
233 processor_id: *mut ::c_int,
234 ) -> ::c_int;
235
236 pub fn pthread_attr_setprocessorid_np(
237 attr: *mut ::pthread_attr_t,
238 processor_id: ::c_int,
239 ) -> ::c_int;
240
241 pub fn pthread_getschedparam(
242 native: ::pthread_t,
243 policy: *mut ::c_int,
244 param: *mut ::sched_param,
245 ) -> ::c_int;
246
247 pub fn pthread_setschedparam(
248 native: ::pthread_t,
249 policy: ::c_int,
250 param: *const ::sched_param,
251 ) -> ::c_int;
252
04454e1e
FG
253 pub fn pthread_condattr_getclock(
254 attr: *const ::pthread_condattr_t,
255 clock_id: *mut ::clockid_t,
256 ) -> ::c_int;
257
258 pub fn pthread_condattr_setclock(
259 attr: *mut ::pthread_condattr_t,
260 clock_id: ::clockid_t,
261 ) -> ::c_int;
262
5e7ed085
FG
263 pub fn pthread_getprocessorid_np() -> ::c_int;
264
265 pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
266
5099ac24
FG
267 pub fn gethostid() -> ::c_long;
268}