-/* $OpenBSD: kern_exit.c,v 1.233 2024/09/06 08:21:21 mpi Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.234 2024/09/30 12:32:26 claudio Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
* If we got the child via a ptrace 'attach',
* we need to give it back to the old parent.
*/
- if (pr->ps_oppid != 0 && (pr->ps_oppid != pr->ps_pptr->ps_pid) &&
+ if (pr->ps_oppid != 0 && (pr->ps_oppid != pr->ps_ppid) &&
(tr = prfind(pr->ps_oppid))) {
pr->ps_oppid = 0;
atomic_clearbits_int(&pr->ps_flags, PS_TRACED);
KASSERT(pr->ps_flags & PS_TRACED);
if (pr->ps_oppid != 0 &&
- (pr->ps_oppid != pr->ps_pptr->ps_pid))
+ (pr->ps_oppid != pr->ps_ppid))
ppr = prfind(pr->ps_oppid);
/* not being traced any more */
return;
KASSERT(child->ps_oppid == 0 ||
- child->ps_oppid == child->ps_pptr->ps_pid);
+ child->ps_oppid == child->ps_ppid);
LIST_REMOVE(child, ps_sibling);
LIST_INSERT_HEAD(&parent->ps_children, child, ps_sibling);
-/* $OpenBSD: kern_sysctl.c,v 1.447 2024/09/24 12:37:11 bluhm Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.448 2024/09/30 12:32:26 claudio Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
show_pointers);
/* stuff that's too painful to generalize into the macros */
- if (pr->ps_pptr)
- ki->p_ppid = pr->ps_ppid;
if (s->s_leader)
ki->p_sid = s->s_leader->ps_pid;
-/* $OpenBSD: sys_process.c,v 1.98 2024/06/03 12:48:25 claudio Exp $ */
+/* $OpenBSD: sys_process.c,v 1.99 2024/09/30 12:32:26 claudio Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
if (ISSET(tr->ps_flags, PS_TRACED))
return EBUSY;
atomic_setbits_int(&tr->ps_flags, PS_TRACED);
- tr->ps_oppid = tr->ps_pptr->ps_pid;
+ tr->ps_oppid = tr->ps_ppid;
if (tr->ps_ptstat == NULL)
tr->ps_ptstat = malloc(sizeof(*tr->ps_ptstat),
M_SUBPROC, M_WAITOK);
* Stop the target.
*/
atomic_setbits_int(&tr->ps_flags, PS_TRACED);
- tr->ps_oppid = tr->ps_pptr->ps_pid;
+ tr->ps_oppid = tr->ps_ppid;
process_reparent(tr, p->p_p);
if (tr->ps_ptstat == NULL)
tr->ps_ptstat = malloc(sizeof(*tr->ps_ptstat),
-/* $OpenBSD: tty_tty.c,v 1.32 2022/08/14 01:58:28 jsg Exp $ */
+/* $OpenBSD: tty_tty.c,v 1.33 2024/09/30 12:32:26 claudio Exp $ */
/* $NetBSD: tty_tty.c,v 1.13 1996/03/30 22:24:46 christos Exp $ */
/*-
return EINVAL;
sess = p->p_p->ps_pgrp->pg_session;
sess->s_verauthuid = p->p_ucred->cr_ruid;
- sess->s_verauthppid = p->p_p->ps_pptr->ps_pid;
+ sess->s_verauthppid = p->p_p->ps_ppid;
timeout_add_sec(&sess->s_verauthto, secs);
return 0;
case TIOCCLRVERAUTH:
*/
sess = p->p_p->ps_pgrp->pg_session;
if (sess->s_verauthuid == p->p_ucred->cr_ruid &&
- sess->s_verauthppid == p->p_p->ps_pptr->ps_pid)
+ sess->s_verauthppid == p->p_p->ps_ppid)
return 0;
return EPERM;
}
-/* $OpenBSD: sysctl.h,v 1.237 2024/08/02 14:34:45 mvs Exp $ */
+/* $OpenBSD: sysctl.h,v 1.238 2024/09/30 12:32:26 claudio Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
* lim - source struct plimits
* sa - source struct sigacts
* There are some members that are not handled by these macros
- * because they're too painful to generalize: p_ppid, p_sid, p_tdev,
+ * because they're too painful to generalize: p_sid, p_tdev,
* p_tpgid, p_tsess, p_vm_rssize, p_u[us]time_{sec,usec}, p_cpuid
*/
(kp)->p_sigmask = (p)->p_sigmask; \
\
PR_LOCK(pr); \
+ (kp)->p_ppid = (pr)->ps_ppid; \
(kp)->p_sigignore = (sa) ? (sa)->ps_sigignore : 0; \
(kp)->p_sigcatch = (sa) ? (sa)->ps_sigcatch : 0; \
\