bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH 1/4] nonblocking: provide O_NONBLOCK for mingw


From: Eric Blake
Subject: Re: [PATCH 1/4] nonblocking: provide O_NONBLOCK for mingw
Date: Mon, 18 Apr 2011 07:03:16 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9

On 04/17/2011 03:24 PM, Bruno Haible wrote:
> Hi Eric,
> 
>> * modules/nonblocking (Depends-on): Add open.
> 
> This looks like a dependency that will surprise people. If a program needs the
> 'nonblocking' module for pipe or socket communication, why would it need to
> compile a replacement for open(). If a program uses open(), then it can use
> the open() module.

Breaking dependencies is always a useful exercise.

> 
> Here's a proposed patch to this effect:
> 
> 
> 2011-04-17  Bruno Haible  <address@hidden>
> 
>       Move the support of O_NONBLOCK in open() to the 'open' module.
>       * modules/nonblocking (Depends-on): Remove 'open'.
>       * m4/nonblocking.m4 (gl_NONBLOCKING_IO_BODY): Set
>       gl_cv_have_open_O_NONBLOCK.
>       * m4/open.m4 (gl_FUNC_OPEN): Replace open() also when required for
>       O_NONBLOCK support.
>       * doc/posix-functions/open.texi: Document support for O_NONBLOCK.
> 
> --- doc/posix-functions/open.texi.orig        Sun Apr 17 23:18:36 2011
> +++ doc/posix-functions/open.texi     Sun Apr 17 23:08:20 2011
> @@ -14,6 +14,10 @@
>  directory, on some platforms:
>  FreeBSD 7.2, AIX 7.1, HP-UX 11.00, Solaris 9, Irix 5.3.
>  @item
> +This function does not support the @code{O_NONBLOCK} flag when it is defined
> +by the gnulib module @code{nonblock} on some platforms:
> +mingw.
> address@hidden

openat() needs the same disclaimer, then.

> +# open.m4 serial 12
>  dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
>  dnl This file is free software; the Free Software Foundation
>  dnl gives unlimited permission to copy and/or distribute it,
> @@ -62,6 +62,15 @@
>        esac
>        ;;
>    esac
> +  dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
> +  m4_ifdef([gl_NONBLOCKING_IO], [
> +    if test $REPLACE_OPEN = 0; then
> +      gl_NONBLOCKING_IO
> +      if test $gl_cv_have_open_O_NONBLOCK != yes; then
> +        gl_REPLACE_OPEN
> +      fi
> +    fi
> +  ])

Makes sense.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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