|
From: Nicholas N. <nj...@cs...> - 2005-08-11 20:18:48
|
On Thu, 11 Aug 2005, Maurice van der Pot wrote:
> It fills in 0 for the optional third parameter to open calls. Both man
> and info tell me the third parameter is only used when a file is being
> created. Of the 50 or so changes, only 2 of them use O_CREAT.
I haven't looked at the code, but Valgrind should be able to handle this.
Here's the relevant code in the wrapper for open():
PRE(sys_open)
{
*flags |= SfMayBlock;
if (ARG2 & VKI_O_CREAT) {
// 3-arg version
PRINT("sys_open ( %p(%s), %d, %d )",ARG1,ARG1,ARG2,ARG3);
PRE_REG_READ3(long, "open",
const char *, filename, int, flags, int, mode);
} else {
// 2-arg version
PRINT("sys_open ( %p(%s), %d )",ARG1,ARG1,ARG2);
PRE_REG_READ2(long, "open",
const char *, filename, int, flags);
}
PRE_MEM_RASCIIZ( "open(filename)", ARG1 );
}
N
|