Slight reduce m_syswrap's dependence on m_signals by moving

VG_(client_signal_OK)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3982
This commit is contained in:
Nicholas Nethercote 2005-06-21 03:52:49 +00:00
parent 0097c7053a
commit ba17e79287
5 changed files with 15 additions and 16 deletions

View File

@ -770,16 +770,6 @@ void VG_(clear_out_queued_signals)( ThreadId tid, vki_sigset_t* saved_mask )
restore_all_host_signals(saved_mask);
}
Bool VG_(client_signal_OK)(Int sigNo)
{
/* signal 0 is OK for kill */
Bool ret = sigNo >= 0 && sigNo <= VKI_SIGVGRTUSERMAX;
//VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret);
return ret;
}
/* ---------------------------------------------------------------------
The signal simulation proper. A simplified version of what the
Linux kernel does.

View File

@ -40,6 +40,9 @@ extern
Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid,
const Char *syscallname);
// Returns True if the signal is OK for the client to use.
extern Bool VG_(client_signal_OK)(Int sigNo);
// Return true if we're allowed to use or create this fd.
extern
Bool VG_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool soft);

View File

@ -42,13 +42,13 @@
#include "pub_core_libcsignal.h"
#include "pub_core_main.h"
#include "pub_core_mallocfree.h"
#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)()
#include "pub_core_tooliface.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
#include "pub_core_signals.h"
#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)()
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h"
@ -93,6 +93,16 @@ Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid,
return ret;
}
Bool VG_(client_signal_OK)(Int sigNo)
{
/* signal 0 is OK for kill */
Bool ret = sigNo >= 0 && sigNo <= VKI_SIGVGRTUSERMAX;
//VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret);
return ret;
}
/* ---------------------------------------------------------------------
Doing mmap, mremap
------------------------------------------------------------------ */

View File

@ -42,7 +42,6 @@
#include "pub_core_tooliface.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
#include "pub_core_signals.h" // For VG_(client_signal_OK)()
#include "pub_core_syscall.h"
#include "priv_types_n_macros.h"

View File

@ -72,9 +72,6 @@ extern void VG_(synth_sigill) (ThreadId tid, Addr addr);
/* Extend the stack to cover addr, if possible */
extern Bool VG_(extend_stack)(Addr addr, UInt maxsize);
/* Returns True if the signal is OK for the client to use */
extern Bool VG_(client_signal_OK)(Int sigNo);
/* Forces the client's signal handler to SIG_DFL - generally just
before using that signal to kill the process. */
extern void VG_(set_default_handler)(Int sig);