• Home
  • Raw
  • Download

Lines Matching refs:statx

62 We will use the +statx()+ system call, to provide a concrete example of a
103 appropriate or replace +statx+ with the system call chosen in exercise 2.1.
107 $ mkdir testcases/kernel/syscalls/statx
108 $ cd testcases/kernel/syscalls/statx
109 $ echo statx >> .gitignore
124 * Test statx
157 We have also set +test.min_kver+ to the kernel version where +statx+ was
163 Occasionally features are back ported to older kernel versions, so +statx+ may
212 Assuming you are in the test's subdirectory +testcases/kernel/syscalls/statx+,
224 this we need to add it to the +runtest+ file. So open +runtest/statx+ and add
279 $ git add -v :/testcases/kernel/syscalls/statx :/runtest/syscalls
280 $ git commit -m "statx01: Add new test for statx syscall"
283 This should add all the new files in the +statx+ directory and the +runtest+
323 At the time of writing +statx+ has no +glibc+ wrapper. It is also fairly common
325 cut down C library in comparison to the GNU one. So we must call +statx()+
337 +statx+ system call across a number of +uinstd.h+ files in the Linux kernel.
343 For +statx+ we had to add +statx 332+ to +testcases/kernel/include/x86_64.in+,
344 +statx 383+ to +testcases/kernel/include/powerpc.in+, etc. Now lets look at
350 * Test statx
352 * Check if statx exists and what error code it returns when we give it dodgy
366 struct statx {
391 unsigned int mask, struct statx *statxbuf)
399 So the top part of the code is now boiler plate for calling +statx+. It is
401 for new system calls like +statx+, we copy, with a few modifications, the
410 structure definitions which form part of the +statx+ API. These were copied
415 +statx+. This also provides a stub for when +statx+ is eventually integrated
427 +./configure+ before building) which checks if the +statx+ system call and
442 struct statx statxbuf = { 0 };
447 tst_res(TFAIL, "statx thinks it can stat NULL");
449 tst_res(TPASS, "statx set errno to EFAULT as expected");
451 tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value");
474 If we try to run the test on a kernel where +statx+ does not exist, then
519 For +statx+ we would like to create some files or file like objects which we
527 * Test statx
529 * Check if statx exists and what error code it returns when we give it dodgy
541 /*************** statx structure and wrapper goes here ! ***************/
567 struct statx statxbuf = { 0 };
571 tst_res(TFAIL, "statx thinks it can stat NULL");
573 tst_res(TPASS, "statx set errno to EFAULT as expected");
575 tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value");
581 tst_res(TFAIL | TERRNO, "statx can not stat a basic file");
643 tst_res(TFAIL | TERRNO, "statx can not stat a basic file");
683 5.1 Check statx returns the correct number of hard links
686 The field +statx.stx_nlink+ should be equal to 2, right?
715 struct statx statxbuf = { 0 };
719 tst_res(TFAIL, "statx thinks it can stat NULL");
721 tst_res(TPASS, "statx set errno to EFAULT as expected");
723 tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value");
728 struct statx statxbuf = { 0 };
734 tst_res(TFAIL | TERRNO, "statx can not stat a basic file");
771 6.2 Test a feature unique to statx
774 So far we have not tested anything which is unique to +statx+. So, for
825 09dd2c829 statx: stage 6
826 bfeef7902 statx: stage 5b
827 76e03d714 statx: stage 5a
828 98f5bc7ac statx: stage 4
829 6f8c16438 statx: stage 3 (Add statx01)
830 5d93b84d8 Add statx and other syscall numbers
870 pick 5d93b84d8 Add statx and other syscall numbers
871 pick 6f8c16438 statx: stage 3 (Add statx01)
872 pick 98f5bc7ac statx: stage 4
873 pick 76e03d714 statx: stage 5a
874 pick bfeef7902 statx: stage 5b
875 pick 09dd2c829 statx: stage 6
914 pick 5d93b84d8 Add statx and other syscall numbers
915 pick 6f8c16438 statx: stage 3 (Add statx01)
916 pick 98f5bc7ac statx: stage 4
917 pick 76e03d714 statx: stage 5a
918 pick bfeef7902 statx: stage 5b
919 pick 09dd2c829 statx: stage 6
930 I could now do the same for the commits to the +statx+ test, making the commit