#if (FREEBSD_VERS >= FREEBSD_12_2)
// SYS_sys_close_range 575
-// int close_range(close_range(u_int lowfd, u_int highfd, int flags);
+// int close_range(u_int lowfd, u_int highfd, int flags);
PRE(sys_close_range)
{
SysRes res = VG_(mk_SysRes_Success)(0);
if (last >= VG_(fd_hard_limit))
last = VG_(fd_hard_limit) - 1;
- for (fd = ARG1; fd <= last; fd++)
- if ((fd != 2/*stderr*/ || VG_(debugLog_getLevel)() == 0)
- && fd != VG_(log_output_sink).fd
- && fd != VG_(xml_output_sink).fd)
- ML_(record_fd_close)(tid, fd);
+ /* If the close_range range is too wide, we don't want to loop
+ through the whole range. */
+ if (ARG2 == ~0U)
+ ML_(record_fd_close_range)(tid, ARG1);
+ else {
+ for (fd = ARG1; fd <= last; fd++)
+ if ((fd != 2/*stderr*/ || VG_(debugLog_getLevel)() == 0)
+ && fd != VG_(log_output_sink).fd
+ && fd != VG_(xml_output_sink).fd)
+ ML_(record_fd_close)(tid, fd);
+ }
}
#endif
dir=`dirname $0`
+# FreeBSD adds this one extra line
+# but after filter_xml_frames it will just be <path>...<\/path>
+# which matches other lines, so get rid of it while we can
+# uniquely match it
+sed "/<path>internet<\/path>/d" |
+
$dir/../../tests/filter_xml_frames |
perl -p -e "s/<time>.*<\/time>/<time>...<\/time>/s" |
perl -p -e "s/<what>.*<\/what>/<what>...<\/what>/s" |