|
From: Julian S. <js...@ac...> - 2005-09-13 18:01:44
|
Re the below, shouldn't the 3rd arg to VG_(readlink) be n_buf?
J
/* Given a file descriptor, attempt to deduce its filename. To do
this, we use /proc/self/fd/<FD>. If this doesn't point to a file,
or if it doesn't exist, we return False. */
Bool VG_(resolve_filename) ( Int fd, HChar* buf, Int n_buf )
{
HChar tmp[64];
VG_(sprintf)(tmp, "/proc/self/fd/%d", fd);
VG_(memset)(buf, 0, n_buf);
if (VG_(readlink)(tmp, buf, VKI_PATH_MAX) > 0 && buf[0] == '/')
return True;
else
return False;
}
|