00001 /* 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * Implementation of wvsocketpair(), a portable way to call socketpair(). 00006 */ 00007 #include "wvsocketpair.h" 00008 #include <fcntl.h> 00009 00010 #ifndef _WIN32 00011 # include <sys/socket.h> 00012 #else 00013 # include <winsock2.h> 00014 # include <io.h> 00015 #endif 00016 00017 #ifdef _WIN32 00018 int socketpair(int family, int type, int protocol, int *sb); 00019 #endif 00020 00021 int wvsocketpair(int type, int socks[2]) 00022 { 00023 // NOTE: a fake socketpair() call is provided by wvstreams for win32. 00024 // The main advantage of wvsocketpair is it avoids the weird mess of 00025 // includes, ifdefs, and prototypes above. 00026 return socketpair(PF_UNIX, type, 0, socks); 00027 }