]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/mach/hurd/pipe.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / mach / hurd / pipe.c
index a564a2f793a8e1ef4225849f4fd1e604c2e58953..ae5ed128fde9242a50d8cb0ebcd3ffb9cc27e108 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,93,94,95,96,99,2000,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://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).
 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)