This is the minumum just to get the new testcase to build and pass.
Need to go through the other fd related syscalls later.
/none/tests/timestamp
/none/tests/tls
/none/tests/track-fds-exec-children
+/none/tests/track_new
/none/tests/unit_debuglog
/none/tests/use_after_close
/none/tests/valgrind_cpp_test
POST(sys_open)
{
+ POST_newFd_RES;
+
if (!ML_(fd_allowed)(RES, "open", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure(VKI_EMFILE);
fdbaduse.stderr.exp fdbaduse.vgtest \
use_after_close.stderr.exp use_after_close.vgtest \
track_new.stderr.exp track_new.stdout.exp \
- track_new.stderr.exp.debian32 track_new.vgtest
+ track_new.stderr.exp.debian32 track_new.vgtest track_new.stderr.exp-illumos
check_PROGRAMS = \
startup exit abexit valgrindabexit all none
--track-fds=no|yes|all track open file descriptors? [no]
all includes reporting inherited file descriptors
+ --modify-fds=no|high modify newly open file descriptors? [no]
--time-stamp=no|yes add timestamps to log messages? [no]
--log-fd=<number> log messages to file descriptor [2=stderr]
--log-file=<file> log messages to <file>
startup exit abexit valgrindabexit all none
--track-fds=no|yes|all track open file descriptors? [no]
all includes reporting inherited file descriptors
+ --modify-fds=no|high modify newly open file descriptors? [no]
--time-stamp=no|yes add timestamps to log messages? [no]
--log-fd=<number> log messages to file descriptor [2=stderr]
--log-file=<file> log messages to <file>
+#define _XOPEN_SOURCE 700
+
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
+#include <sys/stat.h>
int
-main ()
+main (void)
{
int oldfd = open ("foobar.txt", O_RDWR|O_CREAT, S_IRUSR | S_IWUSR);
/*... do something with oldfd ...*/
--- /dev/null
+File descriptor was closed already
+ at 0x........: fdopen (in /...libc...)
+ by 0x........: vdprintf (in /...libc...)
+ by 0x........: dprintf (in /...libc...)
+ by 0x........: main
+ Previously closed
+ at 0x........: close (in /...libc...)
+ by 0x........: main
+ Originally opened
+ at 0x........: main (track_new.c:11)
prereq: test -x track_new
vgopts: -q --track-fds=yes --modify-fds=high
stderr_filter: filter_fdleak
+cleanup: rm -f foobad.txt foobar.txt
+