From owner-cvs-src@FreeBSD.ORG Sat Oct 4 21:23:03 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED8D31065687; Sat, 4 Oct 2008 21:23:03 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1318FC08; Sat, 4 Oct 2008 21:23:03 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 24BA59CB439; Sat, 4 Oct 2008 23:22:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rqPvu8qhO+jf; Sat, 4 Oct 2008 23:22:37 +0200 (CEST) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 89F839CB546; Sat, 4 Oct 2008 23:22:37 +0200 (CEST) Received: (from rdivacky@localhost) by lev.vlakno.cz (8.14.2/8.14.2/Submit) id m94LMb4i059630; Sat, 4 Oct 2008 23:22:37 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 4 Oct 2008 23:22:37 +0200 From: Roman Divacky To: Konstantin Belousov Message-ID: <20081004212237.GA58802@freebsd.org> References: <200810041923.m94JNdfG004774@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <200810041923.m94JNdfG004774@repoman.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/compat/linux linux_misc.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2008 21:23:04 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 04, 2008 at 07:23:30PM +0000, Konstantin Belousov wrote: > kib 2008-10-04 19:23:30 UTC >=20 > FreeBSD src repository >=20 > Modified files: > sys/compat/linux linux_misc.c=20 > Log: > SVN rev 183612 on 2008-10-04 19:23:30Z by kib > =20 > Current linux_fooaffinity() emulation fails, as the FreeBSD affinity > syscalls expect the bitmap size in the range from 32 to 128. Old glibc > always assumed size 1024, while newer glibc searches for approriate > size, starting from 1024 and going up. > =20 > For now, use FreeBSD size of cpuset_t for bitmap size parameter and > return EINVAL if length of user space bitmap less than our size of > cpuset_t. > =20 > Submitted by: dchagin > MFC after: 1 week > [This requires MFC of the actual linux affinity syscalls] I think this patch (actually, the reverse of this) is what should be MFCed: --- /tmp/linux_misc.c 2008-10-01 14:43:31.000000000 +0200 +++ linux_misc.c 2008-10-01 14:41:57.000000000 +0200 @@ -1739,13 +1739,13 @@ int error; cpumask_t i =3D ~0; =20 - if (args->len < sizeof(cpuset_t)) + if (args->len < sizeof(cpumask_t)) return (EINVAL); =20 - error =3D copyout(&i, args->user_mask_ptr, sizeof(cpuset_t)); + error =3D copyout(&i, args->user_mask_ptr, sizeof(cpumask_t)); if (error) return (EFAULT); =20 - td->td_retval[0] =3D sizeof(cpuset_t); + td->td_retval[0] =3D sizeof(cpumask_t); return (0); } this is a minimal change I believe, Juergen Lock tested this. --9amGYk9869ThD9tj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjn3p0ACgkQLVEj6D3CBEwevwCeOpXIsDNCyPPF1A+gXV/j9E0A RCYAniPZYcxirHBC9N/W8nTWciTVnIzy =3DF7 -----END PGP SIGNATURE----- --9amGYk9869ThD9tj--