diff options
Diffstat (limited to 'proc/mig-decls.h')
-rw-r--r-- | proc/mig-decls.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/proc/mig-decls.h b/proc/mig-decls.h index 0d5bd4df..7d36a870 100644 --- a/proc/mig-decls.h +++ b/proc/mig-decls.h @@ -24,6 +24,24 @@ #include "proc.h" +/* Find the process corresponding to a given request port. */ +static inline struct proc * __attribute__ ((unused)) +begin_using_proc_port (mach_port_t port) +{ + struct proc *p; + p = ports_lookup_port (proc_bucket, port, proc_class); + if (p && p->p_dead) + ports_port_deref (p); + return (!p || p->p_dead) ? NULL : p; +} + +static inline void __attribute__ ((unused)) +end_using_proc (struct proc *p) +{ + if (p) + ports_port_deref (p); +} + typedef struct exc* exc_t; static inline exc_t __attribute__ ((unused)) |