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 "mqueue-syscalls.h"
11
#include "net-syscalls.h"
12
13
struct
MqueueNotification
{
14
MqueueNotification
() : process(
nullptr
), pid(0), event(), socket(), cookie() {}
15
Process
* process;
16
size_t
pid;
17
LinuxMqSigevent
event;
18
SharedPointer<NetworkSyscalls>
socket;
19
uint8_t cookie[32];
20
void
complete(
bool
removed);
21
};
22
23
struct
MqueueState
{
24
struct
Message
{
25
Message
() : next(-1), length(0), priority(0) {}
26
int
next;
27
size_t
length;
28
unsigned
priority;
29
};
30
MqueueState
(
const
String
& name,
size_t
capacity,
size_t
size, int64_t uid, int64_t gid,
31
unsigned
mode);
32
Mutex
lock;
33
ConditionVariable
readers, writers;
34
String
name;
35
size_t
capacity, size, count, receiverCount;
36
int64_t uid, gid;
37
unsigned
mode;
38
int
head, free;
39
UniqueArray<Message>
messages;
40
UniqueArray<uint8_t>
storage;
41
MqueueNotification
notification;
42
ReadinessGenerations
generations;
43
};
44
45
extern
Mutex
g_MqueueRegistryLock;
46
extern
List<PosixMessageQueue*>
g_Mqueues;
47
48
#endif
ConditionVariable
Definition
ConditionVariable.h:35
List
Definition
List.h:61
Mutex
Definition
Mutex.h:56
Process
Definition
Process.h:73
SharedPointer
Definition
SharedPointer.h:31
String
Definition
String.h:49
UniqueArray
Definition
Pointers.h:131
LinuxMqSigevent
Definition
mqueue-syscalls.h:20
MqueueNotification
Definition
mqueue-state.h:13
MqueueState::Message
Definition
mqueue-state.h:24
MqueueState
Definition
mqueue-state.h:23
ReadinessGenerations
Definition
Readiness.h:31
Generated on Tue Sep 22 2026 06:05:42 for The Pedigree Project by
1.9.8