1 // This module contains bindings to the native Haiku API. The Haiku API
2 // originates from BeOS, and it was the original way to perform low level
3 // system and IO operations. The POSIX API was in that era was like a
4 // compatibility layer. In current Haiku development, both the POSIX API and
5 // the Haiku API are considered to be co-equal status. However, they are not
6 // integrated like they are on other UNIX platforms, which means that for many
7 // low level concepts there are two versions, like processes (POSIX) and
8 // teams (Haiku), or pthreads and native threads.
9 //
10 // Both the POSIX API and the Haiku API live in libroot.so, the library that is
11 // linked to any binary by default.
12 //
13 // This file follows the Haiku API for Haiku R1 beta 2. It is organized by the
14 // C/C++ header files in which the concepts can be found, while adhering to the
15 // style guide for this crate.
16 
17 // Helper macro to generate u32 constants. The Haiku API uses (non-standard)
18 // multi-character constants (like 'UPDA' or 'MSGM') to represent 32 bit
19 // integer constants.
20 
21 macro_rules! haiku_constant {
22     ($a:tt, $b:tt, $c:tt, $d:tt) => {
23         (($a as u32) << 24) + (($b as u32) << 16) + (($c as u32) << 8) + ($d as u32)
24     };
25 }
26 
27 // support/SupportDefs.h
28 pub type status_t = i32;
29 pub type bigtime_t = i64;
30 pub type nanotime_t = i64;
31 pub type type_code = u32;
32 pub type perform_code = u32;
33 
34 // kernel/OS.h
35 pub type area_id = i32;
36 pub type port_id = i32;
37 pub type sem_id = i32;
38 pub type team_id = i32;
39 pub type thread_id = i32;
40 
41 pub type thread_func = extern "C" fn(*mut ::c_void) -> status_t;
42 
43 // kernel/image.h
44 pub type image_id = i32;
45 
46 e! {
47     // kernel/OS.h
48     pub enum thread_state {
49         B_THREAD_RUNNING = 1,
50         B_THREAD_READY,
51         B_THREAD_RECEIVING,
52         B_THREAD_ASLEEP,
53         B_THREAD_SUSPENDED,
54         B_THREAD_WAITING
55     }
56 
57     // kernel/image.h
58     pub enum image_type {
59         B_APP_IMAGE = 1,
60         B_LIBRARY_IMAGE,
61         B_ADD_ON_IMAGE,
62         B_SYSTEM_IMAGE
63     }
64 
65     // kernel/scheduler.h
66 
67     pub enum be_task_flags {
68         B_DEFAULT_MEDIA_PRIORITY = 0x000,
69         B_OFFLINE_PROCESSING = 0x001,
70         B_STATUS_RENDERING = 0x002,
71         B_USER_INPUT_HANDLING = 0x004,
72         B_LIVE_VIDEO_MANIPULATION = 0x008,
73         B_VIDEO_PLAYBACK = 0x010,
74         B_VIDEO_RECORDING = 0x020,
75         B_LIVE_AUDIO_MANIPULATION = 0x040,
76         B_AUDIO_PLAYBACK = 0x080,
77         B_AUDIO_RECORDING = 0x100,
78         B_LIVE_3D_RENDERING = 0x200,
79         B_NUMBER_CRUNCHING = 0x400,
80         B_MIDI_PROCESSING = 0x800,
81     }
82 
83     pub enum schduler_mode {
84         SCHEDULER_MODE_LOW_LATENCY,
85         SCHEDULER_MODE_POWER_SAVING,
86     }
87 
88     // FindDirectory.h
89     pub enum path_base_directory {
90         B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY,
91         B_FIND_PATH_ADD_ONS_DIRECTORY,
92         B_FIND_PATH_APPS_DIRECTORY,
93         B_FIND_PATH_BIN_DIRECTORY,
94         B_FIND_PATH_BOOT_DIRECTORY,
95         B_FIND_PATH_CACHE_DIRECTORY,
96         B_FIND_PATH_DATA_DIRECTORY,
97         B_FIND_PATH_DEVELOP_DIRECTORY,
98         B_FIND_PATH_DEVELOP_LIB_DIRECTORY,
99         B_FIND_PATH_DOCUMENTATION_DIRECTORY,
100         B_FIND_PATH_ETC_DIRECTORY,
101         B_FIND_PATH_FONTS_DIRECTORY,
102         B_FIND_PATH_HEADERS_DIRECTORY,
103         B_FIND_PATH_LIB_DIRECTORY,
104         B_FIND_PATH_LOG_DIRECTORY,
105         B_FIND_PATH_MEDIA_NODES_DIRECTORY,
106         B_FIND_PATH_PACKAGES_DIRECTORY,
107         B_FIND_PATH_PREFERENCES_DIRECTORY,
108         B_FIND_PATH_SERVERS_DIRECTORY,
109         B_FIND_PATH_SETTINGS_DIRECTORY,
110         B_FIND_PATH_SOUNDS_DIRECTORY,
111         B_FIND_PATH_SPOOL_DIRECTORY,
112         B_FIND_PATH_TRANSLATORS_DIRECTORY,
113         B_FIND_PATH_VAR_DIRECTORY,
114         B_FIND_PATH_IMAGE_PATH = 1000,
115         B_FIND_PATH_PACKAGE_PATH,
116     }
117 }
118 
119 s! {
120     // kernel/OS.h
121     pub struct area_info {
122         pub area: area_id,
123         pub name: [::c_char; B_OS_NAME_LENGTH],
124         pub size: usize,
125         pub lock: u32,
126         pub protection: u32,
127         pub team: team_id,
128         pub ram_size: u32,
129         pub copy_count: u32,
130         pub in_count: u32,
131         pub out_count: u32,
132         pub address: *mut ::c_void
133     }
134 
135     pub struct port_info {
136         pub port: port_id,
137         pub team: team_id,
138         pub name: [::c_char; B_OS_NAME_LENGTH],
139         pub capacity: i32,
140         pub queue_count: i32,
141         pub total_count: i32,
142     }
143 
144     pub struct port_message_info {
145         pub size: ::size_t,
146         pub sender: ::uid_t,
147         pub sender_group: ::gid_t,
148         pub sender_team: ::team_id
149     }
150 
151     pub struct team_info {
152         pub team: team_id,
153         pub thread_count: i32,
154         pub image_count: i32,
155         pub area_count: i32,
156         pub debugger_nub_thread: thread_id,
157         pub debugger_nub_port: port_id,
158         pub argc: i32,
159         pub args: [::c_char; 64],
160         pub uid: ::uid_t,
161         pub gid: ::gid_t
162     }
163 
164     pub struct sem_info {
165         pub sem: sem_id,
166         pub team: team_id,
167         pub name: [::c_char; B_OS_NAME_LENGTH],
168         pub count: i32,
169         pub latest_holder: thread_id
170     }
171 
172     pub struct team_usage_info {
173         pub user_time: bigtime_t,
174         pub kernel_time: bigtime_t
175     }
176 
177     pub struct thread_info {
178         pub thread: thread_id,
179         pub team: team_id,
180         pub name: [::c_char; B_OS_NAME_LENGTH],
181         pub state: thread_state,
182         pub priority: i32,
183         pub sem: sem_id,
184         pub user_time: bigtime_t,
185         pub kernel_time: bigtime_t,
186         pub stack_base: *mut ::c_void,
187         pub stack_end: *mut ::c_void
188     }
189 
190     pub struct cpu_info {
191         pub active_time: bigtime_t,
192         pub enabled: bool
193     }
194 
195     pub struct system_info {
196         pub boot_time: bigtime_t,
197         pub cpu_count: u32,
198         pub max_pages: u64,
199         pub used_pages: u64,
200         pub cached_pages: u64,
201         pub block_cache_pages: u64,
202         pub ignored_pages: u64,
203         pub needed_memory: u64,
204         pub free_memory: u64,
205         pub max_swap_pages: u64,
206         pub free_swap_pages: u64,
207         pub page_faults: u32,
208         pub max_sems: u32,
209         pub used_sems: u32,
210         pub max_ports: u32,
211         pub used_ports: u32,
212         pub max_threads: u32,
213         pub used_threads: u32,
214         pub max_teams: u32,
215         pub used_teams: u32,
216         pub kernel_name: [::c_char; B_FILE_NAME_LENGTH],
217         pub kernel_build_date: [::c_char; B_OS_NAME_LENGTH],
218         pub kernel_build_time: [::c_char; B_OS_NAME_LENGTH],
219         pub kernel_version: i64,
220         pub abi: u32
221     }
222 
223     pub struct object_wait_info {
224         pub object: i32,
225         pub type_: u16,
226         pub events: u16
227     }
228 
229     // kernel/fs_attr.h
230     pub struct attr_info {
231         pub type_: u32,
232         pub size: ::off_t
233     }
234 
235     // kernel/fs_index.h
236     pub struct index_info {
237         pub type_: u32,
238         pub size: ::off_t,
239         pub modification_time: ::time_t,
240         pub creation_time: ::time_t,
241         pub uid: ::uid_t,
242         pub gid: ::gid_t
243     }
244 
245     //kernel/fs_info.h
246     pub struct fs_info {
247         pub dev: ::dev_t,
248         pub root: ::ino_t,
249         pub flags: u32,
250         pub block_size: ::off_t,
251         pub io_size: ::off_t,
252         pub total_blocks: ::off_t,
253         pub free_blocks: ::off_t,
254         pub total_nodes: ::off_t,
255         pub free_nodes: ::off_t,
256         pub device_name: [::c_char; 128],
257         pub volume_name: [::c_char; B_FILE_NAME_LENGTH],
258         pub fsh_name: [::c_char; B_OS_NAME_LENGTH]
259     }
260 
261     // kernel/image.h
262     pub struct image_info {
263         pub id: image_id,
264         pub image_type: ::c_int,
265         pub sequence: i32,
266         pub init_order: i32,
267         pub init_routine: extern "C" fn(),
268         pub term_routine: extern "C" fn(),
269         pub device: ::dev_t,
270         pub node: ::ino_t,
271         pub name: [::c_char; ::PATH_MAX as usize],
272         pub text: *mut ::c_void,
273         pub data: *mut ::c_void,
274         pub text_size: i32,
275         pub data_size: i32,
276         pub api_version: i32,
277         pub abi: i32
278     }
279 
280     pub struct __c_anonymous_eax_0 {
281         pub max_eax: u32,
282         pub vendor_id: [::c_char; 12],
283     }
284 
285     pub struct __c_anonymous_eax_1 {
286         pub stepping: u32,
287         pub model: u32,
288         pub family: u32,
289         pub tpe: u32,
290         __reserved_0: u32,
291         pub extended_model: u32,
292         pub extended_family: u32,
293         __reserved_1: u32,
294         pub brand_index: u32,
295         pub clflush: u32,
296         pub logical_cpus: u32,
297         pub apic_id: u32,
298         pub features: u32,
299         pub extended_features: u32,
300     }
301 
302     pub struct __c_anonymous_eax_2 {
303         pub call_num: u8,
304         pub cache_descriptors: [u8; 15],
305     }
306 
307     pub struct __c_anonymous_eax_3 {
308         __reserved: [u32; 2],
309         pub serial_number_high: u32,
310         pub serial_number_low: u32,
311     }
312 
313     pub struct __c_anonymous_regs {
314         pub eax: u32,
315         pub ebx: u32,
316         pub edx: u32,
317         pub ecx: u32,
318     }
319 }
320 
321 s_no_extra_traits! {
322     #[cfg(libc_union)]
323     pub union cpuid_info {
324         pub eax_0: __c_anonymous_eax_0,
325         pub eax_1: __c_anonymous_eax_1,
326         pub eax_2: __c_anonymous_eax_2,
327         pub eax_3: __c_anonymous_eax_3,
328         pub as_chars: [::c_char; 16],
329         pub regs: __c_anonymous_regs,
330     }
331 }
332 
333 cfg_if! {
334     if #[cfg(feature = "extra_traits")] {
335         #[cfg(libc_union)]
336         impl PartialEq for cpuid_info {
337             fn eq(&self, other: &cpuid_info) -> bool {
338                 unsafe {
339                 self.eax_0 == other.eax_0
340                     || self.eax_1 == other.eax_1
341                     || self.eax_2 == other.eax_2
342                     || self.eax_3 == other.eax_3
343                     || self.as_chars == other.as_chars
344                     || self.regs == other.regs
345                 }
346             }
347         }
348         #[cfg(libc_union)]
349         impl Eq for cpuid_info {}
350         #[cfg(libc_union)]
351         impl ::fmt::Debug for cpuid_info {
352             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
353                 unsafe {
354                 f.debug_struct("cpuid_info")
355                     .field("eax_0", &self.eax_0)
356                     .field("eax_1", &self.eax_1)
357                     .field("eax_2", &self.eax_2)
358                     .field("eax_3", &self.eax_3)
359                     .field("as_chars", &self.as_chars)
360                     .field("regs", &self.regs)
361                     .finish()
362                 }
363             }
364         }
365     }
366 }
367 
368 // kernel/OS.h
369 pub const B_OS_NAME_LENGTH: usize = 32;
370 pub const B_PAGE_SIZE: usize = 4096;
371 pub const B_INFINITE_TIMEOUT: usize = 9223372036854775807;
372 
373 pub const B_RELATIVE_TIMEOUT: u32 = 0x8;
374 pub const B_ABSOLUTE_TIMEOUT: u32 = 0x10;
375 pub const B_TIMEOUT_REAL_TIME_BASE: u32 = 0x40;
376 pub const B_ABSOLUTE_REAL_TIME_TIMEOUT: u32 = B_ABSOLUTE_TIMEOUT | B_TIMEOUT_REAL_TIME_BASE;
377 
378 pub const B_NO_LOCK: u32 = 0;
379 pub const B_LAZY_LOCK: u32 = 1;
380 pub const B_FULL_LOCK: u32 = 2;
381 pub const B_CONTIGUOUS: u32 = 3;
382 pub const B_LOMEM: u32 = 4;
383 pub const B_32_BIT_FULL_LOCK: u32 = 5;
384 pub const B_32_BIT_CONTIGUOUS: u32 = 6;
385 
386 pub const B_ANY_ADDRESS: u32 = 0;
387 pub const B_EXACT_ADDRESS: u32 = 1;
388 pub const B_BASE_ADDRESS: u32 = 2;
389 pub const B_CLONE_ADDRESS: u32 = 3;
390 pub const B_ANY_KERNEL_ADDRESS: u32 = 4;
391 pub const B_RANDOMIZED_ANY_ADDRESS: u32 = 6;
392 pub const B_RANDOMIZED_BASE_ADDRESS: u32 = 7;
393 
394 pub const B_READ_AREA: u32 = 1 << 0;
395 pub const B_WRITE_AREA: u32 = 1 << 1;
396 pub const B_EXECUTE_AREA: u32 = 1 << 2;
397 pub const B_STACK_AREA: u32 = 1 << 3;
398 pub const B_CLONEABLE_AREA: u32 = 1 << 8;
399 
400 pub const B_CAN_INTERRUPT: u32 = 0x01;
401 pub const B_CHECK_PERMISSION: u32 = 0x04;
402 pub const B_KILL_CAN_INTERRUPT: u32 = 0x20;
403 pub const B_DO_NOT_RESCHEDULE: u32 = 0x02;
404 pub const B_RELEASE_ALL: u32 = 0x08;
405 pub const B_RELEASE_IF_WAITING_ONLY: u32 = 0x10;
406 
407 pub const B_CURRENT_TEAM: team_id = 0;
408 pub const B_SYSTEM_TEAM: team_id = 1;
409 
410 pub const B_TEAM_USAGE_SELF: i32 = 0;
411 pub const B_TEAM_USAGE_CHILDREN: i32 = -1;
412 
413 pub const B_IDLE_PRIORITY: i32 = 0;
414 pub const B_LOWEST_ACTIVE_PRIORITY: i32 = 1;
415 pub const B_LOW_PRIORITY: i32 = 5;
416 pub const B_NORMAL_PRIORITY: i32 = 10;
417 pub const B_DISPLAY_PRIORITY: i32 = 15;
418 pub const B_URGENT_DISPLAY_PRIORITY: i32 = 20;
419 pub const B_REAL_TIME_DISPLAY_PRIORITY: i32 = 100;
420 pub const B_URGENT_PRIORITY: i32 = 110;
421 pub const B_REAL_TIME_PRIORITY: i32 = 120;
422 
423 pub const B_SYSTEM_TIMEBASE: i32 = 0;
424 pub const B_FIRST_REAL_TIME_PRIORITY: i32 = B_REAL_TIME_DISPLAY_PRIORITY;
425 
426 pub const B_ONE_SHOT_ABSOLUTE_ALARM: u32 = 1;
427 pub const B_ONE_SHOT_RELATIVE_ALARM: u32 = 2;
428 pub const B_PERIODIC_ALARM: u32 = 3;
429 
430 pub const B_OBJECT_TYPE_FD: u16 = 0;
431 pub const B_OBJECT_TYPE_SEMAPHORE: u16 = 1;
432 pub const B_OBJECT_TYPE_PORT: u16 = 2;
433 pub const B_OBJECT_TYPE_THREAD: u16 = 3;
434 
435 pub const B_EVENT_READ: u16 = 0x0001;
436 pub const B_EVENT_WRITE: u16 = 0x0002;
437 pub const B_EVENT_ERROR: u16 = 0x0004;
438 pub const B_EVENT_PRIORITY_READ: u16 = 0x0008;
439 pub const B_EVENT_PRIORITY_WRITE: u16 = 0x0010;
440 pub const B_EVENT_HIGH_PRIORITY_READ: u16 = 0x0020;
441 pub const B_EVENT_HIGH_PRIORITY_WRITE: u16 = 0x0040;
442 pub const B_EVENT_DISCONNECTED: u16 = 0x0080;
443 pub const B_EVENT_ACQUIRE_SEMAPHORE: u16 = 0x0001;
444 pub const B_EVENT_INVALID: u16 = 0x1000;
445 
446 // kernel/fs_info.h
447 pub const B_FS_IS_READONLY: u32 = 0x00000001;
448 pub const B_FS_IS_REMOVABLE: u32 = 0x00000002;
449 pub const B_FS_IS_PERSISTENT: u32 = 0x00000004;
450 pub const B_FS_IS_SHARED: u32 = 0x00000008;
451 pub const B_FS_HAS_MIME: u32 = 0x00010000;
452 pub const B_FS_HAS_ATTR: u32 = 0x00020000;
453 pub const B_FS_HAS_QUERY: u32 = 0x00040000;
454 pub const B_FS_HAS_SELF_HEALING_LINKS: u32 = 0x00080000;
455 pub const B_FS_HAS_ALIASES: u32 = 0x00100000;
456 pub const B_FS_SUPPORTS_NODE_MONITORING: u32 = 0x00200000;
457 pub const B_FS_SUPPORTS_MONITOR_CHILDREN: u32 = 0x00400000;
458 
459 // kernel/fs_query.h
460 pub const B_LIVE_QUERY: u32 = 0x00000001;
461 pub const B_QUERY_NON_INDEXED: u32 = 0x00000002;
462 
463 // kernel/fs_volume.h
464 pub const B_MOUNT_READ_ONLY: u32 = 1;
465 pub const B_MOUNT_VIRTUAL_DEVICE: u32 = 2;
466 pub const B_FORCE_UNMOUNT: u32 = 1;
467 
468 // kernel/image.h
469 pub const B_FLUSH_DCACHE: u32 = 0x0001;
470 pub const B_FLUSH_ICACHE: u32 = 0x0004;
471 pub const B_INVALIDATE_DCACHE: u32 = 0x0002;
472 pub const B_INVALIDATE_ICACHE: u32 = 0x0008;
473 
474 pub const B_SYMBOL_TYPE_DATA: i32 = 0x1;
475 pub const B_SYMBOL_TYPE_TEXT: i32 = 0x2;
476 pub const B_SYMBOL_TYPE_ANY: i32 = 0x5;
477 
478 // storage/StorageDefs.h
479 pub const B_DEV_NAME_LENGTH: usize = 128;
480 pub const B_FILE_NAME_LENGTH: usize = ::FILENAME_MAX as usize;
481 pub const B_PATH_NAME_LENGTH: usize = ::PATH_MAX as usize;
482 pub const B_ATTR_NAME_LENGTH: usize = B_FILE_NAME_LENGTH - 1;
483 pub const B_MIME_TYPE_LENGTH: usize = B_ATTR_NAME_LENGTH - 15;
484 pub const B_MAX_SYMLINKS: usize = 16;
485 
486 // Haiku open modes in BFile are passed as u32
487 pub const B_READ_ONLY: u32 = ::O_RDONLY as u32;
488 pub const B_WRITE_ONLY: u32 = ::O_WRONLY as u32;
489 pub const B_READ_WRITE: u32 = ::O_RDWR as u32;
490 
491 pub const B_FAIL_IF_EXISTS: u32 = ::O_EXCL as u32;
492 pub const B_CREATE_FILE: u32 = ::O_CREAT as u32;
493 pub const B_ERASE_FILE: u32 = ::O_TRUNC as u32;
494 pub const B_OPEN_AT_END: u32 = ::O_APPEND as u32;
495 
496 pub const B_FILE_NODE: u32 = 0x01;
497 pub const B_SYMLINK_NODE: u32 = 0x02;
498 pub const B_DIRECTORY_NODE: u32 = 0x04;
499 pub const B_ANY_NODE: u32 = 0x07;
500 
501 // support/Errors.h
502 pub const B_GENERAL_ERROR_BASE: status_t = core::i32::MIN;
503 pub const B_OS_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x1000;
504 pub const B_APP_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x2000;
505 pub const B_INTERFACE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x3000;
506 pub const B_MEDIA_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4000;
507 pub const B_TRANSLATION_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4800;
508 pub const B_MIDI_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x5000;
509 pub const B_STORAGE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x6000;
510 pub const B_POSIX_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x7000;
511 pub const B_MAIL_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x8000;
512 pub const B_PRINT_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x9000;
513 pub const B_DEVICE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0xa000;
514 pub const B_ERRORS_END: status_t = B_GENERAL_ERROR_BASE + 0xffff;
515 
516 // General errors
517 pub const B_NO_MEMORY: status_t = B_GENERAL_ERROR_BASE + 0;
518 pub const B_IO_ERROR: status_t = B_GENERAL_ERROR_BASE + 1;
519 pub const B_PERMISSION_DENIED: status_t = B_GENERAL_ERROR_BASE + 2;
520 pub const B_BAD_INDEX: status_t = B_GENERAL_ERROR_BASE + 3;
521 pub const B_BAD_TYPE: status_t = B_GENERAL_ERROR_BASE + 4;
522 pub const B_BAD_VALUE: status_t = B_GENERAL_ERROR_BASE + 5;
523 pub const B_MISMATCHED_VALUES: status_t = B_GENERAL_ERROR_BASE + 6;
524 pub const B_NAME_NOT_FOUND: status_t = B_GENERAL_ERROR_BASE + 7;
525 pub const B_NAME_IN_USE: status_t = B_GENERAL_ERROR_BASE + 8;
526 pub const B_TIMED_OUT: status_t = B_GENERAL_ERROR_BASE + 9;
527 pub const B_INTERRUPTED: status_t = B_GENERAL_ERROR_BASE + 10;
528 pub const B_WOULD_BLOCK: status_t = B_GENERAL_ERROR_BASE + 11;
529 pub const B_CANCELED: status_t = B_GENERAL_ERROR_BASE + 12;
530 pub const B_NO_INIT: status_t = B_GENERAL_ERROR_BASE + 13;
531 pub const B_NOT_INITIALIZED: status_t = B_GENERAL_ERROR_BASE + 13;
532 pub const B_BUSY: status_t = B_GENERAL_ERROR_BASE + 14;
533 pub const B_NOT_ALLOWED: status_t = B_GENERAL_ERROR_BASE + 15;
534 pub const B_BAD_DATA: status_t = B_GENERAL_ERROR_BASE + 16;
535 pub const B_DONT_DO_THAT: status_t = B_GENERAL_ERROR_BASE + 17;
536 
537 pub const B_ERROR: status_t = -1;
538 pub const B_OK: status_t = 0;
539 pub const B_NO_ERROR: status_t = 0;
540 
541 // Kernel kit errors
542 pub const B_BAD_SEM_ID: status_t = B_OS_ERROR_BASE + 0;
543 pub const B_NO_MORE_SEMS: status_t = B_OS_ERROR_BASE + 1;
544 
545 pub const B_BAD_THREAD_ID: status_t = B_OS_ERROR_BASE + 0x100;
546 pub const B_NO_MORE_THREADS: status_t = B_OS_ERROR_BASE + 0x101;
547 pub const B_BAD_THREAD_STATE: status_t = B_OS_ERROR_BASE + 0x102;
548 pub const B_BAD_TEAM_ID: status_t = B_OS_ERROR_BASE + 0x103;
549 pub const B_NO_MORE_TEAMS: status_t = B_OS_ERROR_BASE + 0x104;
550 
551 pub const B_BAD_PORT_ID: status_t = B_OS_ERROR_BASE + 0x200;
552 pub const B_NO_MORE_PORTS: status_t = B_OS_ERROR_BASE + 0x201;
553 
554 pub const B_BAD_IMAGE_ID: status_t = B_OS_ERROR_BASE + 0x300;
555 pub const B_BAD_ADDRESS: status_t = B_OS_ERROR_BASE + 0x301;
556 pub const B_NOT_AN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x302;
557 pub const B_MISSING_LIBRARY: status_t = B_OS_ERROR_BASE + 0x303;
558 pub const B_MISSING_SYMBOL: status_t = B_OS_ERROR_BASE + 0x304;
559 pub const B_UNKNOWN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x305;
560 pub const B_LEGACY_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x306;
561 
562 pub const B_DEBUGGER_ALREADY_INSTALLED: status_t = B_OS_ERROR_BASE + 0x400;
563 
564 // Application kit errors
565 pub const B_BAD_REPLY: status_t = B_APP_ERROR_BASE + 0;
566 pub const B_DUPLICATE_REPLY: status_t = B_APP_ERROR_BASE + 1;
567 pub const B_MESSAGE_TO_SELF: status_t = B_APP_ERROR_BASE + 2;
568 pub const B_BAD_HANDLER: status_t = B_APP_ERROR_BASE + 3;
569 pub const B_ALREADY_RUNNING: status_t = B_APP_ERROR_BASE + 4;
570 pub const B_LAUNCH_FAILED: status_t = B_APP_ERROR_BASE + 5;
571 pub const B_AMBIGUOUS_APP_LAUNCH: status_t = B_APP_ERROR_BASE + 6;
572 pub const B_UNKNOWN_MIME_TYPE: status_t = B_APP_ERROR_BASE + 7;
573 pub const B_BAD_SCRIPT_SYNTAX: status_t = B_APP_ERROR_BASE + 8;
574 pub const B_LAUNCH_FAILED_NO_RESOLVE_LINK: status_t = B_APP_ERROR_BASE + 9;
575 pub const B_LAUNCH_FAILED_EXECUTABLE: status_t = B_APP_ERROR_BASE + 10;
576 pub const B_LAUNCH_FAILED_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 11;
577 pub const B_LAUNCH_FAILED_APP_IN_TRASH: status_t = B_APP_ERROR_BASE + 12;
578 pub const B_LAUNCH_FAILED_NO_PREFERRED_APP: status_t = B_APP_ERROR_BASE + 13;
579 pub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 14;
580 pub const B_BAD_MIME_SNIFFER_RULE: status_t = B_APP_ERROR_BASE + 15;
581 pub const B_NOT_A_MESSAGE: status_t = B_APP_ERROR_BASE + 16;
582 pub const B_SHUTDOWN_CANCELLED: status_t = B_APP_ERROR_BASE + 17;
583 pub const B_SHUTTING_DOWN: status_t = B_APP_ERROR_BASE + 18;
584 
585 // Storage kit errors
586 pub const B_FILE_ERROR: status_t = B_STORAGE_ERROR_BASE + 0;
587 pub const B_FILE_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 1;
588 pub const B_FILE_EXISTS: status_t = B_STORAGE_ERROR_BASE + 2;
589 pub const B_ENTRY_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 3;
590 pub const B_NAME_TOO_LONG: status_t = B_STORAGE_ERROR_BASE + 4;
591 pub const B_NOT_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 5;
592 pub const B_DIRECTORY_NOT_EMPTY: status_t = B_STORAGE_ERROR_BASE + 6;
593 pub const B_DEVICE_FULL: status_t = B_STORAGE_ERROR_BASE + 7;
594 pub const B_READ_ONLY_DEVICE: status_t = B_STORAGE_ERROR_BASE + 8;
595 pub const B_IS_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 9;
596 pub const B_NO_MORE_FDS: status_t = B_STORAGE_ERROR_BASE + 10;
597 pub const B_CROSS_DEVICE_LINK: status_t = B_STORAGE_ERROR_BASE + 11;
598 pub const B_LINK_LIMIT: status_t = B_STORAGE_ERROR_BASE + 12;
599 pub const B_BUSTED_PIPE: status_t = B_STORAGE_ERROR_BASE + 13;
600 pub const B_UNSUPPORTED: status_t = B_STORAGE_ERROR_BASE + 14;
601 pub const B_PARTITION_TOO_SMALL: status_t = B_STORAGE_ERROR_BASE + 15;
602 pub const B_PARTIAL_READ: status_t = B_STORAGE_ERROR_BASE + 16;
603 pub const B_PARTIAL_WRITE: status_t = B_STORAGE_ERROR_BASE + 17;
604 
605 // Mapped posix errors
606 pub const B_BUFFER_OVERFLOW: status_t = ::EOVERFLOW;
607 pub const B_TOO_MANY_ARGS: status_t = ::E2BIG;
608 pub const B_FILE_TOO_LARGE: status_t = ::EFBIG;
609 pub const B_RESULT_NOT_REPRESENTABLE: status_t = ::ERANGE;
610 pub const B_DEVICE_NOT_FOUND: status_t = ::ENODEV;
611 pub const B_NOT_SUPPORTED: status_t = ::EOPNOTSUPP;
612 
613 // Media kit errors
614 pub const B_STREAM_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 0;
615 pub const B_SERVER_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 1;
616 pub const B_RESOURCE_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 2;
617 pub const B_RESOURCE_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 3;
618 pub const B_BAD_SUBSCRIBER: status_t = B_MEDIA_ERROR_BASE + 4;
619 pub const B_SUBSCRIBER_NOT_ENTERED: status_t = B_MEDIA_ERROR_BASE + 5;
620 pub const B_BUFFER_NOT_AVAILABLE: status_t = B_MEDIA_ERROR_BASE + 6;
621 pub const B_LAST_BUFFER_ERROR: status_t = B_MEDIA_ERROR_BASE + 7;
622 
623 pub const B_MEDIA_SYSTEM_FAILURE: status_t = B_MEDIA_ERROR_BASE + 100;
624 pub const B_MEDIA_BAD_NODE: status_t = B_MEDIA_ERROR_BASE + 101;
625 pub const B_MEDIA_NODE_BUSY: status_t = B_MEDIA_ERROR_BASE + 102;
626 pub const B_MEDIA_BAD_FORMAT: status_t = B_MEDIA_ERROR_BASE + 103;
627 pub const B_MEDIA_BAD_BUFFER: status_t = B_MEDIA_ERROR_BASE + 104;
628 pub const B_MEDIA_TOO_MANY_NODES: status_t = B_MEDIA_ERROR_BASE + 105;
629 pub const B_MEDIA_TOO_MANY_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 106;
630 pub const B_MEDIA_NODE_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 107;
631 pub const B_MEDIA_BUFFER_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 108;
632 pub const B_MEDIA_CANNOT_SEEK: status_t = B_MEDIA_ERROR_BASE + 109;
633 pub const B_MEDIA_CANNOT_CHANGE_RUN_MODE: status_t = B_MEDIA_ERROR_BASE + 110;
634 pub const B_MEDIA_APP_ALREADY_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 111;
635 pub const B_MEDIA_APP_NOT_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 112;
636 pub const B_MEDIA_CANNOT_RECLAIM_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 113;
637 pub const B_MEDIA_BUFFERS_NOT_RECLAIMED: status_t = B_MEDIA_ERROR_BASE + 114;
638 pub const B_MEDIA_TIME_SOURCE_STOPPED: status_t = B_MEDIA_ERROR_BASE + 115;
639 pub const B_MEDIA_TIME_SOURCE_BUSY: status_t = B_MEDIA_ERROR_BASE + 116;
640 pub const B_MEDIA_BAD_SOURCE: status_t = B_MEDIA_ERROR_BASE + 117;
641 pub const B_MEDIA_BAD_DESTINATION: status_t = B_MEDIA_ERROR_BASE + 118;
642 pub const B_MEDIA_ALREADY_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 119;
643 pub const B_MEDIA_NOT_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 120;
644 pub const B_MEDIA_BAD_CLIP_FORMAT: status_t = B_MEDIA_ERROR_BASE + 121;
645 pub const B_MEDIA_ADDON_FAILED: status_t = B_MEDIA_ERROR_BASE + 122;
646 pub const B_MEDIA_ADDON_DISABLED: status_t = B_MEDIA_ERROR_BASE + 123;
647 pub const B_MEDIA_CHANGE_IN_PROGRESS: status_t = B_MEDIA_ERROR_BASE + 124;
648 pub const B_MEDIA_STALE_CHANGE_COUNT: status_t = B_MEDIA_ERROR_BASE + 125;
649 pub const B_MEDIA_ADDON_RESTRICTED: status_t = B_MEDIA_ERROR_BASE + 126;
650 pub const B_MEDIA_NO_HANDLER: status_t = B_MEDIA_ERROR_BASE + 127;
651 pub const B_MEDIA_DUPLICATE_FORMAT: status_t = B_MEDIA_ERROR_BASE + 128;
652 pub const B_MEDIA_REALTIME_DISABLED: status_t = B_MEDIA_ERROR_BASE + 129;
653 pub const B_MEDIA_REALTIME_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 130;
654 
655 // Mail kit errors
656 pub const B_MAIL_NO_DAEMON: status_t = B_MAIL_ERROR_BASE + 0;
657 pub const B_MAIL_UNKNOWN_USER: status_t = B_MAIL_ERROR_BASE + 1;
658 pub const B_MAIL_WRONG_PASSWORD: status_t = B_MAIL_ERROR_BASE + 2;
659 pub const B_MAIL_UNKNOWN_HOST: status_t = B_MAIL_ERROR_BASE + 3;
660 pub const B_MAIL_ACCESS_ERROR: status_t = B_MAIL_ERROR_BASE + 4;
661 pub const B_MAIL_UNKNOWN_FIELD: status_t = B_MAIL_ERROR_BASE + 5;
662 pub const B_MAIL_NO_RECIPIENT: status_t = B_MAIL_ERROR_BASE + 6;
663 pub const B_MAIL_INVALID_MAIL: status_t = B_MAIL_ERROR_BASE + 7;
664 
665 // Print kit errors
666 pub const B_NO_PRINT_SERVER: status_t = B_PRINT_ERROR_BASE + 0;
667 
668 // Device kit errors
669 pub const B_DEV_INVALID_IOCTL: status_t = B_DEVICE_ERROR_BASE + 0;
670 pub const B_DEV_NO_MEMORY: status_t = B_DEVICE_ERROR_BASE + 1;
671 pub const B_DEV_BAD_DRIVE_NUM: status_t = B_DEVICE_ERROR_BASE + 2;
672 pub const B_DEV_NO_MEDIA: status_t = B_DEVICE_ERROR_BASE + 3;
673 pub const B_DEV_UNREADABLE: status_t = B_DEVICE_ERROR_BASE + 4;
674 pub const B_DEV_FORMAT_ERROR: status_t = B_DEVICE_ERROR_BASE + 5;
675 pub const B_DEV_TIMEOUT: status_t = B_DEVICE_ERROR_BASE + 6;
676 pub const B_DEV_RECALIBRATE_ERROR: status_t = B_DEVICE_ERROR_BASE + 7;
677 pub const B_DEV_SEEK_ERROR: status_t = B_DEVICE_ERROR_BASE + 8;
678 pub const B_DEV_ID_ERROR: status_t = B_DEVICE_ERROR_BASE + 9;
679 pub const B_DEV_READ_ERROR: status_t = B_DEVICE_ERROR_BASE + 10;
680 pub const B_DEV_WRITE_ERROR: status_t = B_DEVICE_ERROR_BASE + 11;
681 pub const B_DEV_NOT_READY: status_t = B_DEVICE_ERROR_BASE + 12;
682 pub const B_DEV_MEDIA_CHANGED: status_t = B_DEVICE_ERROR_BASE + 13;
683 pub const B_DEV_MEDIA_CHANGE_REQUESTED: status_t = B_DEVICE_ERROR_BASE + 14;
684 pub const B_DEV_RESOURCE_CONFLICT: status_t = B_DEVICE_ERROR_BASE + 15;
685 pub const B_DEV_CONFIGURATION_ERROR: status_t = B_DEVICE_ERROR_BASE + 16;
686 pub const B_DEV_DISABLED_BY_USER: status_t = B_DEVICE_ERROR_BASE + 17;
687 pub const B_DEV_DOOR_OPEN: status_t = B_DEVICE_ERROR_BASE + 18;
688 
689 pub const B_DEV_INVALID_PIPE: status_t = B_DEVICE_ERROR_BASE + 19;
690 pub const B_DEV_CRC_ERROR: status_t = B_DEVICE_ERROR_BASE + 20;
691 pub const B_DEV_STALLED: status_t = B_DEVICE_ERROR_BASE + 21;
692 pub const B_DEV_BAD_PID: status_t = B_DEVICE_ERROR_BASE + 22;
693 pub const B_DEV_UNEXPECTED_PID: status_t = B_DEVICE_ERROR_BASE + 23;
694 pub const B_DEV_DATA_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 24;
695 pub const B_DEV_DATA_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 25;
696 pub const B_DEV_FIFO_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 26;
697 pub const B_DEV_FIFO_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 27;
698 pub const B_DEV_PENDING: status_t = B_DEVICE_ERROR_BASE + 28;
699 pub const B_DEV_MULTIPLE_ERRORS: status_t = B_DEVICE_ERROR_BASE + 29;
700 pub const B_DEV_TOO_LATE: status_t = B_DEVICE_ERROR_BASE + 30;
701 
702 // translation kit errors
703 pub const B_TRANSLATION_BASE_ERROR: status_t = B_TRANSLATION_ERROR_BASE + 0;
704 pub const B_NO_TRANSLATOR: status_t = B_TRANSLATION_ERROR_BASE + 1;
705 pub const B_ILLEGAL_DATA: status_t = B_TRANSLATION_ERROR_BASE + 2;
706 
707 // support/TypeConstants.h
708 pub const B_AFFINE_TRANSFORM_TYPE: u32 = haiku_constant!('A', 'M', 'T', 'X');
709 pub const B_ALIGNMENT_TYPE: u32 = haiku_constant!('A', 'L', 'G', 'N');
710 pub const B_ANY_TYPE: u32 = haiku_constant!('A', 'N', 'Y', 'T');
711 pub const B_ATOM_TYPE: u32 = haiku_constant!('A', 'T', 'O', 'M');
712 pub const B_ATOMREF_TYPE: u32 = haiku_constant!('A', 'T', 'M', 'R');
713 pub const B_BOOL_TYPE: u32 = haiku_constant!('B', 'O', 'O', 'L');
714 pub const B_CHAR_TYPE: u32 = haiku_constant!('C', 'H', 'A', 'R');
715 pub const B_COLOR_8_BIT_TYPE: u32 = haiku_constant!('C', 'L', 'R', 'B');
716 pub const B_DOUBLE_TYPE: u32 = haiku_constant!('D', 'B', 'L', 'E');
717 pub const B_FLOAT_TYPE: u32 = haiku_constant!('F', 'L', 'O', 'T');
718 pub const B_GRAYSCALE_8_BIT_TYPE: u32 = haiku_constant!('G', 'R', 'Y', 'B');
719 pub const B_INT16_TYPE: u32 = haiku_constant!('S', 'H', 'R', 'T');
720 pub const B_INT32_TYPE: u32 = haiku_constant!('L', 'O', 'N', 'G');
721 pub const B_INT64_TYPE: u32 = haiku_constant!('L', 'L', 'N', 'G');
722 pub const B_INT8_TYPE: u32 = haiku_constant!('B', 'Y', 'T', 'E');
723 pub const B_LARGE_ICON_TYPE: u32 = haiku_constant!('I', 'C', 'O', 'N');
724 pub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'G');
725 pub const B_MEDIA_PARAMETER_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'T');
726 pub const B_MEDIA_PARAMETER_WEB_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'W');
727 pub const B_MESSAGE_TYPE: u32 = haiku_constant!('M', 'S', 'G', 'G');
728 pub const B_MESSENGER_TYPE: u32 = haiku_constant!('M', 'S', 'N', 'G');
729 pub const B_MIME_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'E');
730 pub const B_MINI_ICON_TYPE: u32 = haiku_constant!('M', 'I', 'C', 'N');
731 pub const B_MONOCHROME_1_BIT_TYPE: u32 = haiku_constant!('M', 'N', 'O', 'B');
732 pub const B_OBJECT_TYPE: u32 = haiku_constant!('O', 'P', 'T', 'R');
733 pub const B_OFF_T_TYPE: u32 = haiku_constant!('O', 'F', 'F', 'T');
734 pub const B_PATTERN_TYPE: u32 = haiku_constant!('P', 'A', 'T', 'N');
735 pub const B_POINTER_TYPE: u32 = haiku_constant!('P', 'N', 'T', 'R');
736 pub const B_POINT_TYPE: u32 = haiku_constant!('B', 'P', 'N', 'T');
737 pub const B_PROPERTY_INFO_TYPE: u32 = haiku_constant!('S', 'C', 'T', 'D');
738 pub const B_RAW_TYPE: u32 = haiku_constant!('R', 'A', 'W', 'T');
739 pub const B_RECT_TYPE: u32 = haiku_constant!('R', 'E', 'C', 'T');
740 pub const B_REF_TYPE: u32 = haiku_constant!('R', 'R', 'E', 'F');
741 pub const B_RGB_32_BIT_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'B');
742 pub const B_RGB_COLOR_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'C');
743 pub const B_SIZE_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'E');
744 pub const B_SIZE_T_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'T');
745 pub const B_SSIZE_T_TYPE: u32 = haiku_constant!('S', 'S', 'Z', 'T');
746 pub const B_STRING_TYPE: u32 = haiku_constant!('C', 'S', 'T', 'R');
747 pub const B_STRING_LIST_TYPE: u32 = haiku_constant!('S', 'T', 'R', 'L');
748 pub const B_TIME_TYPE: u32 = haiku_constant!('T', 'I', 'M', 'E');
749 pub const B_UINT16_TYPE: u32 = haiku_constant!('U', 'S', 'H', 'T');
750 pub const B_UINT32_TYPE: u32 = haiku_constant!('U', 'L', 'N', 'G');
751 pub const B_UINT64_TYPE: u32 = haiku_constant!('U', 'L', 'L', 'G');
752 pub const B_UINT8_TYPE: u32 = haiku_constant!('U', 'B', 'Y', 'T');
753 pub const B_VECTOR_ICON_TYPE: u32 = haiku_constant!('V', 'I', 'C', 'N');
754 pub const B_XATTR_TYPE: u32 = haiku_constant!('X', 'A', 'T', 'R');
755 pub const B_NETWORK_ADDRESS_TYPE: u32 = haiku_constant!('N', 'W', 'A', 'D');
756 pub const B_MIME_STRING_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'S');
757 pub const B_ASCII_TYPE: u32 = haiku_constant!('T', 'E', 'X', 'T');
758 
759 extern "C" {
760     // kernel/OS.h
create_area( name: *const ::c_char, startAddress: *mut *mut ::c_void, addressSpec: u32, size: usize, lock: u32, protection: u32, ) -> area_id761     pub fn create_area(
762         name: *const ::c_char,
763         startAddress: *mut *mut ::c_void,
764         addressSpec: u32,
765         size: usize,
766         lock: u32,
767         protection: u32,
768     ) -> area_id;
clone_area( name: *const ::c_char, destAddress: *mut *mut ::c_void, addressSpec: u32, protection: u32, source: area_id, ) -> area_id769     pub fn clone_area(
770         name: *const ::c_char,
771         destAddress: *mut *mut ::c_void,
772         addressSpec: u32,
773         protection: u32,
774         source: area_id,
775     ) -> area_id;
find_area(name: *const ::c_char) -> area_id776     pub fn find_area(name: *const ::c_char) -> area_id;
area_for(address: *mut ::c_void) -> area_id777     pub fn area_for(address: *mut ::c_void) -> area_id;
delete_area(id: area_id) -> status_t778     pub fn delete_area(id: area_id) -> status_t;
resize_area(id: area_id, newSize: usize) -> status_t779     pub fn resize_area(id: area_id, newSize: usize) -> status_t;
set_area_protection(id: area_id, newProtection: u32) -> status_t780     pub fn set_area_protection(id: area_id, newProtection: u32) -> status_t;
_get_area_info(id: area_id, areaInfo: *mut area_info, size: usize) -> status_t781     pub fn _get_area_info(id: area_id, areaInfo: *mut area_info, size: usize) -> status_t;
_get_next_area_info( team: team_id, cookie: *mut isize, areaInfo: *mut area_info, size: usize, ) -> status_t782     pub fn _get_next_area_info(
783         team: team_id,
784         cookie: *mut isize,
785         areaInfo: *mut area_info,
786         size: usize,
787     ) -> status_t;
788 
create_port(capacity: i32, name: *const ::c_char) -> port_id789     pub fn create_port(capacity: i32, name: *const ::c_char) -> port_id;
find_port(name: *const ::c_char) -> port_id790     pub fn find_port(name: *const ::c_char) -> port_id;
read_port( port: port_id, code: *mut i32, buffer: *mut ::c_void, bufferSize: ::size_t, ) -> ::ssize_t791     pub fn read_port(
792         port: port_id,
793         code: *mut i32,
794         buffer: *mut ::c_void,
795         bufferSize: ::size_t,
796     ) -> ::ssize_t;
read_port_etc( port: port_id, code: *mut i32, buffer: *mut ::c_void, bufferSize: ::size_t, flags: u32, timeout: bigtime_t, ) -> ::ssize_t797     pub fn read_port_etc(
798         port: port_id,
799         code: *mut i32,
800         buffer: *mut ::c_void,
801         bufferSize: ::size_t,
802         flags: u32,
803         timeout: bigtime_t,
804     ) -> ::ssize_t;
write_port( port: port_id, code: i32, buffer: *const ::c_void, bufferSize: ::size_t, ) -> status_t805     pub fn write_port(
806         port: port_id,
807         code: i32,
808         buffer: *const ::c_void,
809         bufferSize: ::size_t,
810     ) -> status_t;
write_port_etc( port: port_id, code: i32, buffer: *const ::c_void, bufferSize: ::size_t, flags: u32, timeout: bigtime_t, ) -> status_t811     pub fn write_port_etc(
812         port: port_id,
813         code: i32,
814         buffer: *const ::c_void,
815         bufferSize: ::size_t,
816         flags: u32,
817         timeout: bigtime_t,
818     ) -> status_t;
close_port(port: port_id) -> status_t819     pub fn close_port(port: port_id) -> status_t;
delete_port(port: port_id) -> status_t820     pub fn delete_port(port: port_id) -> status_t;
port_buffer_size(port: port_id) -> ::ssize_t821     pub fn port_buffer_size(port: port_id) -> ::ssize_t;
port_buffer_size_etc(port: port_id, flags: u32, timeout: bigtime_t) -> ::ssize_t822     pub fn port_buffer_size_etc(port: port_id, flags: u32, timeout: bigtime_t) -> ::ssize_t;
port_count(port: port_id) -> ::ssize_t823     pub fn port_count(port: port_id) -> ::ssize_t;
set_port_owner(port: port_id, team: team_id) -> status_t824     pub fn set_port_owner(port: port_id, team: team_id) -> status_t;
825 
_get_port_info(port: port_id, buf: *mut port_info, portInfoSize: ::size_t) -> status_t826     pub fn _get_port_info(port: port_id, buf: *mut port_info, portInfoSize: ::size_t) -> status_t;
_get_next_port_info( port: port_id, cookie: *mut i32, portInfo: *mut port_info, portInfoSize: ::size_t, ) -> status_t827     pub fn _get_next_port_info(
828         port: port_id,
829         cookie: *mut i32,
830         portInfo: *mut port_info,
831         portInfoSize: ::size_t,
832     ) -> status_t;
_get_port_message_info_etc( port: port_id, info: *mut port_message_info, infoSize: ::size_t, flags: u32, timeout: bigtime_t, ) -> status_t833     pub fn _get_port_message_info_etc(
834         port: port_id,
835         info: *mut port_message_info,
836         infoSize: ::size_t,
837         flags: u32,
838         timeout: bigtime_t,
839     ) -> status_t;
840 
create_sem(count: i32, name: *const ::c_char) -> sem_id841     pub fn create_sem(count: i32, name: *const ::c_char) -> sem_id;
delete_sem(id: sem_id) -> status_t842     pub fn delete_sem(id: sem_id) -> status_t;
acquire_sem(id: sem_id) -> status_t843     pub fn acquire_sem(id: sem_id) -> status_t;
acquire_sem_etc(id: sem_id, count: i32, flags: u32, timeout: bigtime_t) -> status_t844     pub fn acquire_sem_etc(id: sem_id, count: i32, flags: u32, timeout: bigtime_t) -> status_t;
release_sem(id: sem_id) -> status_t845     pub fn release_sem(id: sem_id) -> status_t;
release_sem_etc(id: sem_id, count: i32, flags: u32) -> status_t846     pub fn release_sem_etc(id: sem_id, count: i32, flags: u32) -> status_t;
switch_sem(semToBeReleased: sem_id, id: sem_id) -> status_t847     pub fn switch_sem(semToBeReleased: sem_id, id: sem_id) -> status_t;
switch_sem_etc( semToBeReleased: sem_id, id: sem_id, count: i32, flags: u32, timeout: bigtime_t, ) -> status_t848     pub fn switch_sem_etc(
849         semToBeReleased: sem_id,
850         id: sem_id,
851         count: i32,
852         flags: u32,
853         timeout: bigtime_t,
854     ) -> status_t;
get_sem_count(id: sem_id, threadCount: *mut i32) -> status_t855     pub fn get_sem_count(id: sem_id, threadCount: *mut i32) -> status_t;
set_sem_owner(id: sem_id, team: team_id) -> status_t856     pub fn set_sem_owner(id: sem_id, team: team_id) -> status_t;
_get_sem_info(id: sem_id, info: *mut sem_info, infoSize: ::size_t) -> status_t857     pub fn _get_sem_info(id: sem_id, info: *mut sem_info, infoSize: ::size_t) -> status_t;
_get_next_sem_info( team: team_id, cookie: *mut i32, info: *mut sem_info, infoSize: ::size_t, ) -> status_t858     pub fn _get_next_sem_info(
859         team: team_id,
860         cookie: *mut i32,
861         info: *mut sem_info,
862         infoSize: ::size_t,
863     ) -> status_t;
864 
kill_team(team: team_id) -> status_t865     pub fn kill_team(team: team_id) -> status_t;
_get_team_info(team: team_id, info: *mut team_info, size: ::size_t) -> status_t866     pub fn _get_team_info(team: team_id, info: *mut team_info, size: ::size_t) -> status_t;
_get_next_team_info(cookie: *mut i32, info: *mut team_info, size: ::size_t) -> status_t867     pub fn _get_next_team_info(cookie: *mut i32, info: *mut team_info, size: ::size_t) -> status_t;
868 
spawn_thread( func: thread_func, name: *const ::c_char, priority: i32, data: *mut ::c_void, ) -> thread_id869     pub fn spawn_thread(
870         func: thread_func,
871         name: *const ::c_char,
872         priority: i32,
873         data: *mut ::c_void,
874     ) -> thread_id;
kill_thread(thread: thread_id) -> status_t875     pub fn kill_thread(thread: thread_id) -> status_t;
resume_thread(thread: thread_id) -> status_t876     pub fn resume_thread(thread: thread_id) -> status_t;
suspend_thread(thread: thread_id) -> status_t877     pub fn suspend_thread(thread: thread_id) -> status_t;
878 
rename_thread(thread: thread_id, newName: *const ::c_char) -> status_t879     pub fn rename_thread(thread: thread_id, newName: *const ::c_char) -> status_t;
set_thread_priority(thread: thread_id, newPriority: i32) -> status_t880     pub fn set_thread_priority(thread: thread_id, newPriority: i32) -> status_t;
suggest_thread_priority( task_flags: be_task_flags, period: i32, jitter: ::bigtime_t, length: ::bigtime_t, ) -> i32881     pub fn suggest_thread_priority(
882         task_flags: be_task_flags,
883         period: i32,
884         jitter: ::bigtime_t,
885         length: ::bigtime_t,
886     ) -> i32;
estimate_max_scheduling_latency(th: ::thread_id) -> ::bigtime_t887     pub fn estimate_max_scheduling_latency(th: ::thread_id) -> ::bigtime_t;
exit_thread(status: status_t)888     pub fn exit_thread(status: status_t);
wait_for_thread(thread: thread_id, returnValue: *mut status_t) -> status_t889     pub fn wait_for_thread(thread: thread_id, returnValue: *mut status_t) -> status_t;
on_exit_thread(callback: extern "C" fn(*mut ::c_void), data: *mut ::c_void) -> status_t890     pub fn on_exit_thread(callback: extern "C" fn(*mut ::c_void), data: *mut ::c_void) -> status_t;
891 
find_thread(name: *const ::c_char) -> thread_id892     pub fn find_thread(name: *const ::c_char) -> thread_id;
893 
get_scheduler_mode() -> i32894     pub fn get_scheduler_mode() -> i32;
set_scheduler_mode(mode: i32) -> status_t895     pub fn set_scheduler_mode(mode: i32) -> status_t;
896 
send_data( thread: thread_id, code: i32, buffer: *const ::c_void, bufferSize: ::size_t, ) -> status_t897     pub fn send_data(
898         thread: thread_id,
899         code: i32,
900         buffer: *const ::c_void,
901         bufferSize: ::size_t,
902     ) -> status_t;
receive_data(sender: *mut thread_id, buffer: *mut ::c_void, bufferSize: ::size_t) -> i32903     pub fn receive_data(sender: *mut thread_id, buffer: *mut ::c_void, bufferSize: ::size_t)
904         -> i32;
has_data(thread: thread_id) -> bool905     pub fn has_data(thread: thread_id) -> bool;
906 
snooze(amount: bigtime_t) -> status_t907     pub fn snooze(amount: bigtime_t) -> status_t;
snooze_etc(amount: bigtime_t, timeBase: ::c_int, flags: u32) -> status_t908     pub fn snooze_etc(amount: bigtime_t, timeBase: ::c_int, flags: u32) -> status_t;
snooze_until(time: bigtime_t, timeBase: ::c_int) -> status_t909     pub fn snooze_until(time: bigtime_t, timeBase: ::c_int) -> status_t;
910 
_get_thread_info(id: thread_id, info: *mut thread_info, size: ::size_t) -> status_t911     pub fn _get_thread_info(id: thread_id, info: *mut thread_info, size: ::size_t) -> status_t;
_get_next_thread_info( team: team_id, cookie: *mut i32, info: *mut thread_info, size: ::size_t, ) -> status_t912     pub fn _get_next_thread_info(
913         team: team_id,
914         cookie: *mut i32,
915         info: *mut thread_info,
916         size: ::size_t,
917     ) -> status_t;
918 
get_pthread_thread_id(thread: ::pthread_t) -> thread_id919     pub fn get_pthread_thread_id(thread: ::pthread_t) -> thread_id;
920 
_get_team_usage_info( team: team_id, who: i32, info: *mut team_usage_info, size: ::size_t, ) -> status_t921     pub fn _get_team_usage_info(
922         team: team_id,
923         who: i32,
924         info: *mut team_usage_info,
925         size: ::size_t,
926     ) -> status_t;
927 
real_time_clock() -> ::c_ulong928     pub fn real_time_clock() -> ::c_ulong;
set_real_time_clock(secsSinceJan1st1970: ::c_ulong)929     pub fn set_real_time_clock(secsSinceJan1st1970: ::c_ulong);
real_time_clock_usecs() -> bigtime_t930     pub fn real_time_clock_usecs() -> bigtime_t;
system_time() -> bigtime_t931     pub fn system_time() -> bigtime_t;
system_time_nsecs() -> nanotime_t932     pub fn system_time_nsecs() -> nanotime_t;
933     // set_timezone() is deprecated and a no-op
934 
set_alarm(when: bigtime_t, flags: u32) -> bigtime_t935     pub fn set_alarm(when: bigtime_t, flags: u32) -> bigtime_t;
debugger(message: *const ::c_char)936     pub fn debugger(message: *const ::c_char);
disable_debugger(state: ::c_int) -> ::c_int937     pub fn disable_debugger(state: ::c_int) -> ::c_int;
938 
get_cpuid(info: *mut cpuid_info, eaxRegister: u32, cpuNum: u32) -> status_t939     pub fn get_cpuid(info: *mut cpuid_info, eaxRegister: u32, cpuNum: u32) -> status_t;
940 
get_system_info(info: *mut system_info) -> status_t941     pub fn get_system_info(info: *mut system_info) -> status_t;
get_cpu_info(firstCPU: u32, cpuCount: u32, info: *mut cpu_info) -> status_t942     pub fn get_cpu_info(firstCPU: u32, cpuCount: u32, info: *mut cpu_info) -> status_t;
is_computer_on() -> i32943     pub fn is_computer_on() -> i32;
is_computer_on_fire() -> ::c_double944     pub fn is_computer_on_fire() -> ::c_double;
send_signal(threadID: thread_id, signal: ::c_uint) -> ::c_int945     pub fn send_signal(threadID: thread_id, signal: ::c_uint) -> ::c_int;
set_signal_stack(base: *mut ::c_void, size: ::size_t)946     pub fn set_signal_stack(base: *mut ::c_void, size: ::size_t);
947 
wait_for_objects(infos: *mut object_wait_info, numInfos: ::c_int) -> ::ssize_t948     pub fn wait_for_objects(infos: *mut object_wait_info, numInfos: ::c_int) -> ::ssize_t;
wait_for_objects_etc( infos: *mut object_wait_info, numInfos: ::c_int, flags: u32, timeout: bigtime_t, ) -> ::ssize_t949     pub fn wait_for_objects_etc(
950         infos: *mut object_wait_info,
951         numInfos: ::c_int,
952         flags: u32,
953         timeout: bigtime_t,
954     ) -> ::ssize_t;
955 
956     // kernel/fs_attr.h
fs_read_attr( fd: ::c_int, attribute: *const ::c_char, type_: u32, pos: ::off_t, buffer: *mut ::c_void, readBytes: ::size_t, ) -> ::ssize_t957     pub fn fs_read_attr(
958         fd: ::c_int,
959         attribute: *const ::c_char,
960         type_: u32,
961         pos: ::off_t,
962         buffer: *mut ::c_void,
963         readBytes: ::size_t,
964     ) -> ::ssize_t;
fs_write_attr( fd: ::c_int, attribute: *const ::c_char, type_: u32, pos: ::off_t, buffer: *const ::c_void, writeBytes: ::size_t, ) -> ::ssize_t965     pub fn fs_write_attr(
966         fd: ::c_int,
967         attribute: *const ::c_char,
968         type_: u32,
969         pos: ::off_t,
970         buffer: *const ::c_void,
971         writeBytes: ::size_t,
972     ) -> ::ssize_t;
fs_remove_attr(fd: ::c_int, attribute: *const ::c_char) -> ::c_int973     pub fn fs_remove_attr(fd: ::c_int, attribute: *const ::c_char) -> ::c_int;
fs_stat_attr( fd: ::c_int, attribute: *const ::c_char, attrInfo: *mut attr_info, ) -> ::c_int974     pub fn fs_stat_attr(
975         fd: ::c_int,
976         attribute: *const ::c_char,
977         attrInfo: *mut attr_info,
978     ) -> ::c_int;
979 
fs_open_attr( path: *const ::c_char, attribute: *const ::c_char, type_: u32, openMode: ::c_int, ) -> ::c_int980     pub fn fs_open_attr(
981         path: *const ::c_char,
982         attribute: *const ::c_char,
983         type_: u32,
984         openMode: ::c_int,
985     ) -> ::c_int;
fs_fopen_attr( fd: ::c_int, attribute: *const ::c_char, type_: u32, openMode: ::c_int, ) -> ::c_int986     pub fn fs_fopen_attr(
987         fd: ::c_int,
988         attribute: *const ::c_char,
989         type_: u32,
990         openMode: ::c_int,
991     ) -> ::c_int;
fs_close_attr(fd: ::c_int) -> ::c_int992     pub fn fs_close_attr(fd: ::c_int) -> ::c_int;
993 
fs_open_attr_dir(path: *const ::c_char) -> *mut ::DIR994     pub fn fs_open_attr_dir(path: *const ::c_char) -> *mut ::DIR;
fs_lopen_attr_dir(path: *const ::c_char) -> *mut ::DIR995     pub fn fs_lopen_attr_dir(path: *const ::c_char) -> *mut ::DIR;
fs_fopen_attr_dir(fd: ::c_int) -> *mut ::DIR996     pub fn fs_fopen_attr_dir(fd: ::c_int) -> *mut ::DIR;
fs_close_attr_dir(dir: *mut ::DIR) -> ::c_int997     pub fn fs_close_attr_dir(dir: *mut ::DIR) -> ::c_int;
fs_read_attr_dir(dir: *mut ::DIR) -> *mut ::dirent998     pub fn fs_read_attr_dir(dir: *mut ::DIR) -> *mut ::dirent;
fs_rewind_attr_dir(dir: *mut ::DIR)999     pub fn fs_rewind_attr_dir(dir: *mut ::DIR);
1000 
1001     // kernel/fs_image.h
fs_create_index( device: ::dev_t, name: *const ::c_char, type_: u32, flags: u32, ) -> ::c_int1002     pub fn fs_create_index(
1003         device: ::dev_t,
1004         name: *const ::c_char,
1005         type_: u32,
1006         flags: u32,
1007     ) -> ::c_int;
fs_remove_index(device: ::dev_t, name: *const ::c_char) -> ::c_int1008     pub fn fs_remove_index(device: ::dev_t, name: *const ::c_char) -> ::c_int;
fs_stat_index( device: ::dev_t, name: *const ::c_char, indexInfo: *mut index_info, ) -> ::c_int1009     pub fn fs_stat_index(
1010         device: ::dev_t,
1011         name: *const ::c_char,
1012         indexInfo: *mut index_info,
1013     ) -> ::c_int;
1014 
fs_open_index_dir(device: ::dev_t) -> *mut ::DIR1015     pub fn fs_open_index_dir(device: ::dev_t) -> *mut ::DIR;
fs_close_index_dir(indexDirectory: *mut ::DIR) -> ::c_int1016     pub fn fs_close_index_dir(indexDirectory: *mut ::DIR) -> ::c_int;
fs_read_index_dir(indexDirectory: *mut ::DIR) -> *mut ::dirent1017     pub fn fs_read_index_dir(indexDirectory: *mut ::DIR) -> *mut ::dirent;
fs_rewind_index_dir(indexDirectory: *mut ::DIR)1018     pub fn fs_rewind_index_dir(indexDirectory: *mut ::DIR);
1019 
1020     // kernel/fs_info.h
dev_for_path(path: *const ::c_char) -> ::dev_t1021     pub fn dev_for_path(path: *const ::c_char) -> ::dev_t;
next_dev(pos: *mut i32) -> ::dev_t1022     pub fn next_dev(pos: *mut i32) -> ::dev_t;
fs_stat_dev(dev: ::dev_t, info: *mut fs_info) -> ::c_int1023     pub fn fs_stat_dev(dev: ::dev_t, info: *mut fs_info) -> ::c_int;
1024 
1025     // kernel/fs_query.h
fs_open_query(device: ::dev_t, query: *const ::c_char, flags: u32) -> *mut ::DIR1026     pub fn fs_open_query(device: ::dev_t, query: *const ::c_char, flags: u32) -> *mut ::DIR;
fs_open_live_query( device: ::dev_t, query: *const ::c_char, flags: u32, port: port_id, token: i32, ) -> *mut ::DIR1027     pub fn fs_open_live_query(
1028         device: ::dev_t,
1029         query: *const ::c_char,
1030         flags: u32,
1031         port: port_id,
1032         token: i32,
1033     ) -> *mut ::DIR;
fs_close_query(d: *mut ::DIR) -> ::c_int1034     pub fn fs_close_query(d: *mut ::DIR) -> ::c_int;
fs_read_query(d: *mut ::DIR) -> *mut ::dirent1035     pub fn fs_read_query(d: *mut ::DIR) -> *mut ::dirent;
get_path_for_dirent(dent: *mut ::dirent, buf: *mut ::c_char, len: ::size_t) -> status_t1036     pub fn get_path_for_dirent(dent: *mut ::dirent, buf: *mut ::c_char, len: ::size_t) -> status_t;
1037 
1038     // kernel/fs_volume.h
fs_mount_volume( where_: *const ::c_char, device: *const ::c_char, filesystem: *const ::c_char, flags: u32, parameters: *const ::c_char, ) -> ::dev_t1039     pub fn fs_mount_volume(
1040         where_: *const ::c_char,
1041         device: *const ::c_char,
1042         filesystem: *const ::c_char,
1043         flags: u32,
1044         parameters: *const ::c_char,
1045     ) -> ::dev_t;
fs_unmount_volume(path: *const ::c_char, flags: u32) -> status_t1046     pub fn fs_unmount_volume(path: *const ::c_char, flags: u32) -> status_t;
1047 
1048     // kernel/image.h
load_image( argc: i32, argv: *mut *const ::c_char, environ: *mut *const ::c_char, ) -> thread_id1049     pub fn load_image(
1050         argc: i32,
1051         argv: *mut *const ::c_char,
1052         environ: *mut *const ::c_char,
1053     ) -> thread_id;
load_add_on(path: *const ::c_char) -> image_id1054     pub fn load_add_on(path: *const ::c_char) -> image_id;
unload_add_on(image: image_id) -> status_t1055     pub fn unload_add_on(image: image_id) -> status_t;
get_image_symbol( image: image_id, name: *const ::c_char, symbolType: i32, symbolLocation: *mut *mut ::c_void, ) -> status_t1056     pub fn get_image_symbol(
1057         image: image_id,
1058         name: *const ::c_char,
1059         symbolType: i32,
1060         symbolLocation: *mut *mut ::c_void,
1061     ) -> status_t;
get_nth_image_symbol( image: image_id, n: i32, nameBuffer: *mut ::c_char, nameLength: *mut i32, symbolType: *mut i32, symbolLocation: *mut *mut ::c_void, ) -> status_t1062     pub fn get_nth_image_symbol(
1063         image: image_id,
1064         n: i32,
1065         nameBuffer: *mut ::c_char,
1066         nameLength: *mut i32,
1067         symbolType: *mut i32,
1068         symbolLocation: *mut *mut ::c_void,
1069     ) -> status_t;
clear_caches(address: *mut ::c_void, length: ::size_t, flags: u32)1070     pub fn clear_caches(address: *mut ::c_void, length: ::size_t, flags: u32);
_get_image_info(image: image_id, info: *mut image_info, size: ::size_t) -> status_t1071     pub fn _get_image_info(image: image_id, info: *mut image_info, size: ::size_t) -> status_t;
_get_next_image_info( team: team_id, cookie: *mut i32, info: *mut image_info, size: ::size_t, ) -> status_t1072     pub fn _get_next_image_info(
1073         team: team_id,
1074         cookie: *mut i32,
1075         info: *mut image_info,
1076         size: ::size_t,
1077     ) -> status_t;
find_path( codePointer: *const ::c_void, baseDirectory: path_base_directory, subPath: *const ::c_char, pathBuffer: *mut ::c_char, bufferSize: usize, ) -> status_t1078     pub fn find_path(
1079         codePointer: *const ::c_void,
1080         baseDirectory: path_base_directory,
1081         subPath: *const ::c_char,
1082         pathBuffer: *mut ::c_char,
1083         bufferSize: usize,
1084     ) -> status_t;
1085 }
1086 
1087 // The following functions are defined as macros in C/C++
get_area_info(id: area_id, info: *mut area_info) -> status_t1088 pub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t {
1089     _get_area_info(id, info, core::mem::size_of::<area_info>() as usize)
1090 }
1091 
get_next_area_info( team: team_id, cookie: *mut isize, info: *mut area_info, ) -> status_t1092 pub unsafe fn get_next_area_info(
1093     team: team_id,
1094     cookie: *mut isize,
1095     info: *mut area_info,
1096 ) -> status_t {
1097     _get_next_area_info(
1098         team,
1099         cookie,
1100         info,
1101         core::mem::size_of::<area_info>() as usize,
1102     )
1103 }
1104 
get_port_info(port: port_id, buf: *mut port_info) -> status_t1105 pub unsafe fn get_port_info(port: port_id, buf: *mut port_info) -> status_t {
1106     _get_port_info(port, buf, core::mem::size_of::<port_info>() as ::size_t)
1107 }
1108 
get_next_port_info( port: port_id, cookie: *mut i32, portInfo: *mut port_info, ) -> status_t1109 pub unsafe fn get_next_port_info(
1110     port: port_id,
1111     cookie: *mut i32,
1112     portInfo: *mut port_info,
1113 ) -> status_t {
1114     _get_next_port_info(
1115         port,
1116         cookie,
1117         portInfo,
1118         core::mem::size_of::<port_info>() as ::size_t,
1119     )
1120 }
1121 
get_port_message_info_etc( port: port_id, info: *mut port_message_info, flags: u32, timeout: bigtime_t, ) -> status_t1122 pub unsafe fn get_port_message_info_etc(
1123     port: port_id,
1124     info: *mut port_message_info,
1125     flags: u32,
1126     timeout: bigtime_t,
1127 ) -> status_t {
1128     _get_port_message_info_etc(
1129         port,
1130         info,
1131         core::mem::size_of::<port_message_info>() as ::size_t,
1132         flags,
1133         timeout,
1134     )
1135 }
1136 
get_sem_info(id: sem_id, info: *mut sem_info) -> status_t1137 pub unsafe fn get_sem_info(id: sem_id, info: *mut sem_info) -> status_t {
1138     _get_sem_info(id, info, core::mem::size_of::<sem_info>() as ::size_t)
1139 }
1140 
get_next_sem_info(team: team_id, cookie: *mut i32, info: *mut sem_info) -> status_t1141 pub unsafe fn get_next_sem_info(team: team_id, cookie: *mut i32, info: *mut sem_info) -> status_t {
1142     _get_next_sem_info(
1143         team,
1144         cookie,
1145         info,
1146         core::mem::size_of::<sem_info>() as ::size_t,
1147     )
1148 }
1149 
get_team_info(team: team_id, info: *mut team_info) -> status_t1150 pub unsafe fn get_team_info(team: team_id, info: *mut team_info) -> status_t {
1151     _get_team_info(team, info, core::mem::size_of::<team_info>() as ::size_t)
1152 }
1153 
get_next_team_info(cookie: *mut i32, info: *mut team_info) -> status_t1154 pub unsafe fn get_next_team_info(cookie: *mut i32, info: *mut team_info) -> status_t {
1155     _get_next_team_info(cookie, info, core::mem::size_of::<team_info>() as ::size_t)
1156 }
1157 
get_team_usage_info(team: team_id, who: i32, info: *mut team_usage_info) -> status_t1158 pub unsafe fn get_team_usage_info(team: team_id, who: i32, info: *mut team_usage_info) -> status_t {
1159     _get_team_usage_info(
1160         team,
1161         who,
1162         info,
1163         core::mem::size_of::<team_usage_info>() as ::size_t,
1164     )
1165 }
1166 
get_thread_info(id: thread_id, info: *mut thread_info) -> status_t1167 pub unsafe fn get_thread_info(id: thread_id, info: *mut thread_info) -> status_t {
1168     _get_thread_info(id, info, core::mem::size_of::<thread_info>() as ::size_t)
1169 }
1170 
get_next_thread_info( team: team_id, cookie: *mut i32, info: *mut thread_info, ) -> status_t1171 pub unsafe fn get_next_thread_info(
1172     team: team_id,
1173     cookie: *mut i32,
1174     info: *mut thread_info,
1175 ) -> status_t {
1176     _get_next_thread_info(
1177         team,
1178         cookie,
1179         info,
1180         core::mem::size_of::<thread_info>() as ::size_t,
1181     )
1182 }
1183 
1184 // kernel/image.h
get_image_info(image: image_id, info: *mut image_info) -> status_t1185 pub unsafe fn get_image_info(image: image_id, info: *mut image_info) -> status_t {
1186     _get_image_info(image, info, core::mem::size_of::<image_info>() as ::size_t)
1187 }
1188 
get_next_image_info( team: team_id, cookie: *mut i32, info: *mut image_info, ) -> status_t1189 pub unsafe fn get_next_image_info(
1190     team: team_id,
1191     cookie: *mut i32,
1192     info: *mut image_info,
1193 ) -> status_t {
1194     _get_next_image_info(
1195         team,
1196         cookie,
1197         info,
1198         core::mem::size_of::<image_info>() as ::size_t,
1199     )
1200 }
1201