]> git.ipfire.org Git - thirdparty/glibc.git/blame - sunrpc/tst-getmyaddr.c
sunrpc: Fix netname build with older gcc
[thirdparty/glibc.git] / sunrpc / tst-getmyaddr.c
CommitLineData
4f21c95d
UD
1#include <stdio.h>
2#include <string.h>
3#include <arpa/inet.h>
4#include <netinet/in.h>
5#include <rpc/clnt.h>
6
7
8static int
9do_test (void)
10{
11 struct sockaddr_in ad;
12 struct sockaddr_in ad2;
13 memset (&ad, '\0', sizeof (ad));
14 memset (&ad2, '\0', sizeof (ad2));
15
16 get_myaddress (&ad);
17
18 printf ("addr = %s:%d\n", inet_ntoa (ad.sin_addr), ad.sin_port);
19
20 return memcmp (&ad, &ad2, sizeof (ad)) == 0;
21}
22
23#define TEST_FUNCTION do_test ()
24#include "../test-skeleton.c"