From owner-freebsd-emulation@FreeBSD.ORG Thu Mar 6 04:32:35 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 467BD1065670; Thu, 6 Mar 2008 04:32:35 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 0B7338FC17; Thu, 6 Mar 2008 04:32:34 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.107] (cpe-24-94-75-93.hawaii.res.rr.com [24.94.75.93]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id m264WVBH041574; Wed, 5 Mar 2008 23:32:33 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Wed, 5 Mar 2008 18:35:02 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Roman Divacky In-Reply-To: <20080305193330.GA18756@freebsd.org> Message-ID: <20080305183333.K920@desktop> References: <20080302110130.GA30563@freebsd.org> <20080303022202.S920@desktop> <20080303144152.GA47887@freebsd.org> <20080303121025.K920@desktop> <20080304155205.X920@desktop> <20080305193330.GA18756@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: emulation@freebsd.org, jeff@freebsd.org Subject: Re: [PATCH] linux get affinity syscall X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2008 04:32:35 -0000 On Wed, 5 Mar 2008, Roman Divacky wrote: >>>>>> if (args->len < sizeof(cpumask_t)) >>>>>> return (EINVAL); >> >> This should not be necessary anymore. >> >>>>> >>>>> Len here is in number of bits I believe as it is for our cpusetsize. >>>> >>>> no.. its specified in bytes >>> >>> You are right. So it is with fdsets. Please hold on and I'll change >>> cpuset to be bytes as well. >>> >>>> >>>>>> >>>>>> cga.level = CPU_LEVEL_WHICH; >>>>>> cga.which = CPU_WHICH_PID; >>>>>> cga.id = args->pid; >>>>>> cga.cpusetsize = sizeof(cpumask_t) * NBBY; >>>>>> cga.mask = (long *) args->user_mask_ptr; >>>>> >> >> I checked in a change to make our cpusetsize compatible. You should only >> have to supply CPU_LEVEL_WHICH and CPU_WHICH_PID now. The rest of the >> arguments are compatible. > > is it possible to make cpuset_setproc non-static? > > if so could you please review the following patch: > > www.vlakno.cz/~rdivacky/linux_affinity.patch > > and tell me if its ok? (it lacks #include of something that should > contain the prototype for cpuset_setproc()) Why not call cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, id, cpusetlen, user_mask_ptr); as you do with getaffinity? Then we don't have to expose the internal interface. You also don't have to error check the length then. Thanks, Jeff > > thnx, roman >