Add EFBIG error test for fallocate(2)

Signed-off-by: Zeng Linggang <[email protected]>
---
 testcases/kernel/syscalls/fallocate/fallocate02.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/fallocate/fallocate02.c 
b/testcases/kernel/syscalls/fallocate/fallocate02.c
index 446f279..7702a95 100644
--- a/testcases/kernel/syscalls/fallocate/fallocate02.c
+++ b/testcases/kernel/syscalls/fallocate/fallocate02.c
@@ -22,7 +22,7 @@
 /*
  * DESCRIPTION
  *     check fallocate() with various error conditions that should produce
- *     EBADF and EINVAL.
+ *     EBADF, EINVAL and EFBIG.
  */
 
 #include <stdio.h>
@@ -50,6 +50,7 @@
 #define FNAMER                 "test_file1"
 #define FNAMEW                 "test_file2"
 #define BLOCK_SIZE             1024
+#define MAX_FILESIZE            (LLONG_MAX / 1024)
 
 static void setup(void);
 static void fallocate_verify(int);
@@ -73,6 +74,8 @@ static struct test_data_t {
        {&fdw, FNAMEW, DEFAULT_TEST_MODE, BLOCKS_WRITTEN, -1, EINVAL},
        {&fdw, FNAMEW, DEFAULT_TEST_MODE, -(BLOCKS_WRITTEN+OFFSET), 1, EINVAL},
        {&fdw, FNAMEW, DEFAULT_TEST_MODE, BLOCKS_WRITTEN-OFFSET, 1, 0},
+       {&fdw, FNAMEW, DEFAULT_TEST_MODE, MAX_FILESIZE, 1, EFBIG},
+       {&fdw, FNAMEW, DEFAULT_TEST_MODE, 1, MAX_FILESIZE, EFBIG},
 };
 
 TCID_DEFINE(fallocate02);
-- 
1.8.4.2




------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to