From: Jan S. <jst...@re...> - 2014-06-26 10:29:49
|
----- Original Message ----- > From: "Zeng Linggang" <zen...@cn...> > To: ch...@su... > Cc: "ltp-list" <ltp...@li...> > Sent: Wednesday, 25 June, 2014 2:21:44 PM > Subject: [LTP] [PATCH v2] add new errno testes for timerfd_* > > * Add EINVAL errno testes for timerfd_create(2) > - The clockid argument is neither CLOCK_MONOTONIC nor CLOCK_REALTIME, > EINVAL would return. > - flags is invalid, EINVAL would return. > > * Add EBADF, EFAULT and EINVAL errno testes for timerfd_gettime(2) > - fd is not a valid file descriptor, EBADF would return. > - curr_value is not valid a pointer, EFAULT would return. > - fd is not a valid timerfd file descriptor, EINVAL would return. > > * Add EBADF, EFAULT and EINVAL errno testes for timerfd_settime(2) > - fd is not a valid file descriptor, EBADF would return. > - old_value is not valid a pointer, EFAULT would return. > - fd is not a valid timerfd file descriptor, EINVAL would return. > - flags is invalid, EINVAL would return. > > Signed-off-by: Zeng Linggang <zen...@cn...> > --- > configure.ac | 1 + > include/lapi/timerfd.h | 52 ++++++++ > m4/ltp-timerfd.m4 | 25 ++++ > runtest/syscalls | 3 + > testcases/kernel/syscalls/.gitignore | 3 + > .../kernel/syscalls/timerfd/timerfd_create01.c | 106 ++++++++++++++++ > .../kernel/syscalls/timerfd/timerfd_gettime01.c | 131 > ++++++++++++++++++++ > .../kernel/syscalls/timerfd/timerfd_settime01.c | 136 > +++++++++++++++++++++ > 8 files changed, 457 insertions(+) > create mode 100644 include/lapi/timerfd.h > create mode 100644 m4/ltp-timerfd.m4 > create mode 100644 testcases/kernel/syscalls/timerfd/timerfd_create01.c > create mode 100644 testcases/kernel/syscalls/timerfd/timerfd_gettime01.c > create mode 100644 testcases/kernel/syscalls/timerfd/timerfd_settime01.c > Hi, > +#if defined(HAVE_TIMERFD_CREATE) > +#include <sys/timerfd.h> > +#endif > + just a small nit, you probably want this included if any of HAVE_TIMERFD_* is defined. Overall it looks good to me. I tested it on RHEL6.5 and 7. Regards, Jan |