remove the need for an explicit rpc context for the highlevel function mount_getexports()
[deb_libnfs.git] / examples / nfsclient-sync.c
index d1c70a2f66d5a4fca36e547d3c78651231b6bf6c..93704431d2d8f5aa7383d26346ae7934385059f2 100644 (file)
@@ -35,6 +35,8 @@
 #include <fcntl.h>
 #include "libnfs.h"
 #include <rpc/rpc.h>            /* for authunix_create() */
+#include "libnfs-raw.h"
+#include "libnfs-raw-mount.h"
 
 struct client {
        char *server;
@@ -59,6 +61,17 @@ int main(int argc _U_, char *argv[] _U_)
        char buf[16];
        off_t offset;
        struct statvfs svfs;
+       exports export, tmp;
+
+       printf("exports on server %s\n", SERVER);
+       export = mount_getexports(SERVER);
+       tmp = export;
+       while (tmp != NULL) {
+             printf("Export: %s\n", tmp->ex_dir);
+             tmp = tmp->ex_next;
+       }
+       mount_free_export_list(export);
+
 
        nfs = nfs_init_context();
        if (nfs == NULL) {
@@ -200,3 +213,4 @@ int main(int argc _U_, char *argv[] _U_)
        printf("nfsclient finished\n");
        return 0;
 }
+