Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2014 20:12:02 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r260406 - releng/10.0/sys/sys
Message-ID:  <201401072012.s07KC2g3075588@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Tue Jan  7 20:12:02 2014
New Revision: 260406
URL: http://svnweb.freebsd.org/changeset/base/260406

Log:
  MFstable/10 r260402:
  
  Bring back the old size of the kinfo_file structure to preserve ABI.
  Keep only one uint64_t spare for further cap_rights_t expension.
  
  Add a comment clarifying that if the size of this structure changes,
  a new sysctl MIB has to be allocate for it and the old structure has
  to be returned by the old sysctl MIB.
  
  Requested by:	re
  Approved by:	re (gjb)

Modified:
  releng/10.0/sys/sys/user.h
Directory Properties:
  releng/10.0/   (props changed)

Modified: releng/10.0/sys/sys/user.h
==============================================================================
--- releng/10.0/sys/sys/user.h	Tue Jan  7 20:06:20 2014	(r260405)
+++ releng/10.0/sys/sys/user.h	Tue Jan  7 20:12:02 2014	(r260406)
@@ -320,7 +320,13 @@ struct kinfo_ofile {
 };
 
 #if defined(__amd64__) || defined(__i386__)
-#define	KINFO_FILE_SIZE	1424
+/*
+ * This size should never be changed. If you really need to, you must provide
+ * backward ABI compatibility by allocating a new sysctl MIB that will return
+ * the new structure. The current structure has to be returned by the current
+ * sysctl MIB. See how it is done for the kinfo_ofile structure.
+ */
+#define	KINFO_FILE_SIZE	1392
 #endif
 
 struct kinfo_file {
@@ -391,8 +397,7 @@ struct kinfo_file {
 	uint16_t	kf_pad1;		/* Round to 32 bit alignment. */
 	int		_kf_ispare0;		/* Space for more stuff. */
 	cap_rights_t	kf_cap_rights;		/* Capability rights. */
-	uint64_t	_kf_cap_spare[3];	/* Space for future cap_rights_t. */
-	int		_kf_ispare[4];		/* Space for more stuff. */
+	uint64_t	_kf_cap_spare;		/* Space for future cap_rights_t. */
 	/* Truncated before copyout in sysctl */
 	char		kf_path[PATH_MAX];	/* Path to file, if any. */
 };



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