aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/asterisk.c b/asterisk.c
index bc743be86..eab37a877 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -46,6 +46,7 @@
#include "editline/histedit.h"
#include "asterisk.h"
#include <asterisk/config.h>
+#include <asterisk/lock.h>
#define AST_MAX_CONNECTS 128
#define NUM_MSGS 64
@@ -1675,3 +1676,15 @@ int main(int argc, char *argv[])
}
return 0;
}
+
+struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
+{
+ int res;
+ int h_errno;
+ struct hostent *result = NULL;
+ /* XXX Does BSD do this differently? XXX */
+ res = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &result, &h_errno);
+ if (res)
+ return NULL;
+ return &hp->hp;
+}