mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
5f68cd8242
git-svn-id: file:///svn/toku/tokudb@18191 c7de825b-a66e-492c-adef-691d508d4ae1
39 lines
819 B
C
39 lines
819 B
C
#include <test.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <toku_assert.h>
|
|
#include <fcntl.h>
|
|
#include "toku_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 test_main(int argc, char *const 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;
|
|
}
|