restructure app output

This commit is contained in:
2026-03-01 15:46:15 +01:00
parent 92ceb1f5e2
commit 315d49c2d0

View File

@@ -8,7 +8,9 @@ void main() {
fork();
int ppid = sys_getpid();
int other = fork();
//write(1, "app", 3, 0, ppid);
int pid = sys_getpid();
write(1, "app", 3, 0, pid);
if (ppid == other) { // child
sbuf[0] = 3;
sbuf[8192] = sys_getpid();
@@ -18,7 +20,7 @@ void main() {
char msg[] = "REPLY: AA\n";
msg[7] += rbuf[0] + sbuf[8193];
msg[8] += 4 + ppid;
write(0, msg, 10);
write(0, msg, 10, 20, pid);
} else { // parent
// int X = recv(rbuf, 8193);
receive(rbuf, 8193);