Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Mar 2000 06:18:38 -0800
From:      "Joe Shevland" <shevlandj@kpi.com.au>
To:        "SADA Kenji" <sada@rr.iij4u.or.jp>, <noway@nohow.demon.co.uk>
Cc:        <sada@FreeBSD.ORG>, <freebsd-java@FreeBSD.ORG>
Subject:   RE: linux-jdk-1.2.2 ports
Message-ID:  <NDBBLJFAELMHMDPDFAGLKENGCAAA.shevlandj@kpi.com.au>
In-Reply-To: <20000306040130L.sada@rr.iij4u.or.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0000_01BF8733.D0479FE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This was sent roughly about a month ago and
worked out for me then...

Joe

----
These patches only work on FreeBSD 3.4-STABLE - anything else, and you're
on your own.

Save the patches in a file, say /tmp/patches
become root
    cd /usr/src/sys/i386/linux
    patch -p0 < /tmp/patches

if the patches succeed, (they should fail only if you are not 3.4-STABLE)
    cd ../../modules/linux
    make

I get some warnings about linux_sysent.c - they're ok.
if the make succeeds,

    make install
    make clean

Now you have two choices:

    The easy choice:

        reboot

    The fast choice:
        kill all processes using linux emulation
        kldunload linux
        kldload linux

----
John Rochester, Java Developer                  e-Net Software, Bath, UK
jr@cs.mun.ca
john.rochester@enetgroup.co.uk
----




-----Original Message-----
From: owner-freebsd-java@FreeBSD.ORG
[mailto:owner-freebsd-java@FreeBSD.ORG]On Behalf Of SADA Kenji
Sent: Sunday, 5 March 2000 11:02 AM
To: noway@nohow.demon.co.uk
Cc: sada@FreeBSD.ORG; freebsd-java@FreeBSD.ORG
Subject: Re: linux-jdk-1.2.2 ports


In article <Pine.BSF.4.21.0003050904570.59596-100000@nohow.demon.co.uk>
noway@nohow.demon.co.uk writes:

>> > I'd like to import Jose Marques's linux-jdk-1.2.2 ports
>> > into ports-current tree by next ports freeze.
>> >
>> >  http://www.jmcm.org/tech/ports/linux_jdk.html
>> >
>> > Suggestion or objection ?
>>
>> Have the Linux emulation patches needed to allow this JDK to be used for
>> ApacheJserv and other server applications made it into FreeBSD 3.4/4.0
>> yet?  If not then the port would be broken for a lot of users.

Could you introduce me some pointers to the patch ?


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message

------=_NextPart_000_0000_01BF8733.D0479FE0
Content-Type: text/plain;
	name="patches.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="patches.txt"

--- linux_socket.c.orig	Wed Feb  2 12:49:23 2000
+++ linux_socket.c	Wed Feb  2 13:00:25 2000
@@ -441,6 +441,11 @@
 	caddr_t name;
 	int *anamelen;
     } */ bsd_args;
+    struct fcntl_args /* {
+	int fd;
+	int cmd;
+	long arg;
+    } */ f_args;
     int error;
=20
     if ((error=3Dcopyin((caddr_t)args, (caddr_t)&linux_args, =
sizeof(linux_args)))
)
@@ -448,7 +453,23 @@
     bsd_args.s =3D linux_args.s;
     bsd_args.name =3D (caddr_t)linux_args.addr;
     bsd_args.anamelen =3D linux_args.namelen;
-    return oaccept(p, &bsd_args);
+    if (error =3D oaccept(p, &bsd_args))
+	return error;
+    /*
+     * linux appears not to copy flags from the parent socket to the
+     * accepted one, so we must clear the flags in the new descriptor.
+     */
+    f_args.fd =3D p->p_retval[0];
+    f_args.cmd =3D F_SETFL;
+    f_args.arg =3D 0;
+    /*
+     * we ignore errors here since otherwise we would have an open file
+     * descriptor that wasn't returned to the user.
+     */
+    (void) fcntl(p, &f_args);
+    /* put the file descriptor back as the return value */
+    p->p_retval[0] =3D f_args.fd;
+    return 0;
 }
=20
 struct linux_getsockname_args {
--- linux_file.c.orig	Wed Feb  2 12:49:18 2000
+++ linux_file.c	Wed Feb  2 13:06:27 2000
@@ -196,18 +196,10 @@
     } */ fcntl_args;=20
     struct linux_flock linux_flock;
     struct flock *bsd_flock;
-    struct filedesc *fdp;
-    struct file *fp;
-    struct vnode *vp;
-    struct vattr va;
-    long pgid;
-    struct pgrp *pgrp;
-    struct tty *tp, *(*d_tty) __P((dev_t));
     caddr_t sg;
=20
     sg =3D stackgap_init();
     bsd_flock =3D (struct flock *)stackgap_alloc(&sg, sizeof(struct =
flock));
-    d_tty =3D NULL;
=20
 #ifdef DEBUG
     printf("Linux-emul(%d): fcntl(%d, %08x, *)\n",
@@ -286,47 +278,9 @@
=20
     case LINUX_F_SETOWN:
     case LINUX_F_GETOWN:
-	/*
-	 * We need to route around the normal fcntl() for these calls,
-	 * since it uses TIOC{G,S}PGRP, which is too restrictive for
-	 * Linux F_{G,S}ETOWN semantics. For sockets, this problem
-	 * does not exist.
-	 */
-	fdp =3D p->p_fd;
-	if ((u_int)args->fd >=3D fdp->fd_nfiles ||
-		(fp =3D fdp->fd_ofiles[args->fd]) =3D=3D NULL)
-	    return EBADF;
-	if (fp->f_type =3D=3D DTYPE_SOCKET) {
-	    fcntl_args.cmd =3D args->cmd =3D=3D LINUX_F_SETOWN ? F_SETOWN : =
F_GETOWN;
-    	    fcntl_args.arg =3D args->arg;
-	    return fcntl(p, &fcntl_args);=20
-	}
-	vp =3D (struct vnode *)fp->f_data;
-	if (vp->v_type !=3D VCHR)
-	    return EINVAL;
-	if ((error =3D VOP_GETATTR(vp, &va, p->p_ucred, p)))
-	    return error;
-
-	d_tty =3D cdevsw[major(va.va_rdev)]->d_devtotty;
-	if (!d_tty || (!(tp =3D (*d_tty)(va.va_rdev))))
-	    return EINVAL;
-	if (args->cmd =3D=3D LINUX_F_GETOWN) {
-	    p->p_retval[0] =3D tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID;
-	    return 0;
-	}
-	if ((long)args->arg <=3D 0) {
-	    pgid =3D -(long)args->arg;
-	} else {
-	    struct proc *p1 =3D pfind((long)args->arg);
-	    if (p1 =3D=3D 0)
-		return (ESRCH);
-	    pgid =3D (long)p1->p_pgrp->pg_id;
-	}
-	pgrp =3D pgfind(pgid);
-	if (pgrp =3D=3D NULL || pgrp->pg_session !=3D p->p_session)
-	    return EPERM;
-	tp->t_pgrp =3D pgrp;
-	return 0;
+	fcntl_args.cmd =3D args->cmd =3D=3D LINUX_F_SETOWN ? F_SETOWN : =
F_GETOWN;
+	fcntl_args.arg =3D args->arg;
+	return fcntl(p, &fcntl_args);=20
     }
     return EINVAL;
 }

------=_NextPart_000_0000_01BF8733.D0479FE0--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




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