summaryrefslogtreecommitdiff
path: root/test/rpc/getrpcent.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-08-17 02:29:50 +0000
committerMike Frysinger <vapier@gentoo.org>2005-08-17 02:29:50 +0000
commitd4057a47cac54336b4d16f098f83e1f7b6e4ab6e (patch)
tree4205355e55a5bc6c49a132aceeb46d454f167504 /test/rpc/getrpcent.c
parent13ef85a17b9c6eab7dd53313314be4aee50b0f65 (diff)
start of some rpc tests
Diffstat (limited to 'test/rpc/getrpcent.c')
-rw-r--r--test/rpc/getrpcent.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/rpc/getrpcent.c b/test/rpc/getrpcent.c
new file mode 100644
index 000000000..e12e76806
--- /dev/null
+++ b/test/rpc/getrpcent.c
@@ -0,0 +1,18 @@
+#include <netdb.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ struct rpcent *ent;
+
+ while ((ent = getrpcent()) != NULL) {
+ printf("%s: %i", ent->r_name, ent->r_number);
+ while (ent->r_aliases[0])
+ printf(" %s", *ent->r_aliases++);
+ printf("\n");
+ }
+
+ endrpcent();
+
+ return 0;
+}