plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright (c) International Business Machines Corp., 2001 |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
| 13 | * the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
Wanlong Gao | 4548c6c | 2012-10-19 18:03:36 +0800 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | /* |
| 21 | * NAME |
| 22 | * sendfile02.c |
| 23 | * |
| 24 | * DESCRIPTION |
| 25 | * Testcase to test the basic functionality of the sendfile(2) system call. |
| 26 | * |
| 27 | * ALGORITHM |
| 28 | * 1. call sendfile(2) with offset = 0 |
| 29 | * 2. call sendfile(2) with offset in the middle of the file |
| 30 | * |
| 31 | * USAGE: <for command-line> |
| 32 | * sendfile02 [-c n] [-f] [-i n] [-I x] [-P x] [-t] |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 33 | * where, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 34 | * -f : Turn off functionality Testing. |
| 35 | * -i n : Execute test n times. |
| 36 | * -I x : Execute test for x seconds. |
| 37 | * -P x : Pause for x seconds between iterations. |
| 38 | * -t : Turn on syscall timing. |
| 39 | * |
| 40 | * HISTORY |
| 41 | * 07/2001 Ported by Wayne Boyer |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 42 | * 08/2002 Make it use a socket so it works with 2.5 kernel |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 43 | * |
| 44 | * RESTRICTIONS |
| 45 | * NONE |
| 46 | */ |
| 47 | #include <stdio.h> |
| 48 | #include <errno.h> |
| 49 | #include <fcntl.h> |
| 50 | #include <sys/stat.h> |
plars | 8b6d9bf | 2002-03-05 13:55:58 +0000 | [diff] [blame] | 51 | #include <sys/sendfile.h> |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 52 | #include <sys/types.h> |
robbiew | 31f6f67 | 2003-01-28 14:50:49 +0000 | [diff] [blame] | 53 | #include <sys/wait.h> |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 54 | #include <sys/socket.h> |
| 55 | #include <netinet/in.h> |
robbiew | 31f6f67 | 2003-01-28 14:50:49 +0000 | [diff] [blame] | 56 | #include <arpa/inet.h> |
subrata_modak | 498546d | 2007-12-05 08:44:26 +0000 | [diff] [blame] | 57 | #include <unistd.h> |
subrata_modak | 923b23f | 2009-11-02 13:57:16 +0000 | [diff] [blame] | 58 | #include <inttypes.h> |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 59 | #include "test.h" |
| 60 | |
subrata_modak | b752e85 | 2007-11-28 11:20:03 +0000 | [diff] [blame] | 61 | #ifndef OFF_T |
| 62 | #define OFF_T off_t |
| 63 | #endif /* Not def: OFF_T */ |
| 64 | |
subrata_modak | 585950c | 2008-08-20 10:55:19 +0000 | [diff] [blame] | 65 | TCID_DEFINE(sendfile02); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 66 | int TST_TOTAL = 4; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 67 | |
| 68 | char in_file[100]; |
| 69 | char out_file[100]; |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 70 | int out_fd; |
robbiew | 31f6f67 | 2003-01-28 14:50:49 +0000 | [diff] [blame] | 71 | pid_t child_pid; |
robbiew | 9827066 | 2003-05-14 14:17:45 +0000 | [diff] [blame] | 72 | static int sockfd, s; |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 73 | static struct sockaddr_in sin1; /* shared between do_child and create_server */ |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 74 | |
| 75 | void cleanup(void); |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 76 | void do_child(void); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 77 | void setup(void); |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 78 | int create_server(void); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 79 | |
| 80 | struct test_case_t { |
| 81 | char *desc; |
| 82 | int offset; |
| 83 | int exp_retval; |
subrata_modak | 498546d | 2007-12-05 08:44:26 +0000 | [diff] [blame] | 84 | int exp_updated_offset; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 85 | } testcases[] = { |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 86 | { |
| 87 | "Test sendfile(2) with offset = 0", 0, 26, 26}, { |
| 88 | "Test sendfile(2) with offset in the middle of file", 2, 24, 26}, { |
| 89 | "Test sendfile(2) with offset in the middle of file", 4, 22, 26}, { |
| 90 | "Test sendfile(2) with offset in the middle of file", 6, 20, 26} |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 91 | }; |
| 92 | |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 93 | #ifdef UCLINUX |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 94 | static char *argv0; |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 95 | #endif |
| 96 | |
subrata_modak | b752e85 | 2007-11-28 11:20:03 +0000 | [diff] [blame] | 97 | void do_sendfile(OFF_T offset, int i) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 98 | { |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 99 | int in_fd; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 100 | struct stat sb; |
robbiew | 33b7774 | 2002-10-02 14:56:00 +0000 | [diff] [blame] | 101 | int wait_status; |
robbiew | 31f6f67 | 2003-01-28 14:50:49 +0000 | [diff] [blame] | 102 | int wait_stat; |
subrata_modak | 498546d | 2007-12-05 08:44:26 +0000 | [diff] [blame] | 103 | off_t before_pos, after_pos; |
| 104 | |
robbiew | 31f6f67 | 2003-01-28 14:50:49 +0000 | [diff] [blame] | 105 | out_fd = create_server(); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 106 | |
| 107 | if ((in_fd = open(in_file, O_RDONLY)) < 0) { |
| 108 | tst_brkm(TBROK, cleanup, "open failed: %d", errno); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 109 | } |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 110 | if (stat(in_file, &sb) < 0) { |
| 111 | tst_brkm(TBROK, cleanup, "stat failed: %d", errno); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 112 | } |
subrata_modak | 498546d | 2007-12-05 08:44:26 +0000 | [diff] [blame] | 113 | |
| 114 | if ((before_pos = lseek(in_fd, 0, SEEK_CUR)) < 0) { |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 115 | tst_brkm(TBROK, cleanup, |
| 116 | "lseek before invoking sendfile failed: %d", errno); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 117 | } |
subrata_modak | bdbaec5 | 2009-02-26 12:14:51 +0000 | [diff] [blame] | 118 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 119 | TEST(sendfile(out_fd, in_fd, &offset, sb.st_size - offset)); |
| 120 | |
subrata_modak | 498546d | 2007-12-05 08:44:26 +0000 | [diff] [blame] | 121 | if ((after_pos = lseek(in_fd, 0, SEEK_CUR)) < 0) { |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 122 | tst_brkm(TBROK, cleanup, |
| 123 | "lseek after invoking sendfile failed: %d", errno); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 124 | } |
subrata_modak | bdbaec5 | 2009-02-26 12:14:51 +0000 | [diff] [blame] | 125 | |
Cyril Hrubis | e38b961 | 2014-06-02 17:20:57 +0200 | [diff] [blame] | 126 | /* Close the sockets */ |
| 127 | shutdown(sockfd, SHUT_RDWR); |
| 128 | shutdown(s, SHUT_RDWR); |
| 129 | if (TEST_RETURN != testcases[i].exp_retval) { |
| 130 | tst_resm(TFAIL, "sendfile(2) failed to return " |
| 131 | "expected value, expected: %d, " |
| 132 | "got: %ld", testcases[i].exp_retval, |
| 133 | TEST_RETURN); |
| 134 | kill(child_pid, SIGKILL); |
| 135 | } else if (offset != testcases[i].exp_updated_offset) { |
| 136 | tst_resm(TFAIL, "sendfile(2) failed to update " |
| 137 | "OFFSET parameter to expected value, " |
| 138 | "expected: %d, got: %" PRId64, |
| 139 | testcases[i].exp_updated_offset, |
| 140 | (int64_t) offset); |
| 141 | } else if (before_pos != after_pos) { |
| 142 | tst_resm(TFAIL, "sendfile(2) updated the file position " |
| 143 | " of in_fd unexpectedly, expected file position: %" |
| 144 | PRId64 ", " " actual file position %" PRId64, |
| 145 | (int64_t) before_pos, (int64_t) after_pos); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 146 | } else { |
Cyril Hrubis | e38b961 | 2014-06-02 17:20:57 +0200 | [diff] [blame] | 147 | tst_resm(TPASS, "functionality of sendfile() is " |
| 148 | "correct"); |
| 149 | wait_status = waitpid(-1, &wait_stat, 0); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 150 | } |
| 151 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 152 | close(in_fd); |
| 153 | } |
| 154 | |
| 155 | /* |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 156 | * do_child |
| 157 | */ |
Mike Frysinger | c57fba5 | 2014-04-09 18:56:30 -0400 | [diff] [blame] | 158 | void do_child(void) |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 159 | { |
| 160 | int lc; |
vapier | 1968aef | 2006-05-26 06:35:43 +0000 | [diff] [blame] | 161 | socklen_t length; |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 162 | char rbuf[4096]; |
| 163 | |
| 164 | for (lc = 0; TEST_LOOPING(lc); lc++) { |
| 165 | length = sizeof(sin1); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 166 | recvfrom(sockfd, rbuf, 4096, 0, (struct sockaddr *)&sin1, |
| 167 | &length); |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 168 | } |
| 169 | exit(0); |
| 170 | } |
| 171 | |
| 172 | /* |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 173 | * setup() - performs all ONE TIME setup for this test. |
| 174 | */ |
Mike Frysinger | c57fba5 | 2014-04-09 18:56:30 -0400 | [diff] [blame] | 175 | void setup(void) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 176 | { |
| 177 | int fd; |
| 178 | char buf[100]; |
| 179 | |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 180 | tst_sig(FORK, DEF_HANDLER, cleanup); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 181 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 182 | TEST_PAUSE; |
| 183 | |
| 184 | /* make a temporary directory and cd to it */ |
| 185 | tst_tmpdir(); |
| 186 | sprintf(in_file, "in.%d", getpid()); |
| 187 | if ((fd = creat(in_file, 00700)) < 0) { |
| 188 | tst_brkm(TBROK, cleanup, "creat failed in setup, errno: %d", |
| 189 | errno); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 190 | } |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 191 | sprintf(buf, "abcdefghijklmnopqrstuvwxyz"); |
| 192 | if (write(fd, buf, strlen(buf)) < 0) { |
| 193 | tst_brkm(TBROK, cleanup, "write failed, errno: %d", errno); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 194 | } |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 195 | close(fd); |
| 196 | sprintf(out_file, "out.%d", getpid()); |
| 197 | } |
| 198 | |
| 199 | /* |
| 200 | * cleanup() - performs all ONE TIME cleanup for this test at |
| 201 | * completion or premature exit. |
| 202 | */ |
Mike Frysinger | c57fba5 | 2014-04-09 18:56:30 -0400 | [diff] [blame] | 203 | void cleanup(void) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 204 | { |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 205 | |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 206 | close(out_fd); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 207 | /* delete the test directory created in setup() */ |
| 208 | tst_rmdir(); |
| 209 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 210 | } |
| 211 | |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 212 | int create_server(void) |
| 213 | { |
| 214 | static int count = 0; |
Jan Stancek | 6e4e77a | 2014-03-07 11:39:56 +0100 | [diff] [blame] | 215 | socklen_t slen = sizeof(sin1); |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 216 | |
| 217 | sockfd = socket(PF_INET, SOCK_DGRAM, 0); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 218 | if (sockfd < 0) { |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 219 | tst_brkm(TBROK, cleanup, "call to socket() failed: %s", |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 220 | strerror(errno)); |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 221 | return -1; |
| 222 | } |
robbiew | 31f6f67 | 2003-01-28 14:50:49 +0000 | [diff] [blame] | 223 | sin1.sin_family = AF_INET; |
Jan Stancek | 6e4e77a | 2014-03-07 11:39:56 +0100 | [diff] [blame] | 224 | sin1.sin_port = 0; /* pick random free port */ |
robbiew | 31f6f67 | 2003-01-28 14:50:49 +0000 | [diff] [blame] | 225 | sin1.sin_addr.s_addr = INADDR_ANY; |
robbiew | e93a324 | 2005-08-31 20:27:12 +0000 | [diff] [blame] | 226 | count++; |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 227 | if (bind(sockfd, (struct sockaddr *)&sin1, sizeof(sin1)) < 0) { |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 228 | tst_brkm(TBROK, cleanup, "call to bind() failed: %s", |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 229 | strerror(errno)); |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 230 | return -1; |
| 231 | } |
Jan Stancek | 6e4e77a | 2014-03-07 11:39:56 +0100 | [diff] [blame] | 232 | if (getsockname(sockfd, (struct sockaddr *)&sin1, &slen) == -1) |
| 233 | tst_brkm(TBROK | TERRNO, cleanup, "getsockname failed"); |
| 234 | |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 235 | child_pid = FORK_OR_VFORK(); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 236 | if (child_pid < 0) { |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 237 | tst_brkm(TBROK, cleanup, "client/server fork failed: %s", |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 238 | strerror(errno)); |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 239 | return -1; |
| 240 | } |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 241 | if (!child_pid) { /* child */ |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 242 | #ifdef UCLINUX |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 243 | if (self_exec(argv0, "") < 0) { |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 244 | tst_brkm(TBROK, cleanup, "self_exec failed"); |
| 245 | return -1; |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 246 | |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 247 | } |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 248 | #else |
| 249 | do_child(); |
| 250 | #endif |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | s = socket(PF_INET, SOCK_DGRAM, 0); |
| 254 | inet_aton("127.0.0.1", &sin1.sin_addr); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 255 | if (s < 0) { |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 256 | tst_brkm(TBROK, cleanup, "call to socket() failed: %s", |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 257 | strerror(errno)); |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 258 | return -1; |
| 259 | } |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 260 | if (connect(s, (struct sockaddr *)&sin1, sizeof(sin1)) < 0) { |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 261 | tst_brkm(TBROK, cleanup, "call to connect() failed: %s", |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 262 | strerror(errno)); |
plars | 16bfb44 | 2002-08-05 22:07:16 +0000 | [diff] [blame] | 263 | } |
| 264 | return s; |
| 265 | |
| 266 | } |
robbiew | aa01abd | 2003-03-27 18:39:24 +0000 | [diff] [blame] | 267 | |
| 268 | int main(int ac, char **av) |
| 269 | { |
| 270 | int i; |
Cyril Hrubis | 89af32a | 2012-10-24 16:39:11 +0200 | [diff] [blame] | 271 | int lc; |
Cyril Hrubis | 0b9589f | 2014-05-27 17:40:33 +0200 | [diff] [blame] | 272 | const char *msg; /* parse_opts() return message */ |
robbiew | aa01abd | 2003-03-27 18:39:24 +0000 | [diff] [blame] | 273 | |
Garrett Cooper | 45e285d | 2010-11-22 12:19:25 -0800 | [diff] [blame] | 274 | if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { |
Garrett Cooper | 60fa801 | 2010-11-22 13:50:58 -0800 | [diff] [blame] | 275 | tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 276 | } |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 277 | #ifdef UCLINUX |
| 278 | argv0 = av[0]; |
| 279 | maybe_run_child(&do_child, ""); |
| 280 | #endif |
| 281 | |
robbiew | aa01abd | 2003-03-27 18:39:24 +0000 | [diff] [blame] | 282 | setup(); |
| 283 | |
| 284 | /* |
| 285 | * The following loop checks looping state if -c option given |
| 286 | */ |
| 287 | for (lc = 0; TEST_LOOPING(lc); lc++) { |
Caspar Zhang | d59a659 | 2013-03-07 14:59:12 +0800 | [diff] [blame] | 288 | tst_count = 0; |
robbiew | aa01abd | 2003-03-27 18:39:24 +0000 | [diff] [blame] | 289 | |
| 290 | for (i = 0; i < TST_TOTAL; ++i) { |
| 291 | do_sendfile(testcases[i].offset, i); |
| 292 | } |
| 293 | } |
| 294 | cleanup(); |
| 295 | |
Garrett Cooper | 5374050 | 2010-12-16 00:04:01 -0800 | [diff] [blame] | 296 | tst_exit(); |
Chris Dearman | ec6edca | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 297 | } |