summaryrefslogtreecommitdiff
path: root/config/auto-aux/gethostbyaddr.c
blob: f6d36a7f3b7831438c1049f30539f679f5542323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/***********************************************************************/
/*                                                                     */
/*                                OCaml                                */
/*                                                                     */
/*            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 == 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);
#endif
  return 0;
}