repositories
/
deb_libnfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Redo the buffer handling for input buffers and make sure we only read one PDU at...
[deb_libnfs.git]
/
examples
/
nfsclient-sync.c
diff --git
a/examples/nfsclient-sync.c
b/examples/nfsclient-sync.c
index 93704431d2d8f5aa7383d26346ae7934385059f2..460af53968eb2bf7535727a5d4e6fc68044ea198 100644
(file)
--- a/
examples/nfsclient-sync.c
+++ b/
examples/nfsclient-sync.c
@@
-46,6
+46,8
@@
struct client {
};
};
+char buf[2*1024*1024];
+
int main(int argc _U_, char *argv[] _U_)
{
struct nfs_context *nfs;
int main(int argc _U_, char *argv[] _U_)
{
struct nfs_context *nfs;
@@
-58,7
+60,6
@@
int main(int argc _U_, char *argv[] _U_)
client.server = SERVER;
client.export = EXPORT;
client.is_finished = 0;
client.server = SERVER;
client.export = EXPORT;
client.is_finished = 0;
- char buf[16];
off_t offset;
struct statvfs svfs;
exports export, tmp;
off_t offset;
struct statvfs svfs;
exports export, tmp;
@@
-102,6
+103,7
@@
int main(int argc _U_, char *argv[] _U_)
exit(10);
}
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));
ret = nfs_read(nfs, nfsfh, 16, buf);
if (ret < 0) {
printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs));
@@
-112,7
+114,8
@@
int main(int argc _U_, char *argv[] _U_)
printf("%02x ", buf[i]&0xff);
}
printf("\n");
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);
if (ret < 0) {
printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs));
exit(10);