qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] pty/tty functions for BSD too


From: Anthony Liguori
Subject: Re: [Qemu-devel] pty/tty functions for BSD too
Date: Mon, 18 Aug 2008 12:18:40 -0500
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Warner Losh wrote:
From: Samuel Thibault <address@hidden>
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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]