off_t in 64bit in ILP32 ABI while the compiler will default 32bit
for constant. It lead to pass the negative 32bit integer to kernel,
and kernel will treat it as 64bit positive integer.

It could also fix in glibc while we think that there are lots of
advantage if leave off_t remains 64bit.

Signed-off-by: Zhang Jian(Bamvor) <bamvor.zhangj...@huawei.com>
---
 testcases/kernel/fs/ftest/ftest02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/fs/ftest/ftest02.c 
b/testcases/kernel/fs/ftest/ftest02.c
index ec70d9b..153bd09 100644
--- a/testcases/kernel/fs/ftest/ftest02.c
+++ b/testcases/kernel/fs/ftest/ftest02.c
@@ -268,7 +268,7 @@ static void crfile(int me, int count)
        val = write(fd, crmsg, sizeof(crmsg) - 1);
        warn(val, "write", 0);
 
-       val = lseek(fd, -(sizeof(crmsg) - 1), 1);
+       val = lseek(fd, -(off_t)(sizeof(crmsg) - 1), 1);
        warn(val, "lseek", 0);
 
        val = read(fd, buf, sizeof(crmsg) - 1);
-- 
1.8.4.5


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to