From owner-freebsd-emulation Tue Jan 6 02:09:06 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA25031 for emulation-outgoing; Tue, 6 Jan 1998 02:09:06 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from acaxp (acaxp.physik.rwth-aachen.de [137.226.33.200]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id CAA25022 for ; Tue, 6 Jan 1998 02:09:01 -0800 (PST) (envelope-from kuku@gilberto.physik.RWTH-Aachen.DE) Received: from gilberto by acaxp; (5.65v3.2/1.1.8.2/17Mar96-1112AM) id AA07950; Tue, 6 Jan 1998 11:08:53 +0100 Received: (from kuku@localhost) by gil.physik.rwth-aachen.de (8.8.8/8.6.9) id LAA01676 for freebsd-emulation@freebsd.org; Tue, 6 Jan 1998 11:08:53 +0100 (MET) Date: Tue, 6 Jan 1998 11:08:53 +0100 (MET) From: Christoph Kukulies Message-Id: <199801061008.LAA01676@gil.physik.rwth-aachen.de> To: freebsd-emulation@freebsd.org Subject: bochs and vn devices Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I gave bochs, a MSD-DOS emulator under FreeBSD a try and it's working quite nicely. The only problem I still have - and that has been left unanswered in two or three weeks since I posted it before chrismas in the bochs-developers mailing list - is that I cannot mount DOS partitions effectively. Bochs allows for having disk image files like 30M.vga or 126M.vga but when I have a mount_msdos mounted /c slice I see no way how to access this from bochs. Any clues? The other problem is vn devices: I wonderfully can create a floppy image and say vnconfig /dev/vn0 floppyimage and then mount -t msdos /dev/vn0 /mnt But when the diskimage is a disk which is partitioned with the fdisk program under bochs I see no way to mount that file. Any ideas? -- Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de From owner-freebsd-emulation Tue Jan 6 04:44:58 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA07047 for emulation-outgoing; Tue, 6 Jan 1998 04:44:58 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from wakko.visint.co.uk (wakko.visint.co.uk [194.207.134.12]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id EAA07035 for ; Tue, 6 Jan 1998 04:44:48 -0800 (PST) (envelope-from steve@visint.co.uk) Received: from dylan.visint.co.uk (dylan.visint.co.uk [194.207.134.180]) by wakko.visint.co.uk (8.8.5/8.7.3) with SMTP id MAA00544; Tue, 6 Jan 1998 12:51:40 GMT Date: Tue, 6 Jan 1998 12:44:40 +0000 (GMT) From: Stephen Roome To: Christoph Kukulies cc: freebsd-emulation@freebsd.org Subject: Re: bochs and vn devices In-Reply-To: <199801061008.LAA01676@gil.physik.rwth-aachen.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 6 Jan 1998, Christoph Kukulies wrote: > Bochs allows for having disk image files like 30M.vga or 126M.vga > but when I have a mount_msdos mounted /c slice I see no way > how to access this from bochs. Any clues? I managed to use my entire disk as the image, I wouldn't suggest this though, because if bochs screws up it might be bad. I think I did something like diskc: file=/dev/wd0c cyls=847 heads=64 spt=127 That's the geometry for my disk anyway, and I got bochs to start up the boot manage properly but it then whinges and exits with can't lseek file /dev/wd0c. I think it's probably possible, I just gave up as after 3 hours it still hadn't installed windows 95, and that's too slow for me. Steve. -- Steve Roome - Vision Interactive Ltd. Tel:+44(0)117 9730597 Home:+44(0)976 241342 WWW: http://dylan.visint.co.uk/ From owner-freebsd-emulation Tue Jan 6 05:04:40 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA08471 for emulation-outgoing; Tue, 6 Jan 1998 05:04:40 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from word.smith.net.au (ppp10.portal.net.au [202.12.71.110]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA08461 for ; Tue, 6 Jan 1998 05:04:33 -0800 (PST) (envelope-from mike@word.smith.net.au) Received: from word (localhost [127.0.0.1]) by word.smith.net.au (8.8.8/8.8.5) with ESMTP id XAA00332; Tue, 6 Jan 1998 23:27:11 +1030 (CST) Message-Id: <199801061257.XAA00332@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: Christoph Kukulies cc: freebsd-emulation@freebsd.org Subject: Re: bochs and vn devices In-reply-to: Your message of "Tue, 06 Jan 1998 11:08:53 BST." <199801061008.LAA01676@gil.physik.rwth-aachen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 06 Jan 1998 23:27:11 +1030 From: Mike Smith Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I gave bochs, a MSD-DOS emulator under FreeBSD a try and it's working > quite nicely. The only problem I still have - and that has been left > unanswered in two or three weeks since I posted it before chrismas in > the bochs-developers mailing list - is that I cannot mount DOS > partitions effectively. > > Bochs allows for having disk image files like 30M.vga or 126M.vga > but when I have a mount_msdos mounted /c slice I see no way > how to access this from bochs. Any clues? You cannot do this. See the networking discussions that have been taking place on the bochs list subsequent to your subscription. > The other problem is vn devices: > > I wonderfully can create a floppy image and say > > vnconfig /dev/vn0 floppyimage and then mount -t msdos /dev/vn0 /mnt > > But when the diskimage is a disk which is partitioned with > the fdisk program under bochs I see no way to mount that file. You can't, again. You can point bochs at plain devices (/dev/fd0, /dev/ wd0, etc) and it will work, but it does not support anything else. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ From owner-freebsd-emulation Tue Jan 6 16:54:03 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA14015 for emulation-outgoing; Tue, 6 Jan 1998 16:54:03 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA13966; Tue, 6 Jan 1998 16:53:37 -0800 (PST) (envelope-from pb@fasterix.frmug.org) Received: (from uucp@localhost) by frmug.org (8.8.8/frmug-2.2/nospam) with UUCP id BAA16489; Wed, 7 Jan 1998 01:53:30 +0100 (CET) (envelope-from pb@fasterix.frmug.org) Received: (from pb@localhost) by fasterix.frmug.org (8.8.8/8.8.5/pb-19970302) id BAA24984; Wed, 7 Jan 1998 01:50:53 +0100 (CET) Message-ID: <19980107015053.TL50316@@> Date: Wed, 7 Jan 1998 01:50:53 +0100 From: pb@fasterix.freenix.org (Pierre Beyssac) To: emulation@freebsd.org Cc: hackers@freebsd.org Subject: playing with the Linux JDK 1.1.3 under -current X-Mailer: Mutt 0.59.1e Mime-Version: 1.0 Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk [ this is mainly an emulator problem, but as it seems to involve more general questions about differing socket semantics under Linux vs FreeBSD, I Cc: this to -hackers ] I've been playing with the Linux JDK (v 1.1.3) under FreeBSD-current. Works fairly well, except for two problems I encountered. Note that the issue here is not so much having a running JDK (since there are others, native projects for this under FreeBSD) as using the Linux JDK as a compliance test for the Linux emulator :-) - fetching remote URLs in the Appletviewer (as in appletviewer http://xxxx/some_cool_applet_page.html) doesn't work ("already connected" error). Especially when the connection takes a long time to establish (remote site). In fact this occurs in the runtime code used for any Java connect(). - I have problems with a program using Netscape IFC classes V1.1.2 (freezes when exposing its window), while IFC 1.1.1 works perfectly fine. I'm told by a Linux user that these both work ok with the JDK under Linux, so these are probably not JDK bugs. I know where the first problem comes from and have been able to patch the Linux emulator code for a quick and dirty hack around the problem, by ignoring the ISCONN error when returned by connect(). The JDK runtime is apparently not expecting this error when redoing a connect() on a non-blocking socket, after the first connect() failed with a EINPROGRESS. Note that the original JDK code itself is hacked to work around Solaris socket bugs, which excuses this rather disgusting way of handling things... In the other case, the Java runtime is waiting (wchan=pause, according to ps) and doesn't fetch a variable amount of data it apparently got on its socket from the X server (it apparently fills with X events as you move the mouse and click). It all looks like subtle differences in the handling of non-blocking sockets between Linux and FreeBSD. Does anyone know about any such differences? I'm looking into this when I can spare a little time, but I thought maybe it would be a good idea to ask there first :-) -- Pierre Beyssac pb@fasterix.frmug.org pb@fasterix.freenix.org {Free,Net,Open}BSD, Linux : il y a moins bien, mais c'est plus cher Free domains: http://www.eu.org/ or mail dns-manager@EU.org From owner-freebsd-emulation Tue Jan 6 22:38:15 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA16955 for emulation-outgoing; Tue, 6 Jan 1998 22:38:15 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from word.smith.net.au (vh1.gsoft.com.au [203.38.152.122]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA16938; Tue, 6 Jan 1998 22:38:01 -0800 (PST) (envelope-from mike@word.smith.net.au) Received: from word (localhost [127.0.0.1]) by word.smith.net.au (8.8.8/8.8.5) with ESMTP id RAA00809; Wed, 7 Jan 1998 17:00:38 +1030 (CST) Message-Id: <199801070630.RAA00809@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: pb@fasterix.freenix.org (Pierre Beyssac) cc: emulation@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: playing with the Linux JDK 1.1.3 under -current In-reply-to: Your message of "Wed, 07 Jan 1998 01:50:53 BST." <19980107015053.TL50316@@> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 07 Jan 1998 17:00:37 +1030 From: Mike Smith Sender: owner-freebsd-emulation@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > It all looks like subtle differences in the handling of non-blocking > sockets between Linux and FreeBSD. Does anyone know about any such > differences? I'm looking into this when I can spare a little time, > but I thought maybe it would be a good idea to ask there first :-) I think the correct answer is "please tell us when you have fixes". 8) Seriously, I don't know of anyone else working in this area at the moment. If/when you have anything that works, *please* let me know and I'll get it committed. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ From owner-freebsd-emulation Wed Jan 7 00:26:22 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA28049 for emulation-outgoing; Wed, 7 Jan 1998 00:26:22 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from gil.physik.rwth-aachen.de (gilberto.physik.rwth-aachen.de [137.226.30.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA28030 for ; Wed, 7 Jan 1998 00:26:15 -0800 (PST) (envelope-from kuku@gilberto.physik.RWTH-Aachen.DE) Received: (from kuku@localhost) by gil.physik.rwth-aachen.de (8.8.8/8.8.7) id JAA04405 for freebsd-emulation@freebsd.org; Wed, 7 Jan 1998 09:26:19 +0100 (MET) (envelope-from kuku) Date: Wed, 7 Jan 1998 09:26:19 +0100 (MET) From: Christoph Kukulies Message-Id: <199801070826.JAA04405@gil.physik.rwth-aachen.de> To: freebsd-emulation@freebsd.org Subject: dosemu Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Not being content with the state and facilities of the various existing DOS emulators (bochs - which seems to be the most promising to me lacks a unix fs redirector and I see no way to access a DOS volume easily resp. communicate with that volume and the unix FS) I looked around and came across 'dosemu' which seems to be preferably deveoped for linux but also contains a NetBSD branch. Has anyone tried to port this emulator (dosemu) to FreeBSD? -- Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de From owner-freebsd-emulation Wed Jan 7 04:35:50 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA21196 for emulation-outgoing; Wed, 7 Jan 1998 04:35:50 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from word.smith.net.au (ppp3.portal.net.au [202.12.71.103]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id EAA21188 for ; Wed, 7 Jan 1998 04:35:39 -0800 (PST) (envelope-from mike@word.smith.net.au) Received: from word (localhost [127.0.0.1]) by word.smith.net.au (8.8.8/8.8.5) with ESMTP id VAA00270; Wed, 7 Jan 1998 21:55:45 +1030 (CST) Message-Id: <199801071125.VAA00270@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: Christoph Kukulies cc: freebsd-emulation@FreeBSD.ORG Subject: Re: dosemu In-reply-to: Your message of "Wed, 07 Jan 1998 09:26:19 BST." <199801070826.JAA04405@gil.physik.rwth-aachen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 07 Jan 1998 21:55:44 +1030 From: Mike Smith Sender: owner-freebsd-emulation@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > Not being content with the state and facilities of the various > existing DOS emulators (bochs - which seems to be the most promising to me > lacks a unix fs redirector and I see no way to access a DOS volume > easily resp. communicate with that volume and the unix FS) I looked around > and came across 'dosemu' which seems to be preferably deveoped for > linux but also contains a NetBSD branch. What is doscmd missing for your application? > Has anyone tried to port this emulator (dosemu) to FreeBSD? No. The last time I looked at it was before the current vm86 interface had stabilised. Now that we actually do the vm86 thing properly, you could probably get closer to having it running. Note that it is a Linux application in the truest sense of the term. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ From owner-freebsd-emulation Wed Jan 7 16:18:04 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA28110 for emulation-outgoing; Wed, 7 Jan 1998 16:18:04 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA28079 for ; Wed, 7 Jan 1998 16:17:34 -0800 (PST) (envelope-from pb@fasterix.frmug.org) Received: (from uucp@localhost) by frmug.org (8.8.8/frmug-2.2/nospam) with UUCP id BAA27544; Thu, 8 Jan 1998 01:17:09 +0100 (CET) (envelope-from pb@fasterix.frmug.org) Received: (from pb@localhost) by fasterix.frmug.org (8.8.8/8.8.5/pb-19970302) id BAA08461; Thu, 8 Jan 1998 01:10:58 +0100 (CET) Message-ID: <19980108011058.AW19380@@> Date: Thu, 8 Jan 1998 01:10:58 +0100 From: pb@fasterix.freenix.org (Pierre Beyssac) To: mike@smith.net.au (Mike Smith) Cc: emulation@freebsd.org Subject: Re: playing with the Linux JDK 1.1.3 under -current References: <19980107015053.TL50316@@> <199801070630.RAA00809@word.smith.net.au> X-Mailer: Mutt 0.59.1e Mime-Version: 1.0 In-Reply-To: <199801070630.RAA00809@word.smith.net.au>; from Mike Smith on Jan 7, 1998 17:00:37 +1030 Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Mike Smith writes: > > It all looks like subtle differences in the handling of non-blocking > > sockets between Linux and FreeBSD. Does anyone know about any such > > I think the correct answer is "please tell us when you have fixes". 8) Ok :-) I've been able to confirm the difference is in connect() error codes. On Linux, repeated connect() calls on the same non-blocking socket return EINPROGRESS as long as the connection is pending, then 0 exactly once, then EISCONN. FreeBSD (and SunOS) return EISCONN instead of 0 when the connection is completed. I have to improve my fix somewhat before I send it to you for commit, so that it ignores EISCONN only when in non-blocking mode. It still won't not be entirely correct because it should ignore EISCONN exactly once and I have no idea how to achieve that simply. Anyway, it's probably not desirable to have a 100% Linux behaviour on that one, as the code would be needlessly twisted :-) -- Pierre Beyssac pb@fasterix.frmug.org pb@fasterix.freenix.org {Free,Net,Open}BSD, Linux : il y a moins bien, mais c'est plus cher Free domains: http://www.eu.org/ or mail dns-manager@EU.org From owner-freebsd-emulation Thu Jan 8 09:35:16 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA05726 for emulation-outgoing; Thu, 8 Jan 1998 09:35:16 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id JAA05676; Thu, 8 Jan 1998 09:34:50 -0800 (PST) (envelope-from imp@village.org) Received: from harmony [10.0.0.6] by rover.village.org with esmtp (Exim 1.71 #1) id 0xqLqv-0002H1-00; Thu, 8 Jan 1998 10:34:45 -0700 Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.8.8/8.8.3) with ESMTP id KAA19855; Thu, 8 Jan 1998 10:34:42 -0700 (MST) Message-Id: <199801081734.KAA19855@harmony.village.org> To: Mike Smith Subject: Re: playing with the Linux JDK 1.1.3 under -current Cc: pb@fasterix.freenix.org (Pierre Beyssac), emulation@freebsd.org, hackers@freebsd.org In-reply-to: Your message of "Wed, 07 Jan 1998 17:00:37 +1030." <199801070630.RAA00809@word.smith.net.au> References: <199801070630.RAA00809@word.smith.net.au> Date: Thu, 08 Jan 1998 10:34:42 -0700 From: Warner Losh Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <199801070630.RAA00809@word.smith.net.au> Mike Smith writes: : Seriously, I don't know of anyone else working in this area at the : moment. If/when you have anything that works, *please* let me know and : I'll get it committed. One thing you might want to look at is the OpenBSD hacks in the last month or two in their Linux emulator. There are a fair number of quirks in Linux's implementation of the socket API that they had to do some really gross things. Warner From owner-freebsd-emulation Thu Jan 8 10:55:59 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA15349 for emulation-outgoing; Thu, 8 Jan 1998 10:55:59 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA15333; Thu, 8 Jan 1998 10:55:52 -0800 (PST) (envelope-from pb@fasterix.frmug.org) Received: (from uucp@localhost) by frmug.org (8.8.8/frmug-2.2/nospam) with UUCP id TAA19209; Thu, 8 Jan 1998 19:55:35 +0100 (CET) (envelope-from pb@fasterix.frmug.org) Received: (from pb@localhost) by fasterix.frmug.org (8.8.8/8.8.5/pb-19970302) id TAA03410; Thu, 8 Jan 1998 19:55:21 +0100 (CET) Message-ID: <19980108195521.OO22099@@> Date: Thu, 8 Jan 1998 19:55:21 +0100 From: pb@fasterix.freenix.org (Pierre Beyssac) To: imp@village.org (Warner Losh) Cc: mike@smith.net.au (Mike Smith), pb@fasterix.freenix.org (Pierre Beyssac), emulation@freebsd.org, hackers@freebsd.org Subject: Re: playing with the Linux JDK 1.1.3 under -current References: <199801070630.RAA00809@word.smith.net.au> <199801081734.KAA19855@harmony.village.org> X-Mailer: Mutt 0.59.1e Mime-Version: 1.0 In-Reply-To: <199801081734.KAA19855@harmony.village.org>; from Warner Losh on Jan 8, 1998 10:34:42 -0700 Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Warner Losh writes: > One thing you might want to look at is the OpenBSD hacks in the last > month or two in their Linux emulator. Thanks for the hint, I'll give their code a look and will try to integrate their fixes. I have just sent PRs with patches for 2 fixes (TCP_NODELAY and the non-blocking connect I mentioned), but I haven't had the PR # returned yet. I'll send these to Mike when I get them. > There are a fair number of > quirks in Linux's implementation of the socket API that they had to do > some really gross things. I can't say this surprises me... Compatibility with existing code was apparently the last of their worries, it's so much better to reinvent the wheel as usual. -- Pierre Beyssac pb@fasterix.frmug.org pb@fasterix.freenix.org {Free,Net,Open}BSD, Linux : il y a moins bien, mais c'est plus cher Free domains: http://www.eu.org/ or mail dns-manager@EU.org From owner-freebsd-emulation Thu Jan 8 19:28:15 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA04141 for emulation-outgoing; Thu, 8 Jan 1998 19:28:15 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA04128 for ; Thu, 8 Jan 1998 19:28:09 -0800 (PST) (envelope-from pb@fasterix.frmug.org) Received: (from uucp@localhost) by frmug.org (8.8.8/frmug-2.2/nospam) with UUCP id CAA19485 for emulation@freebsd.org; Fri, 9 Jan 1998 02:33:54 +0100 (CET) (envelope-from pb@fasterix.frmug.org) Received: (from pb@localhost) by fasterix.frmug.org (8.8.8/8.8.5/pb-19970302) id CAA17311; Fri, 9 Jan 1998 02:13:25 +0100 (CET) Message-ID: <19980109021325.KI01385@@> Date: Fri, 9 Jan 1998 02:13:25 +0100 From: pb@fasterix.freenix.org (Pierre Beyssac) To: emulation@freebsd.org Subject: fixes for the Linuxulator References: <199801070630.RAA00809@word.smith.net.au> <199801081734.KAA19855@harmony.village.org> <19980108195521.OO22099@@> <34B57A18.6F5C@asme.org> X-Mailer: Mutt 0.59.1e Mime-Version: 1.0 In-Reply-To: <34B57A18.6F5C@asme.org>; from Pedro Giffuni on Jan 8, 1998 17:15:04 -0800 Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk The notifications for my PRs have arrived (thanks Steve and Pedro!), these are PR kern/5464 and kern/5465. Mike, the patch I included with kern/5464 covers only TCP options in setsockopt(), I forgot to patch for getsockopt(), please don't commit it. I post here the complete patch for both PRs as it's not very long. I haven't actually tested the patch to the getsockopt() part, but it doesn't seem to break anything I ran. I also had a look at the OpenBSD code, they seem to correct the connect() bug by calling getsockopt with SO_ERROR and returning the error they got, if any, instead of the EISCONN error... They don't check the socket is non blocking before doing that, though. I haven't had time to test this under FreeBSD yet. --- linux_socket.c.orig Wed Dec 17 21:28:59 1997 +++ linux_socket.c Fri Jan 9 01:48:37 1998 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -341,14 +342,35 @@ caddr_t name; int namelen; } */ bsd_args; - int error; + struct fcntl_args /* { + int fd; + int cmd; + int arg; + } */ bsd_fcntl_args; + int error, err_fcntl; if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args)))) return error; bsd_args.s = linux_args.s; bsd_args.name = (caddr_t)linux_args.name; bsd_args.namelen = linux_args.namelen; - return connect(p, &bsd_args); + error = connect(p, &bsd_args); + if (error == EISCONN) { + /* + * Linux doesn't return EISCONN the first time it occurs, + * when on a non-blocking socket. We simply ignore it all + * the time if O_NONBLOCK is set; that's not entirely correct. + */ + bsd_fcntl_args.fd = linux_args.s; + bsd_fcntl_args.cmd = F_GETFL; + bsd_fcntl_args.arg = 0; + err_fcntl = fcntl(p, &bsd_fcntl_args); + if (err_fcntl == 0 && (p->p_retval[0] & O_NONBLOCK)) { + error = 0; + p->p_retval[0] = 0; + } + } + return error; } struct linux_listen_args { @@ -661,6 +683,10 @@ case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(linux_args.optname); break; + case IPPROTO_TCP: + /* Linux TCP option values match BSD's */ + name = linux_args.optname; + break; default: return EINVAL; } @@ -703,6 +729,10 @@ break; case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(linux_args.optname); + break; + case IPPROTO_TCP: + /* Linux TCP option values match BSD's */ + name = linux_args.optname; break; default: return EINVAL; -- Pierre Beyssac pb@fasterix.frmug.org pb@fasterix.freenix.org {Free,Net,Open}BSD, Linux : il y a moins bien, mais c'est plus cher Free domains: http://www.eu.org/ or mail dns-manager@EU.org From owner-freebsd-emulation Sat Jan 10 20:19:46 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA09189 for emulation-outgoing; Sat, 10 Jan 1998 20:19:46 -0800 (PST) (envelope-from owner-freebsd-emulation) Received: from ns1.itvcorp.com (NS1.itvcorp.com [206.171.8.7]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA09179 for ; Sat, 10 Jan 1998 20:19:42 -0800 (PST) (envelope-from michael@itvcorp.com) Received: from itvcorp.com (fclub.itvcorp.com [206.171.8.88]) by ns1.itvcorp.com (Post.Office MTA v3.1 release PO203a ID# 0-37055U100L100S0) with ESMTP id AAA296 for ; Sat, 10 Jan 1998 20:23:01 -0800 Message-ID: <2F135C60.9ABE62A7@itvcorp.com> Date: Tue, 10 Jan 1995 20:19:44 -0800 From: "Michael B. Montvelishsky" X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 2.2.2-RELEASE i386) MIME-Version: 1.0 To: emulation@freebsd.org Subject: subscribe Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk