prctl.cpp 378 B

1234567891011121314151617181920
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <errno.h>
  7. #include <stdarg.h>
  8. #include <stdio.h>
  9. #include <sys/prctl.h>
  10. #include <syscall.h>
  11. extern "C" {
  12. int prctl(int option, uintptr_t arg1, uintptr_t arg2)
  13. {
  14. int rc = syscall(SC_prctl, option, arg1, arg2);
  15. __RETURN_WITH_ERRNO(rc, rc, -1);
  16. }
  17. }