コード例 #1
0
ファイル: hurdsig.c プロジェクト: bminor/glibc
static mach_port_t *
interrupted_reply_port_location (thread_t thread,
				 struct machine_thread_all_state *thread_state,
				 int sigthread)
{
  mach_port_t *portloc = &THREAD_TCB(thread, thread_state)->reply_port;

  if (sigthread && _hurdsig_catch_memory_fault (portloc))
    /* Faulted trying to read the TCB.  */
    return NULL;

  DIAG_PUSH_NEEDS_COMMENT;
  /* GCC 6 and before seem to be confused by the setjmp call inside
     _hurdsig_catch_memory_fault and think that we may be returning a second
     time to here with portloc uninitialized (but we never do). */
  DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized");
  /* Fault now if this pointer is bogus.  */
  *(volatile mach_port_t *) portloc = *portloc;
  DIAG_POP_NEEDS_COMMENT;

  if (sigthread)
    _hurdsig_end_catch_fault ();

  return portloc;
}
コード例 #2
0
ファイル: hurdsig.c プロジェクト: VGEAREN/mygit
static mach_port_t *
interrupted_reply_port_location (thread_t thread,
				 struct machine_thread_all_state *thread_state,
				 int sigthread)
{
  mach_port_t *portloc = &THREAD_TCB(thread, thread_state)->reply_port;

  if (sigthread && _hurdsig_catch_memory_fault (portloc))
    /* Faulted trying to read the stack.  */
    return NULL;

  /* Fault now if this pointer is bogus.  */
  *(volatile mach_port_t *) portloc = *portloc;

  if (sigthread)
    _hurdsig_end_catch_fault ();

  return portloc;
}