Again this is just the minumum to get the track_new test to pass.
Other syscalls later.
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 );
-#define _XOPEN_SOURCE 700
-
#include <fcntl.h>
-#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
/* 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;
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...)