diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-05-28 00:09:50 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-05-28 00:09:50 +0530 |
| commit | c56cc12c154b3f21411d71e10f4e8a5a9682355b (patch) | |
| tree | 9e07f9cf746ca12ca386c3ea1bebe4953453045a /src/ipc.c | |
| parent | 2c2a70b69869f149c0407a62f1bf4c39899027a7 (diff) | |
the moves now make it to the frontend
i know the issue which exists, where the server can't handle the request
if i reload the page
Diffstat (limited to 'src/ipc.c')
| -rw-r--r-- | src/ipc.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -21,8 +21,19 @@ char* read_queue(mqd_t target) { return buf; } -void send_queue(mqd_t target, const char* msg) { - mq_send(target, msg, sizeof(msg), 0); +void send_queue(mqd_t target, const char* msg, int n) { + mq_send(target, msg, n, 0); +} + +int get_num_messages(mqd_t target) { + struct mq_attr target_attr; + + if (mq_getattr(target, &target_attr) == -1) { + perror("mq_getattr"); + exit(1); + } + + return target_attr.mq_curmsgs; } #endif // IPC_C |
