Sys.Signals module for a Variant type of signals (and a set_signal function that...
[ocaml.git] / config / auto-aux / gethostbyaddr.c
blobc5dd129719b568a1c2f9dd24a122ffeb9b6e4bd8
1 /***********************************************************************/
2 /* */
3 /* Objective Caml */
4 /* */
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
6 /* */
7 /* Copyright 2002 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
11 /* */
12 /***********************************************************************/
14 /* $Id$ */
16 #ifndef _REENTRANT
17 /* This helps detection on Digital Unix... */
18 #define _REENTRANT
19 #endif
21 #include <sys/types.h>
22 #include <netdb.h>
24 int main(int argc, char ** argv)
26 #if NUM_ARGS == 7
27 char * address;
28 int length;
29 int type;
30 struct hostent h;
31 char buffer[10];
32 int buflen;
33 int h_errnop;
34 struct hostent * hp;
35 hp = gethostbyaddr_r(address, length, type, &h,
36 buffer, buflen, &h_errnop);
37 #elif NUM_ARGS == 8
38 char * address;
39 int length;
40 int type;
41 struct hostent h;
42 char buffer[10];
43 int buflen;
44 int h_errnop;
45 struct hostent * hp;
46 int rc;
47 rc = gethostbyaddr_r(address, length, type, &h,
48 buffer, buflen, &hp, &h_errnop);
49 #endif
50 return 0;