Files
mop3/init/init.c
kamkow1 9043c4f9ec
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m27s
Implement waiting for process, CE add command cancelation, rctx many cpus
2026-03-01 22:59:04 +01:00

38 lines
640 B
C

#include <kb.h>
#include <limits.h>
#include <process.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <terminal.h>
#define RECV_MAX (1024 * 16)
static int ce_pgid;
void receiver (void) {
for (;;) {
char recv[RECV_MAX];
memset (recv, 0, sizeof (recv));
mail_receive (&recv, sizeof (recv) - 1);
terminal_print (recv, strlen (recv));
}
}
void app_main (void) {
int ce_pid = exec ("RD", "ce");
ce_pgid = get_procgroup (ce_pid);
process_spawn (&receiver, NULL);
for (;;) {
int ch = kb_read_key ();
if (ch <= 0)
continue;
mail_send (ce_pgid, (uint8_t*)&ch, 1);
}
}