On Fri, Feb 26, 2016 at 05:41:38PM +0800, Fei Jie wrote: > * tests/rename.c: New file. > * tests/rename.test: New test. > * tests/.gitignore: Add rename. > * tests/Makefile.am (check_PROGRAMS): Likewise. > (TESTS): Add rename.test. > --- > tests/.gitignore | 1 + > tests/Makefile.am | 2 ++ > tests/rename.c | 27 +++++++++++++++++++++++++++ > tests/rename.test | 11 +++++++++++ > 4 files changed, 41 insertions(+) > create mode 100644 tests/rename.c > create mode 100755 tests/rename.test > > diff --git a/tests/.gitignore b/tests/.gitignore > index e79d317..a5d586d 100644 > --- a/tests/.gitignore > +++ b/tests/.gitignore > @@ -81,6 +81,7 @@ readlink > readlinkat > readv > recvmsg > +rename > restart_syscall > rt_sigpending > rt_sigprocmask > diff --git a/tests/Makefile.am b/tests/Makefile.am > index d924b9a..4603c92 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -129,6 +129,7 @@ check_PROGRAMS = \ > readlinkat \ > readv \ > recvmsg \ > + rename \ > restart_syscall \ > rt_sigpending \ > rt_sigprocmask \ > @@ -287,6 +288,7 @@ TESTS = \ > readlinkat.test \ > readv.test \ > recvmsg.test \ > + rename.test \ > rt_sigpending.test \ > rt_sigprocmask.test \ > rt_sigqueueinfo.test \ > diff --git a/tests/rename.c b/tests/rename.c > new file mode 100644 > index 0000000..126d985 > --- /dev/null > +++ b/tests/rename.c > @@ -0,0 +1,27 @@ > +#include "tests.h" > +#include <sys/syscall.h> > + > +#ifdef __NR_rename > + > +# include <stdio.h> > +# include <unistd.h> > + > +# define OLD_FILE "rename_old" > +# define NEW_FILE "rename_new" > + > +int > +main(void) > +{ > + int rc = syscall(__NR_rename, OLD_FILE, NEW_FILE); > + printf("rename(\"%s\", \"%s\") = %d ENOENT (%m)\n", > + OLD_FILE, NEW_FILE, rc);
There is a chance that __NR_rename is defined but the syscall is not implemented. Let's print it like in tests/execveat.c: errno == ENOSYS ? "ENOSYS" : "ENOENT" -- ldv
pgpk3_DV5wzoh.pgp
Description: PGP signature
------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel