Skip to contentSkip to conversation

tools: hv: fcopy_daemon: support >2GB files for x86_32 guest

PATCH New Dexuan Cui 1 participant 1 message Mar 5, 2015 Hyper-V/Azure core and drivers

lore
Share & tools
lore

Dexuan Cui

author maintainer
#0 lore raw

PATCH 1/1 tools: hv: fcopy_daemon: support >2GB files for x86_32 guest

Without this patch, hv_fcopy_daemon's hv_copy_data() -> pwrite() will fail for >2GB file offset.

---

I tested the patch on x86_32 and x86_64 Ubuntu 15.04 nightly build(this is a generic issue and I think all the existing x86_32 distros have the issue):
without the patch, the fcopy with a >2GB file always failed and with the patch I was able to fcopy a file of 40GB successfully.

"getconf LFS_CFLAGS" returns "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" on x86_32 and returns an empty string on x86_64.

 tools/hv/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/hv/Makefile +1 -1
index 99ffe61..a8ab795 100644
@@ -3,7 +3,7 @@
 CC = $(CROSS_COMPILE)gcc
 PTHREAD_LIBS = -lpthread
 WARNINGS = -Wall -Wextra
-CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS)
+CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) $(shell getconf LFS_CFLAGS)
 
 all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
 %: %.c
Signature · 1 line
1.9.1