summaryrefslogtreecommitdiff
path: root/source4/lib/replace/replace.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-10-18 16:08:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:24 -0500
commitf9a0ada725b012261ec9460185105f57206c70c3 (patch)
treea636a077c0ae4d64e27044c0750a669583985fb3 /source4/lib/replace/replace.c
parenta39f239cb28e4ac6be207d4179bacffce97f1b3e (diff)
downloadsamba-f9a0ada725b012261ec9460185105f57206c70c3.tar.gz
samba-f9a0ada725b012261ec9460185105f57206c70c3.tar.bz2
samba-f9a0ada725b012261ec9460185105f57206c70c3.zip
r19393: Add replacement function for socketpair()
(This used to be commit 448a3ecc0184bfa063db1eb3ae6dc16b8b792792)
Diffstat (limited to 'source4/lib/replace/replace.c')
-rw-r--r--source4/lib/replace/replace.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c
index e7f47d7d52..83d7948dfb 100644
--- a/source4/lib/replace/replace.c
+++ b/source4/lib/replace/replace.c
@@ -590,3 +590,24 @@ int rep_setenv(const char *name, const char *value, int overwrite)
}
#endif
+#ifndef HAVE_SOCKETPAIR
+int rep_socketpair(int d, int type, int protocol, int sv[2])
+{
+ if (d != AF_UNIX) {
+ errno = EAFNOSUPPORT;
+ return -1;
+ }
+
+ if (protocol != 0) {
+ errno = EPROTONOSUPPORT;
+ return -1;
+ }
+
+ if (type != SOCK_STREAM) {
+ errno = EOPNOTSUPP;
+ return -1;
+ }
+
+ return pipe(sock);
+}
+#endif