git » libfiu » commit 855d84b

preload/posix: mark some functions with 'variant: off64_t'

author Pavel Borzenkov
2014-01-22 09:21:01 UTC
committer Alberto Bertogli
2014-01-23 20:56:12 UTC
parent a592b6fb5d73c111747fe9f39915c97d0894a2d8

preload/posix: mark some functions with 'variant: off64_t'

Mark functions that use off_t type with off64_t to generate their 64-bit
counterparts. Also, define _LARGEFILE64_SOURCE for all the modules to
expose off64_t type.

Signed-off-by: Pavel Borzenkov <pavel@voidptr.ru>

preload/posix/Makefile +2 -1
preload/posix/modules/posix.io.mod +6 -0
preload/posix/modules/posix.mm.mod +1 -0

diff --git a/preload/posix/Makefile b/preload/posix/Makefile
index b269781..25f26da 100644
--- a/preload/posix/Makefile
+++ b/preload/posix/Makefile
@@ -1,7 +1,8 @@
 
 CFLAGS += -std=c99 -Wall -O3
 ALL_CFLAGS = -D_XOPEN_SOURCE=600 -fPIC -DFIU_ENABLE=1 \
-		-I. -I../../libfiu/ $(CFLAGS)
+		-D_LARGEFILE64_SOURCE=1 -I. -I../../libfiu/ \
+		$(CFLAGS)
 
 ifdef DEBUG
 ALL_CFLAGS += -g
diff --git a/preload/posix/modules/posix.io.mod b/preload/posix/modules/posix.io.mod
index bb36af3..d95bd8f 100644
--- a/preload/posix/modules/posix.io.mod
+++ b/preload/posix/modules/posix.io.mod
@@ -43,6 +43,7 @@ ssize_t pread(int fd, void *buf, size_t count, off_t offset);
 	on error: -1
 	valid errnos: EBADFD EFAULT EINTR EINVAL EIO EISDIR EOVERFLOW ENXIO
 	reduce: count
+	variants: off64_t
 
 ssize_t readv(int fd, const struct iovec *iov, int iovcnt);
 	on error: -1
@@ -53,6 +54,7 @@ ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off64_t offset);
 	on error: -1
 	valid errnos: EBADFD EFAULT EINTR EINVAL EIO EISDIR EOVERFLOW ENXIO
 	reduce: iovcnt
+	variants: off64_t
 
 
 ssize_t write(int fd, const void *buf, size_t count);
@@ -65,6 +67,7 @@ ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
 	valid errnos: EBADFD EDQUOT EFAULT EFBIG EINTR EINVAL EIO ENOSPC \
 		EOVERFLOW ENXIO
 	reduce: count
+	variants: off64_t
 
 ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 	on error: -1
@@ -76,17 +79,20 @@ ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset);
 	valid errnos: EBADFD EDQUOT EFAULT EFBIG EINTR EINVAL EIO ENOSPC \
 		EOVERFLOW ENXIO
 	reduce: iovcnt
+	variants: off64_t
 
 
 int truncate(const char *path, off_t length);
 	on error: -1
 	valid errnos: EACCES EFAULT EFBIG EINTR EINVAL EIO EISDIR ELOOP \
 		ENAMETOOLONG ENOENT ENOTDIR EPERM EROFS ETXTBSY
+	variants: off64_t
 
 int ftruncate(int fd, off_t length);
 	on error: -1
 	valid errnos: EACCES EBADF EFAULT EFBIG EINTR EINVAL EIO EISDIR ELOOP \
 		ENAMETOOLONG ENOENT ENOTDIR EPERM EROFS ETXTBSY
+	variants: off64_t
 
 
 fiu name base: posix/io/dir/
diff --git a/preload/posix/modules/posix.mm.mod b/preload/posix/modules/posix.mm.mod
index 6d96a93..128b34a 100644
--- a/preload/posix/modules/posix.mm.mod
+++ b/preload/posix/modules/posix.mm.mod
@@ -13,6 +13,7 @@ void *mmap(void *addr, size_t length, int prot, int flags, int fd, \
 	on error: MAP_FAILED
 	valid errnos: EACCES EAGAIN EBADF EINVAL ENFILE ENODEV ENOMEM EPERM \
 		ETXTBSY
+	variants: off64_t
 
 int munmap(void *addr, size_t length);
 	on error: 0