+struct _WapiHandleSharedMetadata
+{
+ volatile guint32 offset;
+ guint32 timestamp;
+ volatile gboolean signalled;
+};
+
+struct _WapiHandleShared
+{
+ WapiHandleType type;
+ gboolean stale;
+
+ union
+ {
+ /* Leave this one while the thread is in the private
+ * set, so the shared space doesn't change size
+ */
+ struct _WapiHandle_thread thread;
+ struct _WapiHandle_process process;
+ struct _WapiHandle_namedmutex namedmutex;
+ } u;
+};
+
+#define _WAPI_SHARED_SEM_NAMESPACE 0
+#define _WAPI_SHARED_SEM_COLLECTION 1
+#define _WAPI_SHARED_SEM_SHARE 2
+#define _WAPI_SHARED_SEM_HANDLE 3
+#define _WAPI_SHARED_SEM_COUNT 8 /* Leave some future expansion space */
+
+struct _WapiHandleSharedLayout
+{
+ volatile guint32 signal_count;
+ volatile guint32 collection_count;
+ volatile key_t sem_key;
+
+ struct _WapiHandleSharedMetadata metadata[_WAPI_HANDLE_INITIAL_COUNT];
+ struct _WapiHandleShared handles[_WAPI_HANDLE_INITIAL_COUNT];
+};
+
+#define _WAPI_FILESHARE_SIZE 102400
+
+struct _WapiFileShare
+{
+ dev_t device;
+ ino_t inode;
+ pid_t opened_by_pid;
+ guint32 sharemode;
+ guint32 access;
+ guint32 handle_refs;
+ guint32 timestamp;
+};
+
+struct _WapiFileShareLayout
+{
+ guint32 hwm;
+
+ struct _WapiFileShare share_info[_WAPI_FILESHARE_SIZE];
+};
+
+
+
+#define _WAPI_HANDLE_INVALID (gpointer)-1