]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD: changes for --modify-fds
authorPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 17 Apr 2025 11:00:04 +0000 (13:00 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 17 Apr 2025 11:00:04 +0000 (13:00 +0200)
Again this is just the minumum to get the track_new test to pass.
Other syscalls later.

coregrind/m_syswrap/syswrap-freebsd.c
none/tests/track_new.c
none/tests/track_new.stderr.exp

index 6fd4367a831ced0a35e608ab8c22186ee24728f9..12b18f4e6ee7c7aeb44a7c92657c3fa1bb53668f 100644 (file)
@@ -5317,6 +5317,7 @@ PRE(sys_openat)
 POST(sys_openat)
 {
    vg_assert(SUCCESS);
+   POST_newFd_RES;
    if (!ML_(fd_allowed)(RES, "openat", tid, True)) {
       VG_(close)(RES);
       SET_STATUS_Failure( VKI_EMFILE );
index e4bb546fb41c8c96bb75453de3a6e746d1f80698..718fa3a3740eeaed6a95da1b03ac4f6b3cdc75e2 100644 (file)
@@ -1,7 +1,4 @@
-#define _XOPEN_SOURCE 700
-
 #include <fcntl.h>
-#include <stdio.h>
 #include <unistd.h>
 #include <sys/stat.h>
 
@@ -15,7 +12,7 @@ main (void)
   /* Lets open another file... */
   int newfd = open ("foobad.txt", O_RDWR|O_CREAT, S_IRUSR | S_IWUSR);
   /* ... oops we are using the wrong fd (but same number...) */
-  dprintf (oldfd, "some new text\n");
+  write(oldfd, "some new text\n", 14);
 
   close (newfd);
   return 0;
index 23dec73bbcf0d2839254921207afc1d2695f21c6..cd443c51a9576a33908553abc69ee3158ad2f2d4 100644 (file)
@@ -1,6 +1,5 @@
 File descriptor was closed already
    at 0x........: write (in /...libc...)
-   by 0x........: dprintf (in /...libc...)
    by 0x........: main
  Previously closed
    at 0x........: close (in /...libc...)