From: Mark Wielaard Date: Sat, 13 Feb 2010 19:54:58 +0000 (+0100) Subject: Test for sendfile syscall can handle non-socket fds now. X-Git-Tag: release-1.2~201^2~1 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=a7367d45ca743e8842bf824b0fa2285054d26f74;p=systemtap.git Test for sendfile syscall can handle non-socket fds now. Since 2.6.33 sendfile can handle non-socket fds, so make the test handle both success and failure. * testsuite/systemtap.syscall/sendfile.c (main): Make buffer 22 bytes, since 22 == EINVAL, test for 22 bytes send or -22 failure. --- diff --git a/testsuite/systemtap.syscall/sendfile.c b/testsuite/systemtap.syscall/sendfile.c index 690d078e9..a21694fe6 100644 --- a/testsuite/systemtap.syscall/sendfile.c +++ b/testsuite/systemtap.syscall/sendfile.c @@ -14,7 +14,7 @@ int main () int write_fd; struct stat stat_buf; off_t offset = 0; - char buff[512]; + char buff[22]; // Note below 22 == EINVAL int ret; memset(buff, 5, sizeof(buff)); @@ -32,11 +32,11 @@ int main () write_fd = creat("foobar2",S_IREAD|S_IWRITE|S_IRWXO); /* - * For kernel2.6 the write_fd has to be a socket otherwise - * sendfile will fail. So we test for failure here. + * For 2.6 the write_fd had to be a socket otherwise + * sendfile would fail. So we also test for failure here. */ ret = sendfile (write_fd, read_fd, &offset, stat_buf.st_size); - //staptest// sendfile (NNNN, NNNN, XXXX, 512) = -22 (EINVAL) + //staptest// sendfile (NNNN, NNNN, XXXX, 22) = -?22 close (read_fd); close (write_fd);