The behavior of the mincore system call has changed in the 2.6.21
source.  The old behavior was to return ENOMEM when mincore was called
for memory that was not file backed.  Linus, myself and others had some
discussion on this and determined that it doesn't make sense for mincore
to be restricted to file backed memory.  This causes mincore01 to fail
since it expects ENOMEM on test 4.

I also discovered that the comments did not match the test since other
cases have been removed but the comments had not been modified to match
the changes to the code.

This patch removes test4 and also fixes the comments.

---------------------



This patch removes the invalid case "test 4" and also cleans up the comments
to make them match the current test code.

        Signed-off-by: Doug Chapman <[EMAIL PROTECTED]>


--- ltp-full-20070331/testcases/kernel/syscalls/mincore/mincore01.c.orig        
2007-04-24 11:46:54.000000000 -0400
+++ ltp-full-20070331/testcases/kernel/syscalls/mincore/mincore01.c     
2007-04-24 11:49:29.000000000 -0400
@@ -27,17 +27,12 @@
  * ALGORITHM
  *     test1:
  *             Invoke mincore() when the start address is not multiple of page 
size.
- *      EINVAL
- *  test2: 
- *      Invoke mincore()when the length has a non-positive value. EINVAL
- *     test3:
+ *             EINVAL
+ *     test2:
  *             Invoke mincore() when the vector points to an invalid address. 
EFAULT
- *     test4:
+ *     test3:
  *             Invoke mincore() when the starting address + length contained 
unmapped 
  *             memory. ENOMEM
- *  test5:
- *             Invoke mincore() when the length contained memory is not part 
of file. 
- *      ENOMEM
  *
  * USAGE:  <for command-line>
  *  mincore01 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
@@ -77,10 +72,9 @@
 static void setup1(void);
 static void setup2(void);
 static void setup3(void);
-static void setup4(void);
 
 char *TCID= "mincore01";
-int TST_TOTAL = 4;
+int TST_TOTAL = 3;
 extern int Tst_count;
 
 static char file_name[] = "fooXXXXXX";
@@ -101,7 +95,6 @@
                  { NULL,0,NULL,EINVAL,setup1 },
                  { NULL,0,NULL,EFAULT,setup2 },
                  { NULL,0,NULL,ENOMEM,setup3 },
-                 { NULL,0,NULL,ENOMEM,setup4 }
 }; 
 
 int main(int ac, char **av)
@@ -201,25 +194,6 @@
 }
 
 /*
- * setup4() - performs the setup related to the test4 -
- * region contained memory which is not part of file.
- * We pass an anonymously mapped address here.
- */
-void
-setup4()
-{      
-       char *t;
-       /* Create pointer to invalid address */
-       if( MAP_FAILED == (t = mmap(0,global_len,PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS,0,0)) ) {
-               tst_brkm(TBROK,cleanup,"mmaping anonymous memory failed: 
%s",strerror(errno));
-       }
-
-        TC[3].addr = t;        
-       TC[3].len = global_len;
-       TC[3].vector = global_vec;
-}
-
-/*
  * setup() - performs all ONE TIME setup for this test
  */
 void



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to