Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2010 13:11:55 +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:  <4C3AF87B.3030707@FreeBSD.org>
In-Reply-To: <AANLkTilqEfe_EL_3ExodMgqfmU-DubIdlRs-5NXXT4dO@mail.gmail.com>
References:  <4C39D92F.4050605@FreeBSD.org> <4C39DB09.6010808@andric.com>	<4C39DBFF.2000307@FreeBSD.org> <AANLkTilqEfe_EL_3ExodMgqfmU-DubIdlRs-5NXXT4dO@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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