summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/socketpair.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2000-08-09 21:05:45 +0000
committerMark Kettenis <kettenis@gnu.org>2000-08-09 21:05:45 +0000
commit36f7b1df970558417a074f15843ef1e29c762805 (patch)
tree8f0502a8c12cc0e198e6279f5c28f9f20969d77e /sysdeps/mach/hurd/socketpair.c
parent1000d1e5bb16b0997a650f84c0605e1d2dc5f878 (diff)
* sysdeps/mach/hurd/socketpair.c (__socketpair): Renamed from socketpair. Made socketpair a weak alias. * sysdeps/mach/hurd/pipe.c (__pipe): Reimplemented using __socketpair. Use S_IFIFO protocol to make pipes POSIX conforming, but fall back on the old protocol if the socket server doesn't support it. * include/sys/socket.h: Add prototype for __socketpair.
2000-08-02 Mark Kettenis <kettenis@gnu.org> * sysdeps/mach/hurd/socketpair.c (__socketpair): Renamed from socketpair. Made socketpair a weak alias. * sysdeps/mach/hurd/pipe.c (__pipe): Reimplemented using __socketpair. Use S_IFIFO protocol to make pipes POSIX conforming, but fall back on the old protocol if the socket server doesn't support it. * include/sys/socket.h: Add prototype for __socketpair.
Diffstat (limited to 'sysdeps/mach/hurd/socketpair.c')
-rw-r--r--sysdeps/mach/hurd/socketpair.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sysdeps/mach/hurd/socketpair.c b/sysdeps/mach/hurd/socketpair.c
index fa9837dfd2..c1fb227596 100644
--- a/sysdeps/mach/hurd/socketpair.c
+++ b/sysdeps/mach/hurd/socketpair.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 94, 95, 96, 97, 2000 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
@@ -17,24 +17,20 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
+#include <fcntl.h>
#include <sys/socket.h>
+#include <unistd.h>
+
#include <hurd.h>
-#include <hurd/socket.h>
#include <hurd/fd.h>
-#include <unistd.h>
-#include <fcntl.h>
+#include <hurd/socket.h>
/* Create two new sockets, of type TYPE in domain DOMAIN and using
protocol PROTOCOL, which are connected to each other, and put file
descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
one will be chosen automatically. Returns 0 on success, -1 for errors. */
-/* XXX should be __socketpair ? */
int
-socketpair (domain, type, protocol, fds)
- int domain;
- int type;
- int protocol;
- int fds[2];
+__socketpair (int domain, int type, int protocol, int fds[2])
{
error_t err;
socket_t server, sock1, sock2;
@@ -95,3 +91,5 @@ socketpair (domain, type, protocol, fds)
fds[1] = d2;
return 0;
}
+
+weak_alias (__socketpair, socketpair)