From owner-freebsd-java Mon Jul 15 12:16:47 2002 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF66437B401; Mon, 15 Jul 2002 12:16:39 -0700 (PDT) Received: from alicia.nttmcl.com (alicia.nttmcl.com [216.69.69.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EB6843E42; Mon, 15 Jul 2002 12:16:39 -0700 (PDT) (envelope-from jj@alicia.nttmcl.com) Received: (from jj@localhost) by alicia.nttmcl.com (8.10.1/8.10.1) id g6FJGMB06048; Mon, 15 Jul 2002 12:16:22 -0700 (PDT) Date: Mon, 15 Jul 2002 12:16:22 -0700 From: Shannon -jj Behrens To: "Richard Seaman, Jr." , Don Bowman , freebsd-stable@FreeBSD.ORG, freebsd-java@FreeBSD.ORG Subject: Re: linux JRE 1.4 under linux compatibility only runs as root Message-ID: <20020715121622.A4888@alicia.nttmcl.com> Mail-Followup-To: Shannon -jj Behrens , "Richard Seaman, Jr." , Don Bowman , freebsd-stable@FreeBSD.ORG, freebsd-java@FreeBSD.ORG References: <20020711214742.C259A37B406@hub.freebsd.org> <20020711150748.B14694@alicia.nttmcl.com> <20020711174958.E32743@seaman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20020711174958.E32743@seaman.org>; from dick@seaman.org on Thu, Jul 11, 2002 at 05:49:58PM -0500 Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Ok, I've submitted a PR for this: Hopefully, someone will commit your patch :) -jj > On Thu, Jul 11, 2002 at 03:07:48PM -0700, Shannon -jj Behrens wrote: > > > > I know several other people have run into the problem where > > > > the (Linux) JDK or JRE 1.4 will only run as root. > > > > Tracing this with 'ktrace', the issue is a statfs call, > > > > which returns 'RESTART'. I don't see that errno listed on > > > > the man page for statfs, I guess it must come from the > > > > linux_statfs in compat/linux. > > > > > > > > 48927 java CALL statfs(0xbf1f) > > > > 48927 java RET statfs RESTART > > > > > > OK, after having found out that 'ktrace' isn't appropriate > > > for linux executables (use truss or linux_kdump), I found that > > > the culprit is actually: > > > > > > linux_sched_getscheduler(0xcb18) ERR#1 'Operation not > > > permitted' > > > > > > when root, this is permitted. When non-root, this is not-permitted. > > > > > > Suggestions? Is this a problem with the linux emulation? Or is > > > there a permissions difference between linux & freebsd here? > > > > I'm having the same problem. It looks like this has been discussed on -STABLE, > > -JAVA, -HACKERS, and -QUESTIONS, but to no avail: > > > > > > > > I'm sorry for the redundant cross-post, but this looks like a hard one to > > solve. > > Not hard at all. The perms in sched_getscheduler in -stable are silly. > (also sched_getparam). Just try changing it to something like the patch > below (note that I don't have a stable system at the moment, so I don't > guarantee it works, nor that it even compiles -- take it as a guide only). > > --- p1003_1b.c.orig Thu Jul 11 17:29:55 2002 > +++ p1003_1b.c Thu Jul 11 17:40:51 2002 > @@ -211,14 +211,24 @@ > int sched_getscheduler(struct proc *p, > struct sched_getscheduler_args *uap) > { > - int e; > - (void) (0 > - || (e = p31b_proc(p, uap->pid, &p)) > - || (e = ksched_getscheduler(&p->p_retval[0], ksched, p)) > - ); > + int e = 0; > + struct proc *targetp; > > - return e; > + if (uap->pid == 0) { > + targetp = p; > + } else { > + targetp = pfind(uap->pid); > + if (targetp == NULL) { > + e = ESRCH; > + } > + } > + > + if (e == 0) > + e = ksched_getscheduler(&p->p_retval[0], ksched, targetp); > + > + return (e); > } > + > int sched_yield(struct proc *p, > struct sched_yield_args *uap) > { > > -- > Richard Seaman, Jr. email: dick@seaman.org > 5182 N. Maple Lane phone: 262-367-5450 > Nashotah WI 53058 fax: 262-367-5852 -- Real programmers don't draw flowcharts. Flowcharts are, after all, the illiterate's form of documentation. Cavemen drew flowcharts; look how much good it did them. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message