Earlier Subject: Re: [LTP] ext4/e4defrag.c testcases compilation error,

Hi Garret/Miao,

On PPC systems, fallocate() seems to be already defined at 
/usr/include/bits/fcntl.h,
so building EXT4 test cases on PPC64 machines will create build problems even 
if the
pre-requisite packages:

e2fsprogs*
e2fsprogs-libs*
e2fsprogs-devel*

are present. So, this patch adds an extra check. Please let me know your 
thoughts.

Errors bound to occur:
[
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall  
-I/root/subrata/ltp/ltp-dev/testcases/kernel/include -I../../../../../include 
-I../../../../../include   -L../../../../../lib  e4defrag.c   -lltp -lm -o 
e4defrag
e4defrag.c:388: error: conflicting types for ‘fallocate’
/usr/include/bits/fcntl.h:240: note: previous declaration of ‘fallocate’ 
was here
make[1]: *** [e4defrag] Error 1
]

Signed-off-by: Subrata Modak <[email protected]>
---

--- ltp-dev/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c 
2010-03-15 19:32:12.000000000 +0530
+++ 
ltp-dev.modified/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c
        2010-03-24 18:09:14.336793513 +0530
@@ -383,10 +383,13 @@ int sync_file_range(int fd, loff_t offse
  * @offset:            file offset.
  * @len:               file size.
  */
+
+#ifndef __NR_fallocate
 int fallocate(int fd, int mode, loff_t offset, loff_t len)
 {
        return syscall(__NR_fallocate, fd, mode, offset, len);
 }
+#endif
 
 /*
  * get_mount_point() - Get device's mount point.

---
Regards--
Subrata Modak


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to