diff options
Diffstat (limited to 'ocaml-binary-annot/config/auto-aux/gethostbyname.c')
| -rw-r--r-- | ocaml-binary-annot/config/auto-aux/gethostbyname.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ocaml-binary-annot/config/auto-aux/gethostbyname.c b/ocaml-binary-annot/config/auto-aux/gethostbyname.c new file mode 100644 index 0000000000..043b9d3343 --- /dev/null +++ b/ocaml-binary-annot/config/auto-aux/gethostbyname.c @@ -0,0 +1,41 @@ +/***********************************************************************/ +/* */ +/* 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$ */ + +#ifndef _REENTRANT +/* This helps detection on Digital Unix... */ +#define _REENTRANT +#endif + +#include <sys/types.h> +#include <netdb.h> + +int main(int argc, char ** argv) +{ +#if NUM_ARGS == 5 + struct hostent *hp; + struct hostent h; + char buffer[1000]; + int h_errno; + hp = gethostbyname_r("www.caml.org", &h, buffer, 10, &h_errno); +#elif NUM_ARGS == 6 + struct hostent *hp; + struct hostent h; + char buffer[1000]; + int h_errno; + int rc; + rc = gethostbyname_r("www.caml.org", &h, buffer, 10, &hp, &h_errno); +#endif + return 0; +} |
