sgx_signal.c 516 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #include "platform_api_vmcore.h"
  6. #ifndef SGX_DISABLE_WASI
  7. #define TRACE_OCALL_FAIL() os_printf("ocall %s failed!\n", __FUNCTION__)
  8. int
  9. ocall_raise(int *p_ret, int sig);
  10. int
  11. raise(int sig)
  12. {
  13. int ret;
  14. if (ocall_raise(&ret, sig) != SGX_SUCCESS) {
  15. TRACE_OCALL_FAIL();
  16. return -1;
  17. }
  18. if (ret == -1)
  19. errno = get_errno();
  20. return ret;
  21. }
  22. #endif