From owner-svn-src-all@freebsd.org Fri Jul 19 15:07:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3B33A4DCF; Fri, 19 Jul 2019 15:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A475F715A0; Fri, 19 Jul 2019 15:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7417322B48; Fri, 19 Jul 2019 15:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6JF7VO8051441; Fri, 19 Jul 2019 15:07:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6JF7VfT051440; Fri, 19 Jul 2019 15:07:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907191507.x6JF7VfT051440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Jul 2019 15:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350130 - stable/12/lib/libnv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libnv X-SVN-Commit-Revision: 350130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A475F715A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 15:07:31 -0000 Author: markj Date: Fri Jul 19 15:07:31 2019 New Revision: 350130 URL: https://svnweb.freebsd.org/changeset/base/350130 Log: MFC r350054: Use a platform-independent constant for PKG_MAX_SIZE. PR: 238511 Modified: stable/12/lib/libnv/msgio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libnv/msgio.c ============================================================================== --- stable/12/lib/libnv/msgio.c Fri Jul 19 15:07:30 2019 (r350129) +++ stable/12/lib/libnv/msgio.c Fri Jul 19 15:07:31 2019 (r350130) @@ -58,7 +58,13 @@ __FBSDID("$FreeBSD$"); #define PJDLOG_ABORT(...) abort() #endif -#define PKG_MAX_SIZE (MCLBYTES / CMSG_SPACE(sizeof(int)) - 1) +/* + * To work around limitations in 32-bit emulation on 64-bit kernels, use a + * machine-independent limit on the number of FDs per message. Each control + * message contains 1 FD and requires 12 bytes for the header, 4 pad bytes, + * 4 bytes for the descriptor, and another 4 pad bytes. + */ +#define PKG_MAX_SIZE (MCLBYTES / 24) static int msghdr_add_fd(struct cmsghdr *cmsg, int fd)