From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KV8O8-0003pu-Uo for qemu-devel@nongnu.org; Mon, 18 Aug 2008 13:19:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KV8O6-0003p9-Hy for qemu-devel@nongnu.org; Mon, 18 Aug 2008 13:19:27 -0400 Received: from [199.232.76.173] (port=54299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KV8O6-0003ov-CY for qemu-devel@nongnu.org; Mon, 18 Aug 2008 13:19:26 -0400 Received: from py-out-1112.google.com ([64.233.166.182]:6071) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KV8O6-00054m-0o for qemu-devel@nongnu.org; Mon, 18 Aug 2008 13:19:26 -0400 Received: by py-out-1112.google.com with SMTP id p76so1685834pyb.10 for ; Mon, 18 Aug 2008 10:19:25 -0700 (PDT) Message-ID: <48A9AEF0.9010600@codemonkey.ws> Date: Mon, 18 Aug 2008 12:18:40 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] pty/tty functions for BSD too References: <20080818105912.GF4686@implementation.uk.xensource.com> <48A981F1.6070606@codemonkey.ws> <20080818142333.GQ4686@implementation.uk.xensource.com> <20080818.091245.74704979.imp@bsdimp.com> In-Reply-To: <20080818.091245.74704979.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: samuel.thibault@ens-lyon.org Warner Losh wrote: > From: Samuel Thibault > Subject: Re: [Qemu-devel] pty/tty functions for BSD too > Date: Mon, 18 Aug 2008 15:23:33 +0100 > > >> Anthony Liguori, le Mon 18 Aug 2008 09:06:41 -0500, a écrit : >> >>> Samuel Thibault wrote: >>> >>>> In Xen, pty/tty functions are enabled for BSD too, shouldn't we enable >>>> them in upstream qemu too, as patched below? >>>> >>>> >>> And you're sure that these functions compile/work on NetBSD/OpenBSD? >>> >> The defines are explicit in Xen, so I guess somebody tested it. I >> haven't myself. I wonder why there is no FreeBSD however. >> > > The TTY/PTY code is 4.2BSD, so everybdoy has it... Not sure about why > no FreeBSD. I haven't looked at the code, but I thought there was a > different fork it took.. > > I've noticed many times in the past that the #ifdef sun and/or #ifdef > linux code works great on FreeBSD. > I hate to admit it, but autoconf really has it right here. Instead of doing: #if defined(__linux__) || defined(__FreeBSD__) || ... fd = openpty(); #endif we should have: #ifdef HAVE_openpty fd = openpty(); #endif and do a configure check to see if there is a usable openpty. It makes the code easier to maintain and you don't have to deal with all of this black magic wrt what individual OSes support. Regards, Anthony Liguori > Warner > > >