]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD: fix build, FreeBSD has no dirent64 or getdent64
authorPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 2 Oct 2025 05:46:59 +0000 (07:46 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 2 Oct 2025 05:46:59 +0000 (07:46 +0200)
Need to check Darwin as well.

coregrind/m_syswrap/syswrap-generic.c

index 3786e9cd89bf12e4cc18f0cec9c2434783a1131a..296ebdd9101bbe983f7dd18f6164c10af56cf7e6 100644 (file)
@@ -3994,6 +3994,8 @@ PRE(sys_getdents)
    PRE_MEM_WRITE( "getdents(dirp)", ARG2, ARG3 );
 }
 
+#if !defined(VGO_freebsd) // Darwin as well?
+
 /* Check if the given file descriptor points to a /proc/PID/fd or /proc/PID/fdinfo directory.
    Returns True if it's a directory we should filter Valgrind FDs from. */
 static Bool is_proc_fd_directory(Int fd)
@@ -4096,6 +4098,8 @@ static SizeT filter_dirent64_entries(struct vki_dirent64 *dirp, SizeT orig_size)
    return new_size;
 }
 
+#endif
+
 /* Make sure we really need the proc filtering using (32bit) getdents,
    which not every linux arch implements.  */
 #if defined(VGO_linux) && defined(__NR_getdents)
@@ -4130,6 +4134,8 @@ static SizeT filter_valgrind_fds_from_getdents_with_refill(Int fd, struct vki_di
 }
 #endif /* defined(VGO_linux) && defined(__NR_getdents) */
 
+#if !defined(VGO_freebsd) // Darwin as well?
+
 /* Filter out Valgrind's internal file descriptors from getdents64 results with refill capability.
    Same logic as getdents version but for 64-bit dirent structures.
    Returns filtered size on success, or -1 if retry syscall failed. */
@@ -4159,6 +4165,8 @@ static SizeT filter_valgrind_fds_from_getdents64_with_refill(Int fd, struct vki_
    return new_size;
 }
 
+#endif
+
 POST(sys_getdents)
 {
    vg_assert(SUCCESS);
@@ -4186,6 +4194,8 @@ POST(sys_getdents)
    }
 }
 
+#if !defined(VGO_freebsd)
+
 PRE(sys_getdents64)
 {
    *flags |= SfMayBlock;
@@ -4219,6 +4229,8 @@ POST(sys_getdents64)
    }
 }
 
+#endif
+
 PRE(sys_getgroups)
 {
    PRINT("sys_getgroups ( %ld, %#" FMT_REGWORD "x )", SARG1, ARG2);