Skip to content

Commit 41e6f9c

Browse files
committed
syscalls/fadvise: Fix regression
These test were disabled from execution without _FILE_OFFSET_BITS != 64 since their conversion into the new library. The problem is that we didn't copied the original condition correctly. Originally the tests were disabled in case of: if ((_FILE_OFFSET_BITS != 64) && (__NR_fadvise64 == 0)) While after the change they were disabled in case of: Now looking at the original condition the __NR_fadvise64 was never equal to 0, since the original tests included lapi/syscalls.h which defines fallback definitions with value -1. So either had the __NR_fadvise64 correct value or was set to -1. All in all looking at the code it does not make sense to disable these tests anyway, so this commit just removes the ifdefs. Signed-off-by: Cyril Hrubis <[email protected]> CC: Amir Goldstein <[email protected]>
1 parent 2b37d84 commit 41e6f9c

File tree

4 files changed

+0
-43
lines changed

4 files changed

+0
-43
lines changed

testcases/kernel/syscalls/fadvise/posix_fadvise01.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
#include <string.h>
3030

3131
#include "tst_test.h"
32-
3332
#include "lapi/syscalls.h"
34-
#ifndef _FILE_OFFSET_BITS
35-
#define _FILE_OFFSET_BITS 32
36-
#endif
37-
38-
#if (_FILE_OFFSET_BITS == 64)
3933

4034
char fname[] = "/bin/cat"; /* test executable to open */
4135
int fd = -1; /* initialized in open */
@@ -86,8 +80,3 @@ static struct tst_test test = {
8680
.test = verify_fadvise,
8781
.tcnt = ARRAY_SIZE(defined_advise),
8882
};
89-
90-
#else
91-
TST_TEST_TCONF("This test can only run on kernels that implements "
92-
"fadvise64 which is used from posix_fadvise");
93-
#endif

testcases/kernel/syscalls/fadvise/posix_fadvise02.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@
2828
#include <string.h>
2929

3030
#include "tst_test.h"
31-
3231
#include "lapi/syscalls.h"
33-
#ifndef _FILE_OFFSET_BITS
34-
#define _FILE_OFFSET_BITS 32
35-
#endif
36-
37-
#if (_FILE_OFFSET_BITS == 64)
3832

3933
#define WRONG_FD 42 /* The number has no meaning.
4034
Just used as something wrong fd */
@@ -93,8 +87,3 @@ static struct tst_test test = {
9387
.test = verify_fadvise,
9488
.tcnt = ARRAY_SIZE(defined_advise),
9589
};
96-
97-
#else
98-
TST_TEST_TCONF("This test can only run on kernels that implements "
99-
"fadvise64 which is used from posix_fadvise");
100-
#endif

testcases/kernel/syscalls/fadvise/posix_fadvise03.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
#include <string.h>
3030

3131
#include "tst_test.h"
32-
3332
#include "lapi/syscalls.h"
34-
#ifndef _FILE_OFFSET_BITS
35-
#define _FILE_OFFSET_BITS 32
36-
#endif
37-
38-
#if (_FILE_OFFSET_BITS == 64)
3933

4034
char fname[] = "/bin/cat"; /* test executable to open */
4135
int fd = -1; /* initialized in open */
@@ -135,8 +129,3 @@ static struct tst_test test = {
135129
.test = verify_fadvise,
136130
.tcnt = ADVISE_LIMIT,
137131
};
138-
139-
#else
140-
TST_TEST_TCONF("This test can only run on kernels that implements "
141-
"fadvise64 which is used from posix_fadvise");
142-
#endif

testcases/kernel/syscalls/fadvise/posix_fadvise04.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
#include "tst_test.h"
3131

3232
#include "lapi/syscalls.h"
33-
#ifndef _FILE_OFFSET_BITS
34-
#define _FILE_OFFSET_BITS 32
35-
#endif
36-
37-
#if (_FILE_OFFSET_BITS == 64)
3833

3934
static int pipedes[2];
4035

@@ -91,8 +86,3 @@ static struct tst_test test = {
9186
.tcnt = ARRAY_SIZE(defined_advise),
9287
.min_kver = "2.6.16",
9388
};
94-
95-
#else
96-
TST_TEST_TCONF("This test can only run on kernels that implements "
97-
"fadvise64 which is used from posix_fadvise");
98-
#endif

0 commit comments

Comments
 (0)