Skip to content

Commit e2c58cf

Browse files
committed
m4: fcntl31: Remove check for struct f_owner_ex
struct f_owner_ex support was added to glibc 2.11 released in 2009. Other libc of course contain it as well (musl, uclibc-ng, bionic) and we can safely assume it's widely supported. The check m4/ltp-fcntl.m4 was unnecessarily complicated. Adding struct into AC_CHECK_TYPES in configure.ac would be much faster than compile with AC_COMPILE_IFELSE. Link: https://lore.kernel.org/ltp/20250808110102.454689-4-pvorel@suse.cz/ Reviewed-by: Avinesh Kumar <akumar@suse.de> Reviewed-by: Li Wang <liwang@redhat.com> Signed-off-by: Petr Vorel <pvorel@suse.cz>
1 parent 632b2a0 commit e2c58cf

File tree

3 files changed

+0
-30
lines changed

3 files changed

+0
-30
lines changed

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ LTP_CHECK_LIBMNL
397397
LTP_CHECK_SELINUX
398398
LTP_CHECK_SYNC_ADD_AND_FETCH
399399
LTP_CHECK_SYSCALL_EVENTFD
400-
LTP_CHECK_SYSCALL_FCNTL
401400
LTP_CHECK_FSVERITY
402401

403402
AX_CHECK_COMPILE_FLAG([-no-pie], [LTP_CFLAGS_NOPIE=1])

m4/ltp-fcntl.m4

Lines changed: 0 additions & 21 deletions
This file was deleted.

testcases/kernel/syscalls/fcntl/fcntl31.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ static void cleanup(void);
4444
static void setown_pid_test(void);
4545
static void setown_pgrp_test(void);
4646

47-
#if defined(HAVE_STRUCT_F_OWNER_EX)
4847
static void setownex_tid_test(void);
4948
static void setownex_pid_test(void);
5049
static void setownex_pgrp_test(void);
5150

5251
static struct f_owner_ex orig_own_ex;
53-
#endif
5452

5553
static void signal_parent(void);
5654
static void check_io_signal(char *des);
@@ -68,9 +66,7 @@ static int pipe_fds[2];
6866

6967
static void (*testfunc[])(void) = {
7068
setown_pid_test, setown_pgrp_test,
71-
#if defined(HAVE_STRUCT_F_OWNER_EX)
7269
setownex_tid_test, setownex_pid_test, setownex_pgrp_test
73-
#endif
7470
};
7571

7672
char *TCID = "fcntl31";
@@ -122,14 +118,12 @@ static void setup(void)
122118
if (pgrp_pid < 0)
123119
tst_brkm(TBROK | TERRNO, cleanup, "getpgid() failed");
124120

125-
#if defined(HAVE_STRUCT_F_OWNER_EX)
126121
/* get original f_owner_ex info */
127122
TEST(fcntl(test_fd, F_GETOWN_EX, &orig_own_ex));
128123
if (TEST_RETURN < 0) {
129124
tst_brkm(TFAIL | TTERRNO, cleanup,
130125
"fcntl get original f_owner_ex info failed");
131126
}
132-
#endif
133127

134128
/* get original pid info */
135129
TEST(fcntl(test_fd, F_GETOWN));
@@ -183,7 +177,6 @@ static void setown_pgrp_test(void)
183177
}
184178
}
185179

186-
#if defined(HAVE_STRUCT_F_OWNER_EX)
187180
static void setownex_cleanup(void)
188181
{
189182
TEST(fcntl(test_fd, F_SETOWN_EX, &orig_own_ex));
@@ -245,7 +238,6 @@ static void setownex_pgrp_test(void)
245238

246239
setownex_cleanup();
247240
}
248-
#endif
249241

250242
static void test_set_and_get_sig(int sig, char *des)
251243
{

0 commit comments

Comments
 (0)