Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 May 2017 18:39:23 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318360 - head/sys/sys
Message-ID:  <201705161839.v4GIdNr0067345@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue May 16 18:39:23 2017
New Revision: 318360
URL: https://svnweb.freebsd.org/changeset/base/318360

Log:
  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.
  
  Reviewed by:	kib
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D10677

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Tue May 16 18:05:34 2017	(r318359)
+++ head/sys/sys/proc.h	Tue May 16 18:39:23 2017	(r318360)
@@ -624,13 +624,13 @@ 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. */
 	uint16_t	p_elf_machine;	/* (x) ELF machine type */
 	uint64_t	p_elf_flags;	/* (x) ELF flags */
-
 /* End area that is copied on creation. */
-#define	p_endcopy	p_elf_flags
+#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?201705161839.v4GIdNr0067345>