Beispiel #1
0
static int32_t MySyscallInvoke(struct NaClAppThread *natp) {
  NaClCopyDropLock(natp->nap);
  printf("Inside custom test 'invoke' syscall\n");
  fflush(stdout);
  /* Return a value that the test guest program checks for. */
  return 123;
}
Beispiel #2
0
static int32_t MySyscallExit(struct NaClAppThread *natp) {
  NaClCopyDropLock(natp->nap);
  printf("Inside custom test 'exit' syscall\n");
  fflush(stdout);
  printf("nexe call exit\n");
  _exit(0);
}
static int32_t TestSyscall(struct NaClAppThread *natp) {
  g_nacl_syscall_thread_capture_fault_addr =
      (uintptr_t) &NaClSyscallThreadCaptureFault;

  NaClCopyDropLock(natp->nap);

  natp->user.guard_token++;

  return 0;
}
Beispiel #4
0
static int32_t TestSyscall(struct NaClAppThread *natp) {
  NaClCopyDropLock(natp->nap);

  if (g_call_count == 0) {
    g_natp = natp;
    SetTrapFlag();
  }
  /* Check that the trap flag has not been unset by anything unexpected. */
  CHECK(GetTrapFlag());

  if (++g_call_count == kNumberOfCallsToTest) {
    UnsetTrapFlag();
    NaClReportExitStatus(natp->nap, 0);
    NaClAppThreadTeardown(natp);
  }
  return 0;
}
Beispiel #5
0
static int32_t NotImplementedDecoder(struct NaClAppThread *natp) {
  NaClCopyDropLock(natp->nap);
  printf("Error: entered an unexpected syscall! but I do not want to exit\n");
  fflush(stdout);
  //_exit(1);
}