All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Cc: samuel.thibault@ens-lyon.org
Subject: Re: [Qemu-devel] pty/tty functions for BSD too
Date: Mon, 18 Aug 2008 12:18:40 -0500	[thread overview]
Message-ID: <48A9AEF0.9010600@codemonkey.ws> (raw)
In-Reply-To: <20080818.091245.74704979.imp@bsdimp.com>

Warner Losh wrote:
> From: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 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	other threads:[~2008-08-18 17:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-18 10:59 [Qemu-devel] pty/tty functions for BSD too Samuel Thibault
2008-08-18 14:06 ` Anthony Liguori
2008-08-18 14:23   ` Samuel Thibault
2008-08-18 15:12     ` Warner Losh
2008-08-18 17:18       ` Anthony Liguori [this message]
2008-08-18 16:16     ` Blue Swirl
2008-08-18 16:26       ` Daniel P. Berrange
2008-08-18 16:57         ` Blue Swirl
2008-08-18 18:08           ` Blue Swirl
2008-08-18 18:20             ` Daniel P. Berrange
2008-08-18 19:42             ` Jamie Lokier
2008-08-19 10:33             ` Bernhard Reutner-Fischer
2008-08-19 11:21               ` François Revol
2008-08-19 11:40                 ` Bernhard Reutner-Fischer
2008-08-19 12:55                   ` Samuel Thibault
2008-08-19 19:17                     ` Klaus Heinz
2008-08-21 18:16                       ` Blue Swirl
2008-08-19 12:35         ` Todd T. Fries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48A9AEF0.9010600@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.