From 1ca72b695ee15ff730a93d1d2602f6f9d58b79f8 Mon Sep 17 00:00:00 2001 From: user Date: Wed, 25 Feb 2026 00:16:33 +0100 Subject: [PATCH] other ipc fix --- user/app1/appl.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/user/app1/appl.cc b/user/app1/appl.cc index 44976bd..f187977 100644 --- a/user/app1/appl.cc +++ b/user/app1/appl.cc @@ -46,7 +46,7 @@ extern "C" void main() { //sys_test(1,2,3,4,5); unsigned id = sys_getpid(); - char text[] = "appX "; + char text[] = "appX "; text[3] = 0x30+id; write(1, text, sizeof(text), 0, (int)id); @@ -55,14 +55,15 @@ extern "C" void main() { for (unsigned i = 1;; ++i) { if(i%10 == 0){ if(id == 2){ - send(4, text, strlen(text), text, 5); + send(4, text, strlen(text), text, 15); write(1, text, strlen(text), 25, (int)id); } if(id == 4){ char blubb[10]; - receive(blubb, 10); + if(receive(blubb, 20)){ write(1, blubb, strlen(blubb), 25, (int)id); - reply("toast", 5); + } + reply("toast ", 11); } }