From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] epoll_pwait/epoll_pwait01.c: add new testcase
Date: Thu, 3 Mar 2016 16:13:15 +0100 [thread overview]
Message-ID: <20160303151315.GC3055@rei.lan> (raw)
In-Reply-To: <1456993485-2849-1-git-send-email-fenggw-fnst@cn.fujitsu.com>
Hi!
Pushed with two changes, thanks.
> +#ifndef EPOLL_PWAIT_H
> +#define EPOLL_PWAIT_H
> +
> +#include <sys/types.h>
> +#include "config.h"
> +#include "linux_syscall_numbers.h"
> +
> +#if !defined(HAVE_EPOLL_PWAIT)
> +int epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
> + int timeout, const sigset_t *sigmask)
> +{
> + return ltp_syscall(__NR_epoll_pwait, epfd, events, maxevents,
> + timeout, sigmask);
The syscall takes one more parameter than the glibc wrapper. I had to
add the size of the sigmask i.e. _NSIG/8 here otherwise we will get
EINVAL from kernel.
> +}
> +#endif
...
> +static void verify_nonsigmask(void)
> +{
> + if (TEST_RETURN != -1) {
> + tst_resm(TFAIL, "epoll_wait() succeeded unexpectedly");
> + } else {
> + if (TEST_ERRNO == EINTR) {
> + tst_resm(TPASS | TTERRNO,
> + "epoll_wait() failed as expected");
> + } else {
> + tst_resm(TFAIL | TTERRNO,
> + "epoll_wait() failed unexpectedly, "
> + "expected errno is EINTR");
> + }
> + }
> +}
And changed these two verify function to use return after tst_resm() so
that we don't have to do the else-if spagetti code.
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2016-03-03 15:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 11:09 [LTP] [PATCH 1/2] epoll_pwait/epoll_pwait01.c: add new testcase Guangwen Feng
2016-01-20 11:10 ` [LTP] [PATCH 2/2] epoll_pwait/epoll_pwait02.c: " Guangwen Feng
2016-02-09 14:02 ` Cyril Hrubis
2016-02-19 8:33 ` [LTP] [PATCH v2] epoll_pwait/epoll_pwait01.c: " Guangwen Feng
2016-03-02 15:32 ` Cyril Hrubis
2016-03-03 7:37 ` Guangwen Feng
2016-03-03 8:24 ` [LTP] [PATCH v3] " Guangwen Feng
2016-03-03 15:13 ` Cyril Hrubis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160303151315.GC3055@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox