[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new module 'pipe2'
From: |
Bruno Haible |
Subject: |
Re: new module 'pipe2' |
Date: |
Sat, 22 Aug 2009 18:59:52 +0200 |
User-agent: |
KMail/1.9.9 |
> already possible to implement pipe2.
For reference, the introduction of pipe2 in Linux was here:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.28.y.git;a=commit;h=ed8cae8ba01348bfd83333f4648dd807b04d7f08
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.28.y.git;a=commit;h=be61a86d7237dd80510615f38ae21d6e1e98660c
Now the 'pipe' module can make use of 'pipe2':
2009-08-22 Bruno Haible <address@hidden>
* lib/pipe.c (create_pipe): Use pipe2 instead of _pipe.
* modules/pipe (Depends-on): Add pipe2.
--- lib/pipe.c.orig 2009-08-22 18:56:47.000000000 +0200
+++ lib/pipe.c 2009-08-22 18:51:00.000000000 +0200
@@ -133,12 +133,12 @@
prog_argv = prepare_spawn (prog_argv);
if (pipe_stdout)
- if (_pipe (ifd, 4096, O_BINARY | O_NOINHERIT) < 0
+ if (pipe2 (ifd, O_BINARY | O_NOINHERIT) < 0
|| (ifd[0] = fd_safer_noinherit (ifd[0])) < 0
|| (ifd[1] = fd_safer_noinherit (ifd[1])) < 0)
error (EXIT_FAILURE, errno, _("cannot create pipe"));
if (pipe_stdin)
- if (_pipe (ofd, 4096, O_BINARY | O_NOINHERIT) < 0
+ if (pipe2 (ofd, O_BINARY | O_NOINHERIT) < 0
|| (ofd[0] = fd_safer_noinherit (ofd[0])) < 0
|| (ofd[1] = fd_safer_noinherit (ofd[1])) < 0)
error (EXIT_FAILURE, errno, _("cannot create pipe"));
--- modules/pipe.orig 2009-08-22 18:56:47.000000000 +0200
+++ modules/pipe 2009-08-22 18:51:00.000000000 +0200
@@ -15,6 +15,7 @@
fatal-signal
gettext-h
open
+pipe2
spawn
posix_spawnp
posix_spawn_file_actions_init