serenity.cpp 641 B

123456789101112131415161718192021222324252627282930
  1. #include <Kernel/Syscall.h>
  2. #include <errno.h>
  3. #include <serenity.h>
  4. extern "C" {
  5. int module_load(const char* path, size_t path_length)
  6. {
  7. int rc = syscall(SC_module_load, path, path_length);
  8. __RETURN_WITH_ERRNO(rc, rc, -1);
  9. }
  10. int module_unload(const char* name, size_t name_length)
  11. {
  12. int rc = syscall(SC_module_unload, name, name_length);
  13. __RETURN_WITH_ERRNO(rc, rc, -1);
  14. }
  15. int profiling_enable(pid_t pid)
  16. {
  17. int rc = syscall(SC_profiling_enable, pid);
  18. __RETURN_WITH_ERRNO(rc, rc, -1);
  19. }
  20. int profiling_disable(pid_t pid)
  21. {
  22. int rc = syscall(SC_profiling_disable, pid);
  23. __RETURN_WITH_ERRNO(rc, rc, -1);
  24. }
  25. }