btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / kernel / wait_for_objects.h
blob30cd6f7f0e01ff8c081d97d942b950332cb94d82
1 /*
2 * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
6 #ifndef _KERNEL_WAIT_FOR_OBJECTS_H
7 #define _KERNEL_WAIT_FOR_OBJECTS_H
9 #include <OS.h>
11 #include <lock.h>
14 struct select_sync;
17 typedef struct select_info {
18 struct select_info* next; // next in the object's list
19 struct select_sync* sync;
20 int32 events;
21 uint16 selected_events;
22 } select_info;
24 typedef struct select_sync {
25 int32 ref_count;
26 sem_id sem;
27 uint32 count;
28 struct select_info* set;
29 } select_sync;
31 #define SELECT_FLAG(type) (1L << (type - 1))
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
39 extern void put_select_sync(select_sync* sync);
40 extern status_t notify_select_events(select_info* info, uint16 events);
41 extern void notify_select_events_list(select_info* list, uint16 events);
43 extern ssize_t _user_wait_for_objects(object_wait_info* userInfos,
44 int numInfos, uint32 flags, bigtime_t timeout);
47 #ifdef __cplusplus
49 #endif
51 #endif // _KERNEL_WAIT_FOR_OBJECTS_H