From: Simone Piccardi Date: Wed, 24 Nov 2004 20:49:22 +0000 (+0000) Subject: Prima bozza per le routine dei socket e file rimasto indietro X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=commitdiff_plain;h=f8f72700e2402e0753124978199ab8801667bfd1;hp=eefeeaee57a56cfe1ff8c02a26c44d6f87f1368c Prima bozza per le routine dei socket e file rimasto indietro --- diff --git a/listati/servent.h b/listati/servent.h new file mode 100644 index 0000000..b810309 --- /dev/null +++ b/listati/servent.h @@ -0,0 +1,6 @@ +struct servent { + char *s_name; /* official service name */ + char **s_aliases; /* alias list */ + int s_port; /* port number */ + char *s_proto; /* protocol to use */ +} diff --git a/sources/SockAddr.c b/sources/SockAddr.c index 9a585eb..9c10fab 100644 --- a/sources/SockAddr.c +++ b/sources/SockAddr.c @@ -62,7 +62,12 @@ */ int tcp_addr(char * address, char * service, struct sockaddr * sa) { - struct addrinfo hints; + struct addrinfo hints = { + ai_flag: AI_CANONNAME, + ai_family: PF_UNSPEC, + ai_socktype: SOCK_STREAM, + ai_protocol: 7 + } /* OK, exit */