summaryrefslogtreecommitdiff
path: root/lib/memdebug.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-07-29 13:25:52 +0200
committerYang Tse <yangsita@gmail.com>2011-07-29 13:27:10 +0200
commitbcbac913d65275cc9e22534a8b4cda6994b75977 (patch)
treece057b99e26849afbf3421790dd9fe54134bf1d2 /lib/memdebug.h
parent5cdbfa1837394c3ac06828c8322d1441b084aec1 (diff)
downloadcurl-bcbac913d65275cc9e22534a8b4cda6994b75977.tar.gz
socketpair() usage tracking to allow fd leak detection
Diffstat (limited to 'lib/memdebug.h')
-rw-r--r--lib/memdebug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/memdebug.h b/lib/memdebug.h
index 3dc481577..b18bb39da 100644
--- a/lib/memdebug.h
+++ b/lib/memdebug.h
@@ -65,6 +65,11 @@ CURL_EXTERN int curl_sclose(curl_socket_t sockfd,
int line , const char *source);
CURL_EXTERN curl_socket_t curl_accept(curl_socket_t s, void *a, void *alen,
int line, const char *source);
+#ifdef HAVE_SOCKETPAIR
+CURL_EXTERN int curl_socketpair(int domain, int type, int protocol,
+ curl_socket_t socket_vector[2],
+ int line , const char *source);
+#endif
/* FILE functions */
CURL_EXTERN FILE *curl_fopen(const char *file, const char *mode, int line,
@@ -90,6 +95,10 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
#undef accept /* for those with accept as a macro */
#define accept(sock,addr,len)\
curl_accept(sock,addr,len,__LINE__,__FILE__)
+#ifdef HAVE_SOCKETPAIR
+#define socketpair(domain,type,protocol,socket_vector)\
+ curl_socketpair(domain,type,protocol,socket_vector,__LINE__,__FILE__)
+#endif
#ifdef HAVE_GETADDRINFO
#if defined(getaddrinfo) && defined(__osf__)