<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Xu,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><span class="gmail_default" style="font-size:small">Y</span>ang Xu <<a href="mailto:xuyang2018.jy@cn.fujitsu.com" target="_blank">xuyang2018.jy@cn.fujitsu.com</a>> wrote:<br></div><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail_default" style="font-size:small">...</span><br>
> <br>
> # ./pipe2_03<br>
> tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s<br>
> pipe2_03.c:48: PASS: Each write(2) uses a separate packet<br>
> pipe2_03.c:61: PASS: Each read(2) reads a separate packet<br>
> pipe2_03.c:81: PASS: write(higner than PIPE_BUF) split into multiple packet<br>
> pipe2_03.c:108: FAIL: the excess bytes in the packet is discarded by <br>
> read, expect 1 got 1%A<br>
Even I use one fork and exit(0), I don't meet this problem. Or, I miss <br>
something?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I think I got the point. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In your test code for pipe2(), you didn't use pipe in the correct way. Even that we define the fds[2] as a global variable, there still have a new copy for fds[2] in the child process, we should close one of the pipes in child and parent to make the connection is built correspondingly, then that will work normally for us.</div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I suggest redesigning some of the test structs. What do you think? </div><div><br></div><div><div class="gmail_default" style="font-size:small">Fyi: <a href="https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/pipe/pipe02.c">https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/pipe/pipe02.c</a></div></div><div><br></div></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>