clireq_nofill.stdout.exp clireq_nofill.vgtest \
clo_redzone_default.vgtest clo_redzone_128.vgtest \
clo_redzone_default.stderr.exp clo_redzone_128.stderr.exp \
+ close_range.vgtest close_range.stderr.exp \
+ close_range.stderr.exp.linux \
cond_ld.vgtest cond_ld.stdout.exp cond_ld.stderr.exp-arm \
cond_ld.stderr.exp-64bit-non-arm \
cond_ld.stderr.exp-32bit-non-arm \
sized_aligned_new_delete_misaligned3
endif
+if HAVE_CLOSE_RANGE
+check_PROGRAMS += close_range
+endif
+
+close_range_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNUSED_BUT_SET_VARIABLE@ \
+ @FLAG_W_NO_UNINITIALIZED@
+
if HAVE_PTHREAD_BARRIER
check_PROGRAMS += reach_thread_register
endif
+#define _GNU_SOURCE
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>
#include <assert.h>
+/* For the linux kernel the CLOSE_RANGE_* constants are in a separate header. */
+#if defined(__linux__)
+#include <linux/close_range.h>
+#endif
+
/* It looks like close_range was initially implemented for FreeBSD 13
* but without CLOSE_RANGE_CLOEXEC
* That implementation got back ported to FreeBSD 12.2
Syscall param close_range(lowfd) contains uninitialised byte(s)
at 0x........: close_range (in /...libc...)
- by 0x........: main (close_range.c:83)
+ by 0x........: main (close_range.c:89)
Syscall param close_range(highfd) contains uninitialised byte(s)
at 0x........: close_range (in /...libc...)
- by 0x........: main (close_range.c:83)
+ by 0x........: main (close_range.c:89)
Syscall param close_range(flags) contains uninitialised byte(s)
at 0x........: close_range (in /...libc...)
- by 0x........: main (close_range.c:83)
+ by 0x........: main (close_range.c:89)
--- /dev/null
+Syscall param close_range(first) contains uninitialised byte(s)
+ at 0x........: close_range (in /...libc...)
+ by 0x........: main (close_range.c:89)
+
+Syscall param close_range(last) contains uninitialised byte(s)
+ at 0x........: close_range (in /...libc...)
+ by 0x........: main (close_range.c:89)
+
+Syscall param close_range(flags) contains uninitialised byte(s)
+ at 0x........: close_range (in /...libc...)
+ by 0x........: main (close_range.c:89)
+
chflags.stderr.exp-x86 \
chmod_chown.vgtest \
chmod_chown.stderr.exp \
- close_range.vgtest close_range.stderr.exp \
delete_sized_mismatch.vgtest \
delete_sized_mismatch.stderr.exp \
delete_sized_mismatch_xml.vgtest \
timerfd_LDFLAGS = -lm
endif
-if HAVE_CLOSE_RANGE
-check_PROGRAMS += close_range
-endif
-
aligned_alloc_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT@
-close_range_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNUSED_BUT_SET_VARIABLE@
-
delete_sized_mismatch_CXXFLAGS = ${AM_CXXFLAGS} --std=c++14
delete_sized_mismatch_SOURCES = delete_sized_mismatch.cpp