]> sourceware.org Git - systemtap.git/commitdiff
Update rename.c syscall test for 3.10.0-294.el7 kernels.
authorMartin Cermak <mcermak@redhat.com>
Thu, 16 Jul 2015 14:33:31 +0000 (16:33 +0200)
committerMartin Cermak <mcermak@redhat.com>
Thu, 16 Jul 2015 14:54:15 +0000 (16:54 +0200)
On ppc64le, 'renameat2' syscall is unimplemented as defined in the
arch/powerpc/include/asm/systbl.h file. This change also allows
'renameat2' syscall to succeed when renaming a directory to a file
in case RENAME_EXCHANGE is defined.

testsuite/systemtap.syscall/rename.c

index 03b94641d4079c6f212f30a2313ead6a5ab7f084..912c4bf5fdaccbaa126d129fcbd605b6d0f115df 100644 (file)
@@ -128,25 +128,28 @@ int main()
 #endif
 
 #if defined(SYS_renameat2)
+  // the renameat2 syscall is not implemented on ppc64le (kernel-3.10.0-294).
+  // arch/powerpc/include/asm/systbl.h has 'SYSCALL(ni_syscall) /* sys_renameat2 */'
+
   __renameat2(AT_FDCWD, "file3", AT_FDCWD, "file4", 0);
-  //staptest// renameat2 (AT_FDCWD, "file3", AT_FDCWD, "file4", 0x0) = 0
+  //staptest// [[[[renameat2 (AT_FDCWD, "file3", AT_FDCWD, "file4", 0x0) = 0!!!!ni_syscall () = -NNNN]]]]
 
   __renameat2(AT_FDCWD, "dir5", AT_FDCWD, "dir6", 0);
-  //staptest// renameat2 (AT_FDCWD, "dir5", AT_FDCWD, "dir6", 0x0) = 0
+  //staptest// [[[[renameat2 (AT_FDCWD, "dir5", AT_FDCWD, "dir6", 0x0) = 0!!!!ni_syscall () = -NNNN]]]]
 
   // This should fail since the target exists (when using RENAME_NOREPLACE).
 #ifdef RENAME_NOREPLACE
   __renameat2(AT_FDCWD, "file4", AT_FDCWD, "file2", RENAME_NOREPLACE);
-  //staptest// renameat2 (AT_FDCWD, "file4", AT_FDCWD, "file2", RENAME_NOREPLACE) = -NNNN
+  //staptest// [[[[renameat2 (AT_FDCWD, "file4", AT_FDCWD, "file2", RENAME_NOREPLACE)!!!!ni_syscall ()]]]] = NNNN
 #endif
 
   // This will fail since the target isn't empty.
   __renameat2(AT_FDCWD, "dir6", AT_FDCWD, "dir3", 0);
-  //staptest// renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "dir3", 0x0) = -NNNN (ENOTEMPTY!!!!EEXIST)
+  //staptest// [[[[renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "dir3", 0x0)!!!!ni_syscall ()]]]] = -NNNN (ENOTEMPTY!!!!EEXIST!!!!ENOSYS)
 
   // This will fail since you can't rename a file to a directory.
   __renameat2(AT_FDCWD, "file4", AT_FDCWD, "dir6", 0);
-  //staptest// renameat2 (AT_FDCWD, "file4", AT_FDCWD, "dir6", 0x0) = -NNNN (EISDIR)
+  //staptest// [[[[renameat2 (AT_FDCWD, "file4", AT_FDCWD, "dir6", 0x0)!!!!ni_syscall ()]]]] = -NNNN (EISDIR!!!!ENOENT!!!!ENOSYS)
 
   // Normally, this would fail since you can't rename a file to a
   // directory. But with RENAME_EXCHANGE, the kernel will atomically
@@ -154,39 +157,43 @@ int main()
   // RENAME_EXCHANGE, this call can fail.
 #ifdef RENAME_EXCHANGE
   __renameat2(AT_FDCWD, "file2", AT_FDCWD, "dir1", RENAME_EXCHANGE);
-  //staptest// renameat2 (AT_FDCWD, "file2", AT_FDCWD, "dir1", RENAME_EXCHANGE) = NNNN
+  //staptest// [[[[renameat2 (AT_FDCWD, "file2", AT_FDCWD, "dir1", RENAME_EXCHANGE) = NNNN!!!!ni_syscall () = -NNNN]]]]
 #endif
 
   // You can't rename a directory to a subdirectory of itself.
   __renameat2(AT_FDCWD, "dir6", AT_FDCWD, "dir6/dir4", 0);
-  //staptest// renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "dir6/dir4", 0x0) = -NNNN (EINVAL)
+  //staptest// [[[[renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "dir6/dir4", 0x0)!!!!ni_syscall ()]]]] = -NNNN (EINVAL!!!!ENOSYS)
 
-  // You can't rename a directory to a file.
+  // You can't rename a directory to a file without RENAME_EXCHANGE.
   __renameat2(AT_FDCWD, "dir6", AT_FDCWD, "file4", 0);
-  //staptest// renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "file4", 0x0) = -NNNN (ENOTDIR)
+#ifdef RENAME_EXCHANGE
+  //staptest// [[[[renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "file4", 0x0)!!!!ni_syscall ()]]]] = NNNN
+#else
+  //staptest// [[[[renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "file4", 0x0)!!!!ni_syscall ()]]]] = -NNNN (ENOTDIR!!!!ENOSYS)
+#endif
 
   __renameat2(-1, "dir6", AT_FDCWD, "file4", 0);
-  //staptest// renameat2 (-1, "dir6", AT_FDCWD, "file4", 0x0) = -NNNN
+  //staptest// [[[[renameat2 (-1, "dir6", AT_FDCWD, "file4", 0x0)!!!!ni_syscall ()]]]] = -NNNN
 
   __renameat2(AT_FDCWD, (char *)-1, AT_FDCWD, "file4", 0);
 #ifdef __s390__
   //staptest// renameat2 (AT_FDCWD, [7]?[f]+, AT_FDCWD, "file4", 0x0) = -NNNN
 #else
-  //staptest// renameat2 (AT_FDCWD, [f]+, AT_FDCWD, "file4", 0x0) = -NNNN
+  //staptest// [[[[renameat2 (AT_FDCWD, [f]+, AT_FDCWD, "file4", 0x0)!!!!ni_syscall ()]]]] = -NNNN
 #endif
 
   __renameat2(AT_FDCWD, "dir6", -1, "file4", 0);
-  //staptest// renameat2 (AT_FDCWD, "dir6", -1, "file4", 0x0) = -NNNN
+  //staptest// [[[[renameat2 (AT_FDCWD, "dir6", -1, "file4", 0x0)!!!!ni_syscall ()]]]] = -NNNN
 
   __renameat2(AT_FDCWD, "file4", AT_FDCWD, (char *)-1, 0);
 #ifdef __s390__
   //staptest// renameat2 (AT_FDCWD, "file4", AT_FDCWD, [7]?[f]+, 0x0) = -NNNN (EFAULT)
 #else
-  //staptest// renameat2 (AT_FDCWD, "file4", AT_FDCWD, [f]+, 0x0) = -NNNN (EFAULT)
+  //staptest// [[[[renameat2 (AT_FDCWD, "file4", AT_FDCWD, [f]+, 0x0)!!!!ni_syscall ()]]]] = -NNNN (EFAULT!!!!ENOSYS)
 #endif
 
   __renameat2(AT_FDCWD, "dir6", AT_FDCWD, "file4", -1);
-  //staptest// renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "file4", RENAME_[^ ]+|XXXX) = -NNNN
+  //staptest// [[[[renameat2 (AT_FDCWD, "dir6", AT_FDCWD, "file4", RENAME_[^ ]+|XXXX)!!!!ni_syscall ()]]]] = -NNNN
 #endif
 
   return 0;
This page took 0.033974 seconds and 5 git commands to generate.