|
From: Nicholas N. <nj...@cs...> - 2005-10-03 03:01:22
|
On Fri, 30 Sep 2005, Julian Seward wrote:
> I've been looking a little at ML_(fd_allowed), in syswrap-generic.c.
> This function decides which fds syscalls are allowed to create/use,
> so that V's own fds don't get trashed.
>
> This is a good thing; however I'm not sure I understand the logic.
>
> - the first conditional reads
>
> if ( (fd < 0 || fd >= VG_(fd_hard_limit) || fd == VG_(clo_log_fd))
> && VG_(showing_core_errors)() ) {
> ... stuff ...
> return False;
> }
>
> which seems to imply that some part of the decision rests on
> what VG_(showing_core_errors)() produces, iow on what sounds
> like a setting in the error-displaying options. That seems a
> little odd.
It does look odd. Some of the subsequent "else if" cases cover some of
these cases, but not all. I think it should really be something like
this:
if (some conditions) {
if (showing_core_erros && more specific conditions) {
print error msg
}
return False;
} else {
return True;
}
> - what does the "Bool soft" parameter mean?
There are two fd limits, the soft and hard limits. I think the client can
only access those below the soft limit, and Valgrind can access those
below the hard limit? Something like that.
Nick
|