Problem 216 solution pg 52 this problem was designed

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 2 3 4 5 6 7 8 struct hostent *Gethostbyname(const char *name) { struct hostent *p; if ((p = gethostbyname(name)) == NULL) dns_error("Gethostbyname error"); return p; } code/src/csapp.c Figure A.6: Wrapper for DNS-style gethostbyname function. A.4. THE CSAPP.H HEADER FILE 671 A.4 The csapp.h header file code/include/csapp.h 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include <stdio.h> <stdlib.h> <unistd.h> <string.h> <ctype.h> <setjmp.h> <signal.h> <sys/time.h> <sys/types.h> <sys/wait.h> <sys/stat.h> <fcntl.h> <sys/mman.h> <errno.h> <math.h> <pthread.h> <semaphore.h> <sys/socket.h> <netdb.h> <netinet/in.h> <arpa/inet.h> /* Simplifies calls...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online