Date: Fri, 16 Jul 2010 14:17:37 +0400 From: pluknet <pluknet@gmail.com> To: Gabor Kovesdan <gabor@freebsd.org> Cc: Dimitry Andric <dimitry@andric.com>, FreeBSD Hackers <hackers@freebsd.org> Subject: Re: strange problem with int64_t variables Message-ID: <AANLkTikX8kYatUT2pwbUbkd2HY9ISFlIJx5bVgJ7Os2D@mail.gmail.com> In-Reply-To: <4C3F80D3.8080809@FreeBSD.org> References: <4C39D92F.4050605@FreeBSD.org> <4C39DB09.6010808@andric.com> <4C39DBFF.2000307@FreeBSD.org> <AANLkTilqEfe_EL_3ExodMgqfmU-DubIdlRs-5NXXT4dO@mail.gmail.com> <4C3AF87B.3030707@FreeBSD.org> <AANLkTinwsNqH19LF7CAc6uC2NZuh2CdCkfEtsv6yM2Bt@mail.gmail.com> <4C3F80D3.8080809@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 16 July 2010 01:42, Gabor Kovesdan <gabor@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikX8kYatUT2pwbUbkd2HY9ISFlIJx5bVgJ7Os2D>
