From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 16 10:17:39 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 9EA1A1065674; Fri, 16 Jul 2010 10:17:39 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 089108FC15; Fri, 16 Jul 2010 10:17:38 +0000 (UTC) Received: by wyf22 with SMTP id 22so1903666wyf.13 for ; Fri, 16 Jul 2010 03:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=IdcPZtrWqv6YboyKc+aNQv3ep8RHUQx9mrVoddfghQU=; b=MpU9nSPXSXwB9F2AQThQ3PcHqFTWg2J/H3VUPm/YePQ09srMnpznKnID+zVTvFP2pn GY4KBzpTZYxIV0ZqaQDW02IJZBxGHhhe2CdPVUH4P5bnt6kyvKO4cZM1r0xywu4l+mbp c8P0zNHi5Cfl2OS5vSrI8h1zFutV9UwK3wyJE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=FE+LR4GzTD7eYT+nOW2uxLimq80l4gUKpp5Xzi2RlkRc9XVZlVRYbGodXzlmrSel20 ++zHeKMEk7yEokmmpiRHurOWMATZhjfxmR8ssEuQ9TJse7+Yk5F1RH5/ypbBp3oiVz+2 hY7p6gl71/qOCoutEMAVgxh1VsVuXbpjyI1qI= MIME-Version: 1.0 Received: by 10.227.147.211 with SMTP id m19mr748689wbv.63.1279275457650; Fri, 16 Jul 2010 03:17:37 -0700 (PDT) Received: by 10.216.137.23 with HTTP; Fri, 16 Jul 2010 03:17:37 -0700 (PDT) In-Reply-To: <4C3F80D3.8080809@FreeBSD.org> References: <4C39D92F.4050605@FreeBSD.org> <4C39DB09.6010808@andric.com> <4C39DBFF.2000307@FreeBSD.org> <4C3AF87B.3030707@FreeBSD.org> <4C3F80D3.8080809@FreeBSD.org> Date: Fri, 16 Jul 2010 14:17:37 +0400 Message-ID: From: pluknet To: Gabor Kovesdan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Fri, 16 Jul 2010 10:17:39 -0000 On 16 July 2010 01:42, Gabor Kovesdan wrote: > Em 2010.07.13. 16:05, pluknet escreveu: >> >> #ifndef _SYS_SYSPROTO_H_ >> struct setjlimit_args { >> =A0 =A0 =A0 =A0 jid_t =A0 jid; >> =A0 =A0 =A0 =A0 int =A0 =A0 resource; >> =A0 =A0 =A0 =A0 struct rlimit *rlp; >> }; >> #endif >> int >> setjlimit(td, uap) >> =A0 =A0 =A0 =A0 struct thread *td; >> =A0 =A0 =A0 =A0 struct setjlimit_args /* { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 jid_t =A0 jid; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int =A0 =A0 resource; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct rlimit *rlp; >> =A0 =A0 =A0 =A0 } */ *uap; >> { >> >> =A0 =A0 =A0 =A0 printf("%s called\n", __FUNCTION__); >> >> =A0 =A0 =A0 =A0 printf("resource: %d\n", uap->resource); >> =A0 =A0 =A0 =A0 if (uap->resource>=3D JLIM_NLIMITS) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 td->td_retval[0] =3D -1; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EINVAL); >> =A0 =A0 =A0 =A0 } >> =A0 =A0 =A0 =A0 return (0); >> } >> > > Thanks for trying this out. I still couldn't find the problem. Is this > generate code? I mean the prototype of the function. I'm using C99 syntax > and I manually added the implementation, the generated code what I'm usin= g > is just what make sysent generated. Besides, the generated code in > sysproto.h is different from this struct that you have here, there are > padding members, as well: > > +struct setjlimit_args { > + =A0 =A0 =A0 char jid_l_[PADL_(__jid_t)]; __jid_t jid; char > jid_r_[PADR_(__jid_t)]; > + =A0 =A0 =A0 char resource_l_[PADL_(int)]; int resource; char > resource_r_[PADR_(int)]; > + =A0 =A0 =A0 char rlp_l_[PADL_(struct rlimit *)]; struct rlimit * rlp; c= har > rlp_r_[PADR_(struct rlimit *)]; > +}; > > > And what do you have in syscalls.master? Is it the same as I have? > > +527 AUE_NULL STD { int setjlimit(__jid_t jid, int resource= , \ > + struct rlimit *rlp); } Almost the same (#__jid_t#jid_t#). struct setjlimit_args { char jid_l_[PADL_(jid_t)]; jid_t jid; char jid_r_[PADR_(jid_t)]; char resource_l_[PADL_(int)]; int resource; char resource_r_[PADR_(int)]; char rlp_l_[PADL_(struct rlimit *)]; struct rlimit * rlp; char rlp_r_[PADR_(struct rlimit *)]; }; 526 AUE_NULL STD { int setjlimit(jid_t jid, int resource, \ struct rlimit *rlp); } The difference (and probably a trigger of bug elsewhere) might be in that this lives on amd64 arch (while yours on i386 afair). Just a food for thoughts. --=20 wbr, pluknet