Commit 55b3f5eb authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Test for toku_os_pwrite to see if it can write beyond 4GB. Addresses #1519.

git-svn-id: file:///svn/toku/tokudb@9777 c7de825b-a66e-492c-adef-691d508d4ae1
parent 93a8bf99
......@@ -84,6 +84,7 @@ REGRESSION_TESTS_RAW = \
memtest \
omt-cursor-test \
omt-test \
pwrite4g \
shortcut \
test1305 \
test1308a \
......
/* Verify that toku_os_pwrite does the right thing when writing beyond 4GB. */
#include <fcntl.h>
#include "../toku_include/toku_portability.h"
#include <assert.h>
int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
char fname[] = "pwrite4g.data";
int r = unlink(fname);
assert(r==0);
int fd = open(fname, O_RDWR | O_CREAT | O_BINARY, S_IRWXU|S_IRWXG|S_IRWXO);
assert(fd>=0);
char buf[] = "hello";
r = toku_os_pwrite(fd, buf, sizeof(buf), (1LL<<32)+100);
assert(r==sizeof(buf));
r = close(fd);
assert(r==0);
struct stat statbuf;
r = stat(fname, &statbuf);
assert(r==0);
assert(statbuf.st_size > 100 + (signed)sizeof(buf));
return 0;
}
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