task.lisp 734 B

123456789101112131415161718192021222324
  1. (defcfun ("mach_task_self" %mach-task-self) ipc-space)
  2. (defun task-self ()
  3. "Returns a send right associated with the task_self port"
  4. (%mach-task-self))
  5. (defcfun ("task_get_special_port" %task-get-special-port)
  6. err
  7. (task task)
  8. (what special-port-type)
  9. (port port-pointer))
  10. (defun task-get-special-port (what &optional (task (task-self)))
  11. "Return a send write to the indicated special port."
  12. (with-foreign-object (port 'port)
  13. (let ((return-code (%task-get-special-port task what port)))
  14. (select-error return-code (mem-ref port 'port)))))
  15. (defun task-get-bootstrap-port (&optional (task (task-self)))
  16. "Return a send write to the bootstrap port."
  17. (task-get-special-port :task-bootstrap-port task))