svn commit: r348419 - in head: crypto/heimdal/lib/ipc share/man/man4 sys/compat/linux sys/kern sys/sys usr.sbin/mountd

Gleb Smirnoff glebius at freebsd.org
Tue Jun 4 22:51:38 UTC 2019


  Dmitry,

On Thu, May 30, 2019 at 02:24:27PM +0000, Dmitry Chagin wrote:
D> Author: dchagin
D> Date: Thu May 30 14:24:26 2019
D> New Revision: 348419
D> URL: https://svnweb.freebsd.org/changeset/base/348419
D> 
D> Log:
D>   Complete LOCAL_PEERCRED support. Cache pid of the remote process in the
D>   struct xucred. Do not bump XUCRED_VERSION as struct layout is not changed.
D>   
D>   PR:		215202
D>   Reviewed by:	tijl
D>   MFC after:	1 week
D>   Differential Revision:	https://reviews.freebsd.org/D20415
...
D> Modified: head/sys/sys/ucred.h
D> ==============================================================================
D> --- head/sys/sys/ucred.h	Thu May 30 14:21:51 2019	(r348418)
D> +++ head/sys/sys/ucred.h	Thu May 30 14:24:26 2019	(r348419)
D> @@ -87,10 +87,14 @@ struct xucred {
D>  	uid_t	cr_uid;			/* effective user id */
D>  	short	cr_ngroups;		/* number of groups */
D>  	gid_t	cr_groups[XU_NGROUPS];	/* groups */
D> -	void	*_cr_unused1;		/* compatibility with old ucred */
D> +	union {
D> +		void	*_cr_unused1;	/* compatibility with old ucred */
D> +		pid_t	_pid;
D> +	} _cr;
D>  };
D>  #define	XUCRED_VERSION	0
D>  
D> +#define	cr_pid _cr._pid

Why don't use C99 in 2019 instead of preprocessor define? Should be

	union {
		void    *_cr_unused1;	/* compatibility with old ucred */
		pid_t	cr_pid;
	};

-- 
Gleb Smirnoff


More information about the svn-src-head mailing list