bug-gnulib
[Top][All Lists]
Advanced

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

Re: new module 'pipe2'


From: Eric Blake
Subject: Re: new module 'pipe2'
Date: Sat, 22 Aug 2009 17:14:06 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 8/22/2009 10:46 AM:
> /* Native Woe32 API.  */
> 
> # include <io.h>
> 
> int
> pipe2 (int fd[2], int flags)
> {
>   /* Check the supported flags.  */
>   if ((flags & ~(O_CLOEXEC | O_BINARY | O_TEXT)) != 0)

Is there any way to support NONBLOCK in Woe32?

> 
>       if ((fcntl_flags = fcntl (fd[1], F_GETFL, 0)) < 0
>         || fcntl (fd[1], F_SETFL, fcntl_flags | O_NONBLOCK) < 0

Not safe; per POSIX, F_SETFL success must be checked via != -1 (not < 0).
 Multiple instances.  Also, should we offer O_BINARY/O_TEXT support on
cygwin, using setmode()?  (On Linux, O_BINARY and O_TEXT are both 0, so we
have implicitly already done so).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqQe74ACgkQ84KuGfSFAYDzsACgjocHTvSSFTtm1xncZYxhOZ9I
xgQAn2ow56bWjjRXxViXnO/nDH6Lvhh7
=GzFK
-----END PGP SIGNATURE-----




reply via email to

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