diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-09-29 08:48:32 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-09-29 08:48:32 +0000 |
commit | 2b13f2ccc0b53bb2f3a4f6dcc006d4dea7149e16 (patch) | |
tree | 4d407d9cf3aaa05d597017bf8c326fda4e960f66 /sunrpc/tst-getmyaddr.c | |
parent | f1750fb9c68854778e6e023ed490ff80e1c90167 (diff) | |
download | glibc-2b13f2ccc0b53bb2f3a4f6dcc006d4dea7149e16.tar.gz glibc-2b13f2ccc0b53bb2f3a4f6dcc006d4dea7149e16.tar.xz glibc-2b13f2ccc0b53bb2f3a4f6dcc006d4dea7149e16.zip |
Updated to fedora-glibc-20040929T0821
Diffstat (limited to 'sunrpc/tst-getmyaddr.c')
-rw-r--r-- | sunrpc/tst-getmyaddr.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sunrpc/tst-getmyaddr.c b/sunrpc/tst-getmyaddr.c new file mode 100644 index 0000000000..1eaf9b22ca --- /dev/null +++ b/sunrpc/tst-getmyaddr.c @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <string.h> +#include <arpa/inet.h> +#include <netinet/in.h> +#include <rpc/clnt.h> + + +static int +do_test (void) +{ + struct sockaddr_in ad; + struct sockaddr_in ad2; + memset (&ad, '\0', sizeof (ad)); + memset (&ad2, '\0', sizeof (ad2)); + + get_myaddress (&ad); + + printf ("addr = %s:%d\n", inet_ntoa (ad.sin_addr), ad.sin_port); + + return memcmp (&ad, &ad2, sizeof (ad)) == 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" |