Commit 321793cd authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

test: Add pipes output into testee

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent c9c2bddc
...@@ -207,8 +207,10 @@ int main(int argc, char *argv[]) ...@@ -207,8 +207,10 @@ int main(int argc, char *argv[])
goto err; goto err;
if (child == 0) { if (child == 0) {
printf("first child pid: %d\n", getpid()); printf("first child pid: %d\n", getpid());
while (read(pipefd[0], &buf, sizeof(buf)) > 0) while (read(pipefd[0], &buf, sizeof(buf)) > 0) {
printf("pipe-r: %8lx\n", buf);
sleep(3); sleep(3);
}
*(unsigned long *)mmap_anon_sh = 0x11111111; *(unsigned long *)mmap_anon_sh = 0x11111111;
while (1) { while (1) {
printf("ping: %d\n", getpid()); printf("ping: %d\n", getpid());
...@@ -219,6 +221,7 @@ int main(int argc, char *argv[]) ...@@ -219,6 +221,7 @@ int main(int argc, char *argv[])
printf("first parent pid: %d\n", getpid()); printf("first parent pid: %d\n", getpid());
// run_clone(); // run_clone();
while (1) { while (1) {
printf("pipe-r: %8lx\n", buf);
printf("ping: %d\n", getpid()); printf("ping: %d\n", getpid());
sleep(9); sleep(9);
} }
...@@ -229,6 +232,7 @@ int main(int argc, char *argv[]) ...@@ -229,6 +232,7 @@ int main(int argc, char *argv[])
float res = 0.9; float res = 0.9;
*(unsigned long *)mmap_anon_sh = 0x33333333; *(unsigned long *)mmap_anon_sh = 0x33333333;
printf("ping: %d %f\n", getpid(), res + (float)(unsigned long)mmap_anon_sh); printf("ping: %d %f\n", getpid(), res + (float)(unsigned long)mmap_anon_sh);
printf("pipe-w: %8lx\n", buf);
write(pipefd[1], &buf, sizeof(buf)); write(pipefd[1], &buf, sizeof(buf));
sleep(10); sleep(10);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment