From owner-freebsd-java Thu Mar 1 17:28: 9 2001 Delivered-To: freebsd-java@freebsd.org Received: from cypherpunks.ai (cypherpunks.ai [209.88.68.47]) by hub.freebsd.org (Postfix) with ESMTP id DFDFD37B719 for ; Thu, 1 Mar 2001 17:28:05 -0800 (PST) (envelope-from jeroen@vangelderen.org) Received: from vangelderen.org (grolsch.ai [209.88.68.214]) by cypherpunks.ai (Postfix) with ESMTP id 7BA8F9; Thu, 1 Mar 2001 21:27:59 -0400 (AST) Message-ID: <3A9EF71F.A13189C6@vangelderen.org> Date: Thu, 01 Mar 2001 21:27:59 -0400 From: "Jeroen C. van Gelderen" X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Nate Williams Cc: FreeBSD Java , Ari Suutari Subject: Re: Are syscall wrappers needed in JNI? References: <3A9AE85F.C6F06D96@vangelderen.org> <15002.60084.89087.467979@nomad.yogotech.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, Sorry for the delay in response but I've been busy hacking JNI :-( Nate Williams wrote: > > > So... I'm hoping that someone here has the magic knowledge in > > his/her brain... How does one properly use libc from within Java? > > You can't in the current JDK1.1 stuff. I take it you meant to say JDK 1.2 beta as well? Or not? Ari Suutari mailed me this reply (fwd with permission): ------------------------------------------------ Jeroen C. van Gelderen wrote: > I had a look at the FreeBSD CommAPI implementation. It seems > to just mark it's filedescriptors as O_NONBLOCK and uses the > plain system calls from then on. > I think this is because the .so is dynamically loaded into JVM, which contains necessary wrappers, ie. "poll" isn't the actual system call in this environment, it is the wrapper that does all kinds of things before doing "poll". This is the case at least for JDK 1.2.2. I did some research on this one because the FreeBSD comm api used "select", for which there wasn't a wrapper at some time (don't know about the current situation). This caused the JVM to hang in weird way sometimes. I replaced "select" with "poll", which had a wrapper inside JVM and everything worked very well after that. Ari S. ------------------------------------------------ Your statement and his seem to contradict each other. Could either of you clarify matters here? Cheers, Jeroen -- Jeroen C. van Gelderen - jeroen@vangelderen.org "If I could save the Union without freeing any slave I would do it; and if I could save it by freeing some and leaving others alone I would also do that." -- Abraham Lincoln, August 22, 1862 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message