Commit 77df9875 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Added su_socket() wrapper function.

darcs-hash:20060327101200-88462-6f85ce812be159c3cef44f506e4271da4bcf9c1e.gz
parent 75042a4d
......@@ -266,8 +266,6 @@ int su_getlocalip(su_sockaddr_t *sin);
#include <sofia-sip/su_addrinfo.h>
#if SU_HAVE_BSDSOCK
#define su_socket socket
#define su_close close
#define su_ioctl ioctl
#define su_isblocking() (su_errno() == EAGAIN || su_errno() == EWOULDBLOCK)
#endif
......
......@@ -44,6 +44,12 @@
#error Bad configuration
#endif
/** Create an endpoint for communication. */
su_socket_t su_socket(int af, int sock, int proto)
{
return socket(af, sock, proto);
}
#if SU_HAVE_BSDSOCK
int su_init(void)
{
......@@ -61,6 +67,12 @@ void su_deinit(void)
{
}
/** Close an socket descriptor. */
int su_close(su_socket_t s)
{
return close(s);
}
int su_setblocking(int s, int blocking)
{
unsigned mode = fcntl(s, F_GETFL, 0);
......@@ -101,12 +113,6 @@ void su_deinit(void)
WSACleanup();
}
/** Create an endpoint for communication. */
su_socket_t su_socket(int af, int sock, int proto)
{
return socket(af, sock, proto);
}
/** Close an socket descriptor. */
int su_close(su_socket_t s)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment