mariadb/windows/tests/test-pread.c
Rich Prohaska 0d44815bf5 merge some tokudb.1032 into 1032b. addresses #1032
git-svn-id: file:///svn/toku/tokudb.1032b@7778 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-16 23:57:27 -04:00

39 lines
805 B
C

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <fcntl.h>
#include "portability.h"
#include "os.h"
int verbose;
static void test_pread_empty(const char *fname) {
int fd;
char c[12];
uint64_t r;
unlink(fname);
fd = open(fname, O_RDWR | O_CREAT | O_BINARY, S_IRWXU|S_IRWXG|S_IRWXO);
if (verbose)
printf("open %s fd %d\n", fname, fd);
assert(fd != -1);
r = pread(fd, c, sizeof c, 0);
assert(r == 0);
r = close(fd);
if (verbose)
printf("close %s %"PRIu64"\n", fname, r);
}
int main(int argc, char *argv[]) {
int i;
for (i=1; i<argc; i++) {
char *arg = argv[i];
if (strcmp(arg, "-v") == 0 || strcmp(arg, "--verbose") == 0)
verbose++;
}
test_pread_empty("junk");
return 0;
}