Skip to content

Commit 3c94161

Browse files
committed
syscalls/fallocate: Fix regression.
Since we use the libc fallocate syscall wrapper (if avaiable) these testcases started to fail on ix86. The reason is that we need to define _GNU_SOURCE in order to get fallocate function prototype and that the test uses loff_t to pass fallocate parameters (and fallocate() takes off_t as parameters). Now on ix86 (and possibly other 32bit platforms) without the right function prototype the parameters are passed as they are (without conversion) and loff_t is 64 bit in size while the function expects off_t which is 32 bit. This results into wrong parameters passed to the syscall (lenght was zero in my case) which yielded EINVAL and the testcases failed. Signed-off-by: Cyril Hrubis <[email protected]>
1 parent d40d54c commit 3c94161

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

testcases/kernel/syscalls/fallocate/fallocate01.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
*
8686
*************************************************************************/
8787

88+
#define _GNU_SOURCE
89+
8890
#include <stdio.h>
8991
#include <stdlib.h>
9092
#include <endian.h>

testcases/kernel/syscalls/fallocate/fallocate03.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
*
8383
*************************************************************************/
8484

85+
#define _GNU_SOURCE
86+
8587
#include <stdio.h>
8688
#include <stdlib.h>
8789
#include <endian.h>

0 commit comments

Comments
 (0)