From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 12 11:12:03 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EB3D1065704 for ; Mon, 12 Jul 2010 11:12:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id CA3ED8FC14 for ; Mon, 12 Jul 2010 11:12:02 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 355D914DBFED; Mon, 12 Jul 2010 13:12:01 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SBSJOnGT8e+t; Mon, 12 Jul 2010 13:11:59 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 1640214DC076; Mon, 12 Jul 2010 13:11:59 +0200 (CEST) Message-ID: <4C3AF87B.3030707@FreeBSD.org> Date: Mon, 12 Jul 2010 13:11:55 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: pluknet References: <4C39D92F.4050605@FreeBSD.org> <4C39DB09.6010808@andric.com> <4C39DBFF.2000307@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Dimitry Andric , FreeBSD Hackers Subject: Re: strange problem with int64_t variables X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2010 11:12:03 -0000 Em 2010.07.12. 9:00, pluknet escreveu: > Looking at getjid() impl, I see you're trying to put jid_t into the > one register_t > which are 64-bit vs 32-bit capable respectively. > You need to cast so you put 64-bit into two 32-bit as done for e.g. lseek(). > Thanks for pointing this out, probably this was the problem, I'll try later because for now, I switched to 32-bit jid_t and that part works but there's other similar problem now: +int +setjlimit(struct thread *td, struct setjlimit_args *uap) +{ + struct jobentry *jp; + + /* sanity check */ + if (uap->resource>= JLIMIT_NLIMITS) { + td->td_retval[0] = -1; + return (EINVAL); + } ... The rest is just generated code with make sysent. I call this with resource parameter set to JLIMIT_NUMPROC (whose value is 3) and then inside the function it is seen as 869787392, so I always get EINVAL. In this case resource is just a normal int so I don't know what's going wrong. Gabor