From: Alexandra Hájková Date: Fri, 4 Jul 2025 11:35:13 +0000 (-0400) Subject: Implement fcntl F_CREATED_QUERY X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7615845dcd2166d98cb246e1ca7d4496cfcdfc4f;p=thirdparty%2Fvalgrind.git Implement fcntl F_CREATED_QUERY Define VKI_F_CREATED_QUERY in vki-linux.h. Recognize it in PRE(sys_fcntl). This fixes ltp tests failures. When running: make ltpchecks TESTS="fcntl40 fcntl40_64 the tests would fail with: fcntl40: unempty log2.filtered: ==1809471== Warning: unimplemented fcntl command: 1028 https://bugs.kde.org/show_bug.cgi?id=506076 --- diff --git a/NEWS b/NEWS index c1940b56c..40fec35cd 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +506076 unimplemented fcntl command: 1028 (F_CREATED_QUERY) 338803 Handling of dwz debug alt files or cross-CU is broken 493434 Add --track-fds=bad mode (no "leak" tracking) 503098 Incorrect NAN-boxing for float registers in RISC-V diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 97d386290..d2d0c7058 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -7100,6 +7100,7 @@ PRE(sys_fcntl) case VKI_F_GETSIG: case VKI_F_GETLEASE: case VKI_F_GETPIPE_SZ: + case VKI_F_CREATED_QUERY: case VKI_F_GET_SEALS: PRINT("sys_fcntl ( %" FMT_REGWORD "u, %" FMT_REGWORD "u )", ARG1, ARG2); PRE_REG_READ2(long, "fcntl", unsigned int, fd, unsigned int, cmd); diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 65406fffe..8c919845b 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -1514,6 +1514,7 @@ struct vki_dirent64 { #define VKI_F_SETLEASE (VKI_F_LINUX_SPECIFIC_BASE + 0) #define VKI_F_GETLEASE (VKI_F_LINUX_SPECIFIC_BASE + 1) +#define VKI_F_CREATED_QUERY (VKI_F_LINUX_SPECIFIC_BASE + 4) #define VKI_F_CANCELLK (VKI_F_LINUX_SPECIFIC_BASE + 5) #define VKI_F_DUPFD_CLOEXEC (VKI_F_LINUX_SPECIFIC_BASE + 6)