From owner-freebsd-emulation@FreeBSD.ORG Mon Mar 3 14:42:11 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 20CBF1065670; Mon, 3 Mar 2008 14:42:11 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id D8A2A8FC12; Mon, 3 Mar 2008 14:42:10 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 62AA4675E6B; Mon, 3 Mar 2008 15:42:08 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JG0M6EtvTp-U; Mon, 3 Mar 2008 15:41:54 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E4319675E76; Mon, 3 Mar 2008 15:41:53 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id m23Efrvv048748; Mon, 3 Mar 2008 15:41:53 +0100 (CET) (envelope-from rdivacky) Date: Mon, 3 Mar 2008 15:41:53 +0100 From: Roman Divacky To: Jeff Roberson Message-ID: <20080303144152.GA47887@freebsd.org> References: <20080302110130.GA30563@freebsd.org> <20080303022202.S920@desktop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080303022202.S920@desktop> User-Agent: Mutt/1.4.2.3i 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 14:42:11 -0000 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 > > > > 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