Merge branch 'master' of gitlab.ibr.cs.tu-bs.de:vss/teaching/ws25/v_bsb2/Gruppe_003
This commit is contained in:
@@ -6,25 +6,25 @@ char sbuf[8194], rbuf[8194]; // (2 * 4KiB) + 2
|
|||||||
void main() {
|
void main() {
|
||||||
fork();
|
fork();
|
||||||
fork();
|
fork();
|
||||||
int other = fork();
|
|
||||||
int ppid = sys_getpid();
|
int ppid = sys_getpid();
|
||||||
write(1, "app", 3, 0, ppid);
|
int other = fork();
|
||||||
//if (ppid == other) { // child
|
//write(1, "app", 3, 0, ppid);
|
||||||
// sbuf[0] = 3;
|
if (ppid == other) { // child
|
||||||
// sbuf[8192] = sys_getpid();
|
sbuf[0] = 3;
|
||||||
// sbuf[8193] = 1;
|
sbuf[8192] = sys_getpid();
|
||||||
// send(other, sbuf, 8193, rbuf, 8193);
|
sbuf[8193] = 1;
|
||||||
|
send(other, sbuf, 8193, rbuf, 8193);
|
||||||
|
|
||||||
// char msg[] = "REPLY: AA\n";
|
char msg[] = "REPLY: AA\n";
|
||||||
// msg[7] += rbuf[0] + sbuf[8193];
|
msg[7] += rbuf[0] + sbuf[8193];
|
||||||
// msg[8] += 4 + ppid;
|
msg[8] += 4 + ppid;
|
||||||
// write(0, msg, 10);
|
write(0, msg, 10,0, ppid);
|
||||||
//} else { // parent
|
} else { // parent
|
||||||
// receive(rbuf, 8193);
|
receive(rbuf, 8193);
|
||||||
// rbuf[0] = rbuf[0] + rbuf[8192];
|
rbuf[0] = rbuf[0] + rbuf[8192];
|
||||||
// rbuf[8193] = 7;
|
rbuf[8193] = 7;
|
||||||
// reply(rbuf, 8193);
|
reply(rbuf, 8193);
|
||||||
//}
|
}
|
||||||
|
|
||||||
sys_exit();
|
sys_exit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user