OBJS+=rquota/rquota.o rquota/libnfs-raw-rquota.o
OBJS+=aros/aros_compat.o
-EXAMPLES=examples/nfsclient-listservers examples/nfsclient-sync
+EXAMPLES=examples/nfsclient-listservers examples/nfsclient-sync examples/nfs-cp examples/nfs-ls
all: lib/libnfs.a $(EXAMPLES)
examples/nfsclient-sync: examples/nfsclient-sync.c lib/libnfs.a
$(CC) $(CFLAGS) -o $@ $< lib/libnfs.a
+examples/nfs-ls: examples/nfs-ls.c lib/libnfs.a
+ $(CC) $(CFLAGS) -o $@ $< lib/libnfs.a
+
+examples/nfs-cp: examples/nfs-cp.c lib/libnfs.a
+ $(CC) $(CFLAGS) -o $@ $< lib/libnfs.a
file_pread(struct file_context *fc, char *buf, int64_t count, uint64_t off)
{
if (fc->is_nfs == 0) {
- return pread(fc->fd, buf, count, off);
+ lseek(fc->fd, off, SEEK_SET);
+ return read(fc->fd, buf, count);
} else {
return nfs_pread(fc->nfs, fc->nfsfh, off, count, buf);
}
file_pwrite(struct file_context *fc, char *buf, int64_t count, uint64_t off)
{
if (fc->is_nfs == 0) {
- return pwrite(fc->fd, buf, count, off);
+ lseek(fc->fd, off, SEEK_SET);
+ return write(fc->fd, buf, count);
} else {
return nfs_pwrite(fc->nfs, fc->nfsfh, off, count, buf);
}