Skip to content

Commit 619eb33

Browse files
committed
ZTS: small fix for SEEK_DATA/SEEK_HOLE tests
Some libc's like uClibc lag the proper definition of SEEK_DATA and SEEK_HOLE. Since we have only two files in ZTS which use these definitons, let's define them by hand: ``` #ifndef SEEK_DATA #define SEEK_DATA 3 #endif #ifndef SEEK_HOLE #define SEEK_HOLE 4 #endif ``` There should be no failures, because: - FreeBSD has support for SEEK_DATA/SEEK_HOLE since FreeBSD 8 - Linux has it since Linux 3.1 - the libc will submit the parameters unchanged to the kernel Signed-off-by: Tino Reichardt <[email protected]>
1 parent c8184d7 commit 619eb33

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/zfs-tests/cmd/mmap_seek.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
#include <linux/fs.h>
3636
#endif
3737

38+
/* some libc's lag the defines currently */
39+
#ifndef SEEK_DATA
40+
#define SEEK_DATA 3
41+
#endif
42+
#ifndef SEEK_HOLE
43+
#define SEEK_HOLE 4
44+
#endif
45+
3846
static void
3947
seek_data(int fd, off_t offset, off_t expected)
4048
{

tests/zfs-tests/tests/functional/cp_files/seekflood.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
#include <sys/stat.h>
3737
#include <sys/wait.h>
3838

39+
/* some libc's lag the define currently */
40+
#ifndef SEEK_DATA
41+
#define SEEK_DATA 3
42+
#endif
43+
3944
#define DATASIZE (4096)
4045
char data[DATASIZE];
4146

0 commit comments

Comments
 (0)