From owner-freebsd-emulation@FreeBSD.ORG Mon Mar 3 22:08:53 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 2DB8D1065672; Mon, 3 Mar 2008 22:08:53 +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 F39788FC29; Mon, 3 Mar 2008 22:08:52 +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 m23M8oJ4083530; Mon, 3 Mar 2008 17:08:51 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Mon, 3 Mar 2008 12:11:08 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Roman Divacky In-Reply-To: <20080303144152.GA47887@freebsd.org> Message-ID: <20080303121025.K920@desktop> References: <20080302110130.GA30563@freebsd.org> <20080303022202.S920@desktop> <20080303144152.GA47887@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: Mon, 03 Mar 2008 22:08:53 -0000 On Mon, 3 Mar 2008, Roman Divacky wrote: > On Mon, Mar 03, 2008 at 02:23:49AM -1000, Jeff Roberson wrote: >> >> On Sun, 2 Mar 2008, Roman Divacky wrote: >> >>> hi.. >>> >>> jeff commited his cpu set and I tried to map that to linuxulator >>> version of linux_sched_getaffinity(), the current (untested) code >>> looks like this: >>> >>> /* >>> * Get affinity of a process >>> */ >>> int >>> linux_sched_getaffinity(struct thread *td, >>> struct linux_sched_getaffinity_args *args) >>> { >>> int error; >>> struct cpuset_getaffinity_args cga; >>> >>> if (args->len < sizeof(cpumask_t)) >>> return (EINVAL); >> >> 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; >> >> Our call will accept larger values and zero fill any bits we don't use. >> It should be safe to pass the original len. > > ok.. will do it like that > > thnx for the comments, can anyone test the stuff? (I have access > to UP only ATM) > > roman >