+int
+proc_isinferior(int pid1, int pid2)
+{
+ proc_t p;
+ proc_t t;
+
+ if (((p = pfind(pid1)) != (struct proc *)0 ) && ((t = pfind(pid2)) != (struct proc *)0))
+ return (isinferior(p, t));
+ return(0);
+}
+
+proc_t
+proc_find(int pid)
+{
+ return(pfind(pid));
+}
+
+int
+proc_rele(__unused proc_t p)
+{
+ return(0);
+}
+
+proc_t
+proc_self()
+{
+ return(current_proc());
+}
+
+
+int
+proc_pid(proc_t p)
+{
+ return(p->p_pid);
+}
+
+int
+proc_ppid(proc_t p)
+{
+ if (p->p_pptr != (struct proc *)0)
+ return(p->p_pptr->p_pid);
+ return(0);
+}
+
+int
+proc_selfpid(void)
+{
+ struct proc *p = current_proc();
+ return(p->p_pid);
+}
+
+
+int
+proc_selfppid(void)
+{
+ struct proc *p = current_proc();
+ if (p->p_pptr)
+ return(p->p_pptr->p_pid);
+ else
+ return(0);
+}
+
+void
+proc_name(int pid, char * buf, int size)
+{
+ struct proc *p;
+
+ if ((p = pfind(pid))!= (struct proc *)0) {
+ strncpy(buf, &p->p_comm[0], size);
+ buf[size-1] = 0;
+ }
+}
+
+void
+proc_selfname(char * buf, int size)
+{
+ struct proc *p;
+
+ if ((p = current_proc())!= (struct proc *)0) {
+ strncpy(buf, &p->p_comm[0], size);
+ buf[size-1] = 0;
+ }
+}
+
+void
+proc_signal(int pid, int signum)
+{
+ proc_t p;
+
+ if ((p = pfind(pid))!= (struct proc *)0) {
+ psignal(p, signum);
+ }
+}
+
+int
+proc_issignal(int pid, sigset_t mask)
+{
+ proc_t p;
+
+ if ((p = pfind(pid))!= (struct proc *)0) {
+ return(proc_pendingsignals(p, mask));
+ }
+ return(0);
+}
+
+int
+proc_noremotehang(proc_t p)
+{
+ int retval = 0;
+
+ if (p)
+ retval = p->p_flag & P_NOREMOTEHANG;
+ return(retval? 1: 0);
+
+}
+
+int
+proc_exiting(proc_t p)
+{
+ int retval = 0;
+
+ if (p)
+ retval = p->p_flag & P_WEXIT;
+ return(retval? 1: 0);
+}
+
+
+int
+proc_forcequota(proc_t p)
+{
+ int retval = 0;
+
+ if (p)
+ retval = p->p_flag & P_FORCEQUOTA;
+ return(retval? 1: 0);
+
+}
+
+int
+proc_tbe(proc_t p)
+{
+ int retval = 0;
+
+ if (p)
+ retval = p->p_flag & P_TBE;
+ return(retval? 1: 0);
+
+}
+
+int
+proc_suser(proc_t p)
+{
+ return(suser(p->p_ucred, NULL));
+
+}
+
+kauth_cred_t
+proc_ucred(proc_t p)
+{
+ return(p->p_ucred);
+}
+
+
+int
+proc_is64bit(proc_t p)
+{
+ return(IS_64BIT_PROCESS(p));
+}
+
+/* LP64todo - figure out how to identify 64-bit processes if NULL procp */
+int
+IS_64BIT_PROCESS(proc_t p)
+{
+ if (p && (p->p_flag & P_LP64))
+ return(1);
+ else
+ return(0);
+}
+
+