Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 May 2017 23:01:56 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318563 - stable/11/sys/sys
Message-ID:  <201705192301.v4JN1udK073667@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri May 19 23:01:55 2017
New Revision: 318563
URL: https://svnweb.freebsd.org/changeset/base/318563

Log:
  MFC 318360: Fix p_endcopy.
  
  For p_endcopy to work correctly, it must be the name of the next element
  in struct proc after the end of the copy region, not the name of the
  last element in the copy region.  Currently, the last element
  (p_elf_flags) is not being copied.  In addition, the p_xexit and
  p_xsig fields should not be copied on fork, so move them out of the
  copy region.
  
  Note that for stable/11 the fix is a bit simpler than in HEAD as it
  merely consists of formally moving p_xexit and p_xsig out of the
  copy region by shrinking the end of the copy region.

Modified:
  stable/11/sys/sys/proc.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sys/proc.h
==============================================================================
--- stable/11/sys/sys/proc.h	Fri May 19 22:54:45 2017	(r318562)
+++ stable/11/sys/sys/proc.h	Fri May 19 23:01:55 2017	(r318563)
@@ -624,12 +624,11 @@ struct proc {
 	pid_t		p_reapsubtree;	/* (e) Pid of the direct child of the
 					       reaper which spawned
 					       our subtree. */
-	u_int		p_xexit;	/* (c) Exit code. */
-	u_int		p_xsig;		/* (c) Stop/kill sig. */
-
 /* End area that is copied on creation. */
-#define	p_endcopy	p_pgrp
+#define	p_endcopy	p_xexit
 
+	u_int		p_xexit;	/* (c) Exit code. */
+	u_int		p_xsig;		/* (c) Stop/kill sig. */
 	struct pgrp	*p_pgrp;	/* (c + e) Pointer to process group. */
 	struct knlist	*p_klist;	/* (c) Knotes attached to this proc. */
 	int		p_numthreads;	/* (c) Number of threads. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705192301.v4JN1udK073667>