strange problem with int64_t variables

Gabor Kovesdan gabor at FreeBSD.org
Thu Jul 15 21:42:55 UTC 2010


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


More information about the freebsd-hackers mailing list