Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 2010 23:42:43 +0200
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        pluknet <pluknet@gmail.com>
Cc:        Dimitry Andric <dimitry@andric.com>, FreeBSD Hackers <hackers@freebsd.org>
Subject:   Re: strange problem with int64_t variables
Message-ID:  <4C3F80D3.8080809@FreeBSD.org>
In-Reply-To: <AANLkTinwsNqH19LF7CAc6uC2NZuh2CdCkfEtsv6yM2Bt@mail.gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
Em 2010.07.13. 16:05, pluknet escreveu:
> #ifndef _SYS_SYSPROTO_H_
> struct setjlimit_args {
>          jid_t   jid;
>          int     resource;
>          struct rlimit *rlp;
> };
> #endif
> int
> setjlimit(td, uap)
>          struct thread *td;
>          struct setjlimit_args /* {
>                  jid_t   jid;
>                  int     resource;
>                  struct rlimit *rlp;
>          } */ *uap;
> {
>
>          printf("%s called\n", __FUNCTION__);
>
>          printf("resource: %d\n", uap->resource);
>          if (uap->resource>= JLIM_NLIMITS) {
>                  td->td_retval[0] = -1;
>                  return (EINVAL);
>          }
>          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 using 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 {
+	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 *)];
+};


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); }


Gabor



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C3F80D3.8080809>