The Pedigree Project
0.1
src
modules
subsys
posix
mqueue-state.h
1
/* Copyright (c) 2026, Pedigree Developers. */
2
#ifndef POSIX_MQUEUE_STATE_H
3
#define POSIX_MQUEUE_STATE_H
4
5
#include "pedigree/kernel/process/ConditionVariable.h"
6
#include "pedigree/kernel/process/Mutex.h"
7
#include "pedigree/kernel/utilities/List.h"
8
#include "pedigree/kernel/utilities/Pointers.h"
9
10
#include "ipc-namespace.h"
11
#include "mqueue-syscalls.h"
12
#include "net-syscalls.h"
13
14
struct
MqueueNotification
{
15
MqueueNotification
() : process(
nullptr
), pid(0), event(), socket(), cookie() {}
16
Process
* process;
17
size_t
pid;
18
LinuxMqSigevent
event;
19
SharedPointer<NetworkSyscalls>
socket;
20
uint8_t cookie[32];
21
void
complete(
bool
removed);
22
};
23
24
struct
MqueueState
{
25
uint64_t namespaceId = posix_ipc_namespace_id();
26
struct
Message
{
27
Message
() : next(-1), length(0), priority(0) {}
28
int
next;
29
size_t
length;
30
unsigned
priority;
31
};
32
MqueueState
(
const
String
& name,
size_t
capacity,
size_t
size, int64_t uid, int64_t gid,
33
unsigned
mode);
34
Mutex
lock;
35
ConditionVariable
readers, writers;
36
String
name;
37
size_t
capacity, size, count, receiverCount;
38
int64_t uid, gid;
39
unsigned
mode;
40
int
head, free;
41
UniqueArray<Message>
messages;
42
UniqueArray<uint8_t>
storage;
43
MqueueNotification
notification;
44
ReadinessGenerations
generations;
45
};
46
47
extern
Mutex
g_MqueueRegistryLock;
48
extern
List<PosixMessageQueue*>
g_Mqueues;
49
50
#endif
ConditionVariable
Definition
ConditionVariable.h:35
List
Definition
List.h:61
Mutex
Definition
Mutex.h:56
Process
Definition
Process.h:109
SharedPointer
Definition
SharedPointer.h:31
String
Definition
String.h:43
UniqueArray
Definition
Pointers.h:131
LinuxMqSigevent
Definition
mqueue-syscalls.h:20
MqueueNotification
Definition
mqueue-state.h:14
MqueueState::Message
Definition
mqueue-state.h:26
MqueueState
Definition
mqueue-state.h:24
ReadinessGenerations
Definition
Readiness.h:31
Generated on Sat Oct 3 2026 06:38:05 for The Pedigree Project by
1.9.8