aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk.h
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-09 05:16:06 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-09 05:16:06 +0000
commitd3ed1161595e6f107349455ca2cb5791e61827a9 (patch)
tree0638b2467462c3819c3fafc9503c25480b2fa44a /include/asterisk.h
parent3077007845afbdb234d95196383d278a6217c4d1 (diff)
Merged revisions 187302 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r187302 | tilghman | 2009-04-08 23:59:05 -0500 (Wed, 08 Apr 2009) | 14 lines Merged revisions 187300-187301 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r187300 | tilghman | 2009-04-08 23:31:38 -0500 (Wed, 08 Apr 2009) | 3 lines Add debugging mode for diagnosing file descriptor leaks. (Related to issue #14625) ........ r187301 | tilghman | 2009-04-08 23:32:40 -0500 (Wed, 08 Apr 2009) | 2 lines Oops, missed this file in the last commit. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@187304 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk.h')
-rw-r--r--include/asterisk.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/asterisk.h b/include/asterisk.h
index d83cc3dda..774147fde 100644
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -43,7 +43,36 @@
#define setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__
#define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__
+#if defined(DEBUG_FD_LEAKS) && !defined(STANDALONE) && !defined(STANDALONE_AEL)
+/* These includes are all about ordering */
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#define open(a,...) __ast_fdleak_open(__FILE__,__LINE__,__PRETTY_FUNCTION__, a, __VA_ARGS__)
+#define pipe(a) __ast_fdleak_pipe(a, __FILE__,__LINE__,__PRETTY_FUNCTION__)
+#define socket(a,b,c) __ast_fdleak_socket(a, b, c, __FILE__,__LINE__,__PRETTY_FUNCTION__)
+#define close(a) __ast_fdleak_close(a)
+#define fopen(a,b) __ast_fdleak_fopen(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__)
+#define fclose(a) __ast_fdleak_fclose(a)
+#define dup2(a,b) __ast_fdleak_dup2(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__)
+#define dup(a) __ast_fdleak_dup(a, __FILE__,__LINE__,__PRETTY_FUNCTION__)
+
+int __ast_fdleak_open(const char *file, int line, const char *func, const char *path, int flags, ...);
+int __ast_fdleak_pipe(int *fds, const char *file, int line, const char *func);
+int __ast_fdleak_socket(int domain, int type, int protocol, const char *file, int line, const char *func);
+int __ast_fdleak_close(int fd);
+FILE *__ast_fdleak_fopen(const char *path, const char *mode, const char *file, int line, const char *func);
+int __ast_fdleak_fclose(FILE *ptr);
+int __ast_fdleak_dup2(int oldfd, int newfd, const char *file, int line, const char *func);
+int __ast_fdleak_dup(int oldfd, const char *file, int line, const char *func);
+#endif
+
int ast_set_priority(int); /*!< Provided by asterisk.c */
+int ast_fd_init(void); /*!< Provided by astfd.c */
/*!
* \brief Register a function to be executed before Asterisk exits.