diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2018-07-20 01:29:55 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-07-20 01:29:55 +0200 |
commit | de195be01569311dbbdee48c1ae36452f74bf594 (patch) | |
tree | 6f5756b3728a36ef3929bc93a3ff4d413308eb01 /sysdeps/mach/hurd/pipe.c | |
parent | 75d5e4a09ea1d1d790ae3bf3309986a3328af567 (diff) | |
download | glibc-de195be01569311dbbdee48c1ae36452f74bf594.tar.gz glibc-de195be01569311dbbdee48c1ae36452f74bf594.tar.xz glibc-de195be01569311dbbdee48c1ae36452f74bf594.zip |
hurd: Implement pipe2
* sysdeps/mach/hurd/pipe2.c: New file, copy from pipe.c. Evolve it to implement __pipe2. * sysdeps/mach/hurd/pipe.c (__pipe): Reimplement using __pipe2.
Diffstat (limited to 'sysdeps/mach/hurd/pipe.c')
-rw-r--r-- | sysdeps/mach/hurd/pipe.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/sysdeps/mach/hurd/pipe.c b/sysdeps/mach/hurd/pipe.c index 3f4b2026bb..9e67ef7c84 100644 --- a/sysdeps/mach/hurd/pipe.c +++ b/sysdeps/mach/hurd/pipe.c @@ -15,9 +15,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <sys/socket.h> -#include <sys/stat.h> #include <unistd.h> /* Create a one-way communication channel (pipe). @@ -28,23 +25,7 @@ int __pipe (int fds[2]) { - int save_errno = errno; - int result; - - /* The magic S_IFIFO protocol tells the pflocal server to create - sockets which report themselves as FIFOs, as POSIX requires for - pipes. */ - result = __socketpair (PF_LOCAL, SOCK_STREAM, S_IFIFO, fds); - if (result == -1 && errno == EPROTONOSUPPORT) - { - /* We contacted an "old" pflocal server that doesn't support the - magic S_IFIFO protocol. - FIXME: Remove this junk somewhere in the future. */ - __set_errno (save_errno); - return __socketpair (PF_LOCAL, SOCK_STREAM, 0, fds); - } - - return result; + return __pipe2 (fds, 0); } libc_hidden_def (__pipe) weak_alias (__pipe, pipe) |