other ipc fix

This commit is contained in:
user
2026-02-25 00:16:33 +01:00
parent 6cea3c091f
commit 1ca72b695e

View File

@@ -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);
}
}