/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that prints hostname. */
#include <stdlib.h>
#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>

int main() {
    struct hostent result;
    char buffer[128];
    int h_errnop;
      
    gethostent_r(&result,buffer,sizeof(buffer),&h_errnop);
    printf("%s\n",result.h_name);  
}
