cvs commit: src/sys/compat/linux linux_misc.c

Kostik Belousov kostikbel at gmail.com
Sun Oct 5 08:54:57 UTC 2008


On Sat, Oct 04, 2008 at 11:22:37PM +0200, Roman Divacky wrote:
> On Sat, Oct 04, 2008 at 07:23:30PM +0000, Konstantin Belousov wrote:
> > kib         2008-10-04 19:23:30 UTC
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     sys/compat/linux     linux_misc.c 
> >   Log:
> >   SVN rev 183612 on 2008-10-04 19:23:30Z by kib
> >   
> >   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.
> >   
> >   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.
> >   
> >   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 = ~0;
>  
> -	if (args->len < sizeof(cpuset_t))
> +	if (args->len < sizeof(cpumask_t))
>  		return (EINVAL);
>  
> -	error = copyout(&i, args->user_mask_ptr, sizeof(cpuset_t));
> +	error = copyout(&i, args->user_mask_ptr, sizeof(cpumask_t));
>  	if (error)
>  		return (EFAULT);
>  
> -	td->td_retval[0] = sizeof(cpuset_t);
> +	td->td_retval[0] = sizeof(cpumask_t);
>  	return (0);
>  }
> 
> this is a minimal change I believe, Juergen Lock tested this.

I see no reason to not MFC r177257 together with this change.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20081005/79711750/attachment.pgp


More information about the cvs-all mailing list