summaryrefslogtreecommitdiffstats
path: root/config/auto-aux/gethostbyaddr.c
diff options
context:
space:
mode:
Diffstat (limited to 'config/auto-aux/gethostbyaddr.c')
-rw-r--r--config/auto-aux/gethostbyaddr.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/config/auto-aux/gethostbyaddr.c b/config/auto-aux/gethostbyaddr.c
new file mode 100644
index 000000000..5a10598ee
--- /dev/null
+++ b/config/auto-aux/gethostbyaddr.c
@@ -0,0 +1,54 @@
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
+/* */
+/* Copyright 2002 Institut National de Recherche en Informatique et */
+/* en Automatique. All rights reserved. This file is distributed */
+/* under the terms of the GNU Library General Public License, with */
+/* the special exception on linking described in file ../../LICENSE. */
+/* */
+/***********************************************************************/
+
+/* $Id$ */
+
+#include <sys/types.h>
+#include <netdb.h>
+
+int main(int argc, char ** argv)
+{
+#if NUM_ARGS == 7
+ char * address;
+ int length;
+ int type;
+ struct hostent h;
+ char buffer[10];
+ int buflen;
+ int h_errnop;
+ struct hostent * hp;
+ hp = gethostbyaddr_r(address, length, type, &h,
+ buffer, buflen, &h_errnop);
+#elif NUM_ARGS == 8
+ char * address;
+ int length;
+ int type;
+ struct hostent h;
+ char buffer[10];
+ int buflen;
+ int h_errnop;
+ struct hostent * hp;
+ int rc;
+ rc = gethostbyaddr_r(address, length, type, &h,
+ buffer, buflen, &hp, &h_errnop);
+#elif NUM_ARGS == 5
+ char * address;
+ int length;
+ int type;
+ struct hostent h;
+ struct hostent_data hdata;
+ int rc;
+ rc = gethostbyaddr_r(address, length, type, &h, &hdata);
+#endif
+ return 0;
+}