X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Fnfsclient-sync.c;h=460af53968eb2bf7535727a5d4e6fc68044ea198;hb=e8cab72a79a0ebdb36adcb50201de6e92945c1a6;hp=d1c70a2f66d5a4fca36e547d3c78651231b6bf6c;hpb=e2ba5764d46b29756973fdb20332a8fcfb5bbfd1;p=deb_libnfs.git diff --git a/examples/nfsclient-sync.c b/examples/nfsclient-sync.c index d1c70a2..460af53 100644 --- a/examples/nfsclient-sync.c +++ b/examples/nfsclient-sync.c @@ -35,6 +35,8 @@ #include #include "libnfs.h" #include /* for authunix_create() */ +#include "libnfs-raw.h" +#include "libnfs-raw-mount.h" struct client { char *server; @@ -44,6 +46,8 @@ struct client { }; +char buf[2*1024*1024]; + int main(int argc _U_, char *argv[] _U_) { struct nfs_context *nfs; @@ -56,9 +60,19 @@ int main(int argc _U_, char *argv[] _U_) client.server = SERVER; client.export = EXPORT; client.is_finished = 0; - 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) { @@ -89,6 +103,7 @@ int main(int argc _U_, char *argv[] _U_) exit(10); } +#if 0 ret = nfs_read(nfs, nfsfh, 16, buf); if (ret < 0) { printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs)); @@ -99,7 +114,8 @@ int main(int argc _U_, char *argv[] _U_) printf("%02x ", buf[i]&0xff); } printf("\n"); - ret = nfs_read(nfs, nfsfh, 16, buf); +#endif + ret = nfs_read(nfs, nfsfh, sizeof(buf), buf); if (ret < 0) { printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs)); exit(10); @@ -200,3 +216,4 @@ int main(int argc _U_, char *argv[] _U_) printf("nfsclient finished\n"); return 0; } +