* [LTP] [PATCH 1/3] rt_sigaction, rt_sigprocmask, rt_sigsuspend: cleanup
2014-05-20 14:42 ` chrubis
@ 2014-05-21 10:24 ` Stanislav Kholmanskikh
2014-05-21 10:24 ` [LTP] [PATCH 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper Stanislav Kholmanskikh
` (4 subsequent siblings)
5 siblings, 0 replies; 28+ messages in thread
From: Stanislav Kholmanskikh @ 2014-05-21 10:24 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
.../kernel/syscalls/rt_sigaction/rt_sigaction01.c | 88 +++-----------
.../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 85 +++-----------
.../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 105 ++++-------------
.../syscalls/rt_sigprocmask/rt_sigprocmask01.c | 112 +++++-------------
.../syscalls/rt_sigprocmask/rt_sigprocmask02.c | 89 +++------------
.../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 125 +++++--------------
6 files changed, 132 insertions(+), 472 deletions(-)
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
index 8f18394..5ca3ba4 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
@@ -12,36 +12,22 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigaction01.c */
-/* */
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction alters an action taken by a process on receipt */
/* of a particular signal. The action is specified by the */
/* sigaction structure. The previous action on the signal is */
/* saved in oact.sigsetsize should indicate the size of a */
/* sigset_t type. */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigaction01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigaction01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -57,75 +43,35 @@
#include "ltp_signal.h"
char *TCID = "rt_sigaction01";
-int testno;
+static int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int test_flags[] =
+static int test_flags[] =
{ SA_RESETHAND | SA_SIGINFO, SA_RESETHAND, SA_RESETHAND | SA_SIGINFO,
SA_RESETHAND | SA_SIGINFO, SA_NOMASK };
char *test_flags_list[] =
{ "SA_RESETHAND|SA_SIGINFO", "SA_RESETHAND", "SA_RESETHAND|SA_SIGINFO",
"SA_RESETHAND|SA_SIGINFO", "SA_NOMASK" };
-void handler(int sig)
+static void handler(int sig)
{
tst_resm(TINFO, "Signal Handler Called with signal number %d\n", sig);
return;
}
-int set_handler(int sig, int sig_to_mask, int mask_flags)
+static int set_handler(int sig, int sig_to_mask, int mask_flags)
{
#ifdef __x86_64__
struct kernel_sigaction sa, oldaction;
@@ -141,18 +87,18 @@ int set_handler(int sig, int sig_to_mask, int mask_flags)
sigaddset(&sa.sa_mask, sig);
return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction, SIGSETSIZE);
-
}
int main(int ac, char **av)
{
- int signal, flag;
+ unsigned int flag;
+ int signal;
int lc;
char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
@@ -162,7 +108,7 @@ int main(int ac, char **av)
for (testno = 0; testno < TST_TOTAL; ++testno) {
- for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) { //signal for 34 to 65
+ for (signal = SIGRTMIN; signal <= SIGRTMAX; signal++) {
#ifdef __x86_64__
sig_initial(signal);
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
index 61137df..5822a79 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
@@ -12,32 +12,18 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigaction02.c */
-/* */
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction Expected EFAULT error check */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigaction02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigaction02 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -54,70 +40,31 @@
#define INVAL_STRUCT -1
char *TCID = "rt_sigaction02";
-int testno;
+static int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
tst_exit();
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int test_flags[] =
+static int test_flags[] =
{ SA_RESETHAND | SA_SIGINFO, SA_RESETHAND, SA_RESETHAND | SA_SIGINFO,
SA_RESETHAND | SA_SIGINFO, SA_NOMASK };
char *test_flags_list[] =
{ "SA_RESETHAND|SA_SIGINFO", "SA_RESETHAND", "SA_RESETHAND|SA_SIGINFO",
"SA_RESETHAND|SA_SIGINFO", "SA_NOMASK" };
-struct test_case_t {
+static struct test_case_t {
int exp_errno;
char *errdesc;
} test_cases[] = {
@@ -127,23 +74,24 @@ struct test_case_t {
int main(int ac, char **av)
{
- int signal, flag;
+ unsigned int flag;
+ int signal;
int lc;
char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
for (lc = 0; TEST_LOOPING(lc); ++lc) {
tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
+ for (signal = SIGRTMIN; signal <= SIGRTMAX; signal++) {
+ tst_resm(TINFO, "Signal %d", signal);
- for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) { //signal for 34 to 65
- for (flag = 0; flag < 5; flag++) {
+ for (flag = 0; flag < (sizeof(test_flags) / sizeof(test_flags[0])); flag++) {
/* *
* long sys_rt_sigaction (int sig, const struct sigaction *act, *
@@ -178,7 +126,6 @@ int main(int ac, char **av)
test_flags_list[flag]);
}
}
- printf("\n");
}
}
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
index 12c3b84..8920138 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
@@ -12,32 +12,18 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigaction03.c */
-/* */
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction Expected EINVAL error check */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigaction03 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigaction03 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -54,70 +40,29 @@
#define INVAL_SIGSETSIZE -1
char *TCID = "rt_sigaction03";
-int testno;
+static int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
- tst_exit();
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int test_flags[] =
+static int test_flags[] =
{ SA_RESETHAND | SA_SIGINFO, SA_RESETHAND, SA_RESETHAND | SA_SIGINFO,
SA_RESETHAND | SA_SIGINFO, SA_NOMASK };
char *test_flags_list[] =
{ "SA_RESETHAND|SA_SIGINFO", "SA_RESETHAND", "SA_RESETHAND|SA_SIGINFO",
"SA_RESETHAND|SA_SIGINFO", "SA_NOMASK" };
-struct test_case_t {
+static struct test_case_t {
int exp_errno;
char *errdesc;
} test_cases[] = {
@@ -125,13 +70,13 @@ struct test_case_t {
EINVAL, "EINVAL"}
};
-void handler(int sig)
+static void handler(int sig)
{
tst_resm(TINFO, "Signal Handler Called with signal number %d\n", sig);
return;
}
-int set_handler(int sig, int sig_to_mask, int mask_flags)
+static int set_handler(int sig, int sig_to_mask, int mask_flags)
{
struct sigaction sa, oldaction;
@@ -147,25 +92,20 @@ int set_handler(int sig, int sig_to_mask, int mask_flags)
* sigsetsize was not equivalent to the size of a sigset_t type *
*/
- TEST(ltp_syscall
- (__NR_rt_sigaction, sig, &sa, &oldaction, INVAL_SIGSETSIZE));
- if (TEST_RETURN == 0) {
- return 0;
- } else {
- return TEST_RETURN;
- }
+ return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction,
+ INVAL_SIGSETSIZE);
}
int main(int ac, char **av)
{
- int signal, flag;
+ unsigned int flag;
+ int signal;
int lc;
char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
@@ -173,8 +113,10 @@ int main(int ac, char **av)
tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
- for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) { //signal for 34 to 65
- for (flag = 0; flag < 5; flag++) {
+ for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) {
+ tst_resm(TINFO, "Signal %d", signal);
+
+ for (flag = 0; flag < (sizeof(test_flags) / sizeof(test_flags[0])); flag++) {
TEST(set_handler
(signal, 0, test_flags[flag]));
if ((TEST_RETURN == -1)
@@ -200,7 +142,6 @@ int main(int ac, char **av)
test_flags_list[flag]);
}
}
- printf("\n");
}
}
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
index 1dbed72..f13edbf 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
@@ -12,14 +12,14 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 59 Temple Place, Suite TEST_SIG0, Boston, MA 02111-1307 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 59 Temple Place, Suite TEST_SIG0, Boston, MA 02111-1307 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak <maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigprocmask01.c */
-/* */
/* Description: This tests the rt_sigprocmask() syscall */
/* rt_sigprocmask changes the list of currently blocked signals. */
/* The set value stores the signal mask of the pending signals. */
@@ -37,22 +37,8 @@
/* SIG_SETMASK */
/* The set of blocked signals is set to the set argument. */
/* sigsetsize should indicate the size of a sigset_t type. */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigprocmask01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigprocmask01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak <maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <signal.h>
#include <errno.h>
@@ -64,65 +50,25 @@
#include "ltp_signal.h"
char *TCID = "rt_sigprocmask01";
-int testno;
+static int testno;
int TST_TOTAL = 8;
+static int sig_count;
+
#define TEST_SIG SIGRTMIN+1
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int sig_count = 0;
-
void sig_handler(int sig)
{
sig_count++;
@@ -146,9 +92,9 @@ int main(int ac, char **av)
int lc;
char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
@@ -156,35 +102,34 @@ int main(int ac, char **av)
tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
- if (sigemptyset(&set) < 0) {
+ if (sigemptyset(&set) < 0)
tst_brkm(TFAIL | TERRNO, cleanup,
"sigemptyset call failed");
- }
- if (sigaddset(&set, TEST_SIG) < 0) {
+
+ if (sigaddset(&set, TEST_SIG) < 0)
tst_brkm(TFAIL | TERRNO, cleanup,
"sigaddset call failed");
- }
/* call rt_sigaction() */
TEST(ltp_syscall(__NR_rt_sigaction, TEST_SIG, &act,
&oact, SIGSETSIZE));
- if (TEST_RETURN < 0) {
+ if (TEST_RETURN < 0)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction call failed");
- }
+
/* call rt_sigprocmask() to block signal#TEST_SIG */
TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_BLOCK, &set,
&oset, SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigprocmask call failed");
- }
+
/* Make sure that the masked process is indeed
* masked. */
- if (kill(getpid(), TEST_SIG) < 0) {
+ if (kill(getpid(), TEST_SIG) < 0)
tst_brkm(TFAIL | TERRNO, cleanup,
"call to kill() failed");
- }
+
if (sig_count) {
tst_brkm(TFAIL | TERRNO, cleanup,
"rt_sigprocmask() failed to change "
@@ -193,26 +138,26 @@ int main(int ac, char **av)
/* call rt_sigpending() */
TEST(ltp_syscall(__NR_rt_sigpending, &oset,
SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigpending call failed");
- }
+
TEST(sigismember(&oset, TEST_SIG));
- if (TEST_RETURN == 0) {
+ if (TEST_RETURN == 0)
tst_brkm(TFAIL | TTERRNO,
cleanup,
"sigismember call failed");
- }
+
/* call rt_sigprocmask() to unblock
* signal#TEST_SIG */
TEST(ltp_syscall(__NR_rt_sigprocmask,
SIG_UNBLOCK, &set, &oset,
SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO,
cleanup,
"rt_sigprocmask call failed");
- }
+
if (sig_count) {
tst_resm(TPASS,
"rt_sigprocmask "
@@ -224,7 +169,6 @@ int main(int ac, char **av)
"rt_sigprocmask "
"functionality failed");
}
-
}
}
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
index 32f406b..124592c 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
@@ -12,14 +12,14 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigprocmask02.c */
-/* */
/* Description: This tests the rt_sigprocmask() syscall */
/* rt_sigprocmask changes the list of currently blocked signals. */
/* The set value stores the signal mask of the pending signals. */
@@ -49,23 +49,8 @@
/* invalid. */
/* -EFAULT */
/* An invalid set, act, or oact was specified. */
-/* */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigprocmask02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigprocmask02 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <signal.h>
#include <errno.h>
@@ -78,61 +63,21 @@
char *TCID = "rt_sigprocmask02";
int TST_TOTAL = 2;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-sigset_t set;
+static sigset_t set;
-struct test_case_t {
+static struct test_case_t {
sigset_t *ss;
int sssize;
int exp_errno;
@@ -150,21 +95,18 @@ int main(int ac, char **av)
sigset_t s;
char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
tst_count = 0;
TEST(sigfillset(&s));
- if (TEST_RETURN == -1) {
- tst_resm(TFAIL | TTERRNO, "Call to sigfillset() failed.");
- cleanup();
- tst_exit();
- }
+ if (TEST_RETURN == -1)
+ tst_brkm(TFAIL | TTERRNO, cleanup,
+ "Call to sigfillset() failed.");
for (i = 0; i < test_count; i++) {
TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_BLOCK,
@@ -183,5 +125,4 @@ int main(int ac, char **av)
cleanup();
tst_exit();
-
}
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
index d14cdf8..6ee41d0 100644
--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
@@ -1,42 +1,27 @@
-/********************************************************************************/
-/* Copyright (c) Crackerjack Project., 2007 */
-/* */
-/* This program is free software; you can redistribute it and/or modify */
-/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation; either version 2 of the License, or */
-/* (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
-/* the GNU General Public License for more details. */
-/* */
-/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
-/* */
-/****************************************************************************** */
-/****************************************************************************** */
-/* */
-/* File: rt_sigsuspend01.c */
-/* */
-/* Description: This tests the rt_sigsuspend() syscall. */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigsuspend01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 2 */
-/* */
-/* Test Name: rt_sigsuspend01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
-/********************************************************************************/
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007 */
+/* */
+/* This program is free software; you can redistribute it and/or modify */
+/* it under the terms of the GNU General Public License as published by */
+/* the Free Software Foundation; either version 2 of the License, or */
+/* (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
+/* the GNU General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
+/******************************************************************************/
+
+/******************************************************************************/
+/* Description: This tests the rt_sigsuspend() syscall. */
+/******************************************************************************/
#include <stdio.h>
#include <signal.h>
@@ -49,75 +34,33 @@
#include "ltp_signal.h"
char *TCID = "rt_sigsuspend01";
-int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-void sig_handler(int sig)
+static void sig_handler(int sig)
{
}
int main(int ac, char **av)
{
-
sigset_t set, set1, set2;
int lc;
char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
@@ -125,9 +68,8 @@ int main(int ac, char **av)
tst_count = 0;
- if (sigemptyset(&set) < 0) {
+ if (sigemptyset(&set) < 0)
tst_brkm(TFAIL | TERRNO, cleanup, "sigemptyset failed");
- }
#ifdef __x86_64__
struct kernel_sigaction act, oact;
sig_initial(SIGALRM);
@@ -145,16 +87,15 @@ int main(int ac, char **av)
TEST(ltp_syscall(__NR_rt_sigaction, SIGALRM, &act, &oact,
SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction failed");
- }
+
TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_UNBLOCK, 0,
&set1, SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigprocmask failed");
- }
TEST(alarm(5));
int result;
--
1.7.1
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 28+ messages in thread* [LTP] [PATCH 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper
2014-05-20 14:42 ` chrubis
2014-05-21 10:24 ` [LTP] [PATCH 1/3] rt_sigaction, rt_sigprocmask, rt_sigsuspend: cleanup Stanislav Kholmanskikh
@ 2014-05-21 10:24 ` Stanislav Kholmanskikh
2014-06-04 15:53 ` chrubis
2014-05-21 10:24 ` [LTP] [PATCH 3/3] ltp_rt_sigaction: added SPARC support Stanislav Kholmanskikh
` (3 subsequent siblings)
5 siblings, 1 reply; 28+ messages in thread
From: Stanislav Kholmanskikh @ 2014-05-21 10:24 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
These testcases use many pieces of duplicated code to test
syscall(__NR_rt_sigaction). Thus it's not beautiful to add support
for other architectures there.
To overcome this I implemented a wrapper for the rt_sigaction syscall,
and made the test cases use it.
And struct kernel_sigaction is not specific only for x86_64.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
ltp_rt_sigaction is tightly couples with stuff in ltp_signal.h,
therefore I put it there.
include/ltp_signal.h | 70 ++++++++++++++++++--
.../kernel/syscalls/rt_sigaction/rt_sigaction01.c | 15 +----
.../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 8 +--
.../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 4 +-
.../syscalls/rt_sigprocmask/rt_sigprocmask01.c | 13 +---
.../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 13 +----
6 files changed, 74 insertions(+), 49 deletions(-)
diff --git a/include/ltp_signal.h b/include/ltp_signal.h
index e6fb2e0..31bb0b0 100644
--- a/include/ltp_signal.h
+++ b/include/ltp_signal.h
@@ -55,6 +55,15 @@
#ifdef LTP_RT_SIG_TEST
+#define INVAL_SA_PTR ((void *)-1)
+
+struct kernel_sigaction {
+ __sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer) (void);
+ sigset_t sa_mask;
+};
+
#ifdef __x86_64__
/*
@@ -77,13 +86,6 @@
#define HAVE_SA_RESTORER
#define SA_RESTORER 0x04000000
-struct kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_flags;
- void (*sa_restorer) (void);
- sigset_t sa_mask;
-};
-
void (*restore_rt)(void);
static void handler_h(int signal)
@@ -120,6 +122,60 @@ static inline int sig_initial(int sig)
#endif /* __x86_64__ */
+/* This is a wrapper for __NR_rt_sigaction syscall.
+ * act/oact values of INVAL_SA_PTR is used to pass
+ * an invalid pointer to syscall(__NR_rt_sigaction)
+ *
+ * Based on glibc/sysdeps/unix/sysv/linux/{...}/sigaction.c
+ */
+
+static int ltp_rt_sigaction(int signum, const struct sigaction *act,
+ struct sigaction *oact, size_t sigsetsize)
+{
+ int ret;
+ struct kernel_sigaction kact, koact;
+ struct kernel_sigaction *kact_p = NULL;
+ struct kernel_sigaction *koact_p = NULL;
+
+ if (act == INVAL_SA_PTR) {
+ kact_p = INVAL_SA_PTR;
+ } else if (act) {
+ kact.k_sa_handler = act->sa_handler;
+ memcpy(&kact.sa_mask, &act->sa_mask, sizeof(sigset_t));
+ kact.sa_flags = act->sa_flags;
+ kact.sa_restorer = NULL;
+
+ kact_p = &kact;
+ }
+
+ if (oact == INVAL_SA_PTR)
+ koact_p = INVAL_SA_PTR;
+ else if (oact)
+ koact_p = &koact;
+
+#ifdef __x86_64__
+ sig_initial(signum);
+ kact.sa_flags |= SA_RESTORER;
+ kact.sa_restorer = restore_rt;
+#endif
+
+ ret = ltp_syscall(__NR_rt_sigaction, signum,
+ kact_p, koact_p,
+ sigsetsize);
+
+ if (ret >= 0) {
+ if (oact && (oact != INVAL_SA_PTR)) {
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy(&oact->sa_mask, &koact.sa_mask,
+ sizeof(sigset_t));
+ oact->sa_flags = koact.sa_flags;
+ oact->sa_restorer = koact.sa_restorer;
+ }
+ }
+
+ return ret;
+}
+
#endif /* LTP_RT_SIG_TEST */
#endif
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
index 5ca3ba4..ac05c64 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
@@ -73,20 +73,14 @@ static void handler(int sig)
static int set_handler(int sig, int sig_to_mask, int mask_flags)
{
-#ifdef __x86_64__
- struct kernel_sigaction sa, oldaction;
- mask_flags |= SA_RESTORER;
- sa.sa_restorer = restore_rt;
- sa.k_sa_handler = (void *)handler;
-#else
struct sigaction sa, oldaction;
+
sa.sa_handler = (void *)handler;
-#endif
sa.sa_flags = mask_flags;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, sig);
- return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction, SIGSETSIZE);
+ return ltp_rt_sigaction(sig, &sa, &oldaction, SIGSETSIZE);
}
int main(int ac, char **av)
@@ -109,11 +103,6 @@ int main(int ac, char **av)
for (testno = 0; testno < TST_TOTAL; ++testno) {
for (signal = SIGRTMIN; signal <= SIGRTMAX; signal++) {
-
-#ifdef __x86_64__
- sig_initial(signal);
-#endif
-
for (flag = 0;
flag <
(sizeof(test_flags) /
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
index 5822a79..1b2d22a 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
@@ -32,13 +32,12 @@
#include <sys/syscall.h>
#include <string.h>
+#define LTP_RT_SIG_TEST
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
#include "ltp_signal.h"
-#define INVAL_STRUCT -1
-
char *TCID = "rt_sigaction02";
static int testno;
int TST_TOTAL = 1;
@@ -100,9 +99,8 @@ int main(int ac, char **av)
* An invalid act or oact value was specified *
*/
- TEST(ltp_syscall
- (__NR_rt_sigaction, signal,
- INVAL_STRUCT, NULL, SIGSETSIZE));
+ TEST(ltp_rt_sigaction(signal,
+ INVAL_SA_PTR, NULL, SIGSETSIZE));
if ((TEST_RETURN == -1)
&& (TEST_ERRNO ==
test_cases[0].exp_errno)) {
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
index 8920138..f974567 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
@@ -32,6 +32,7 @@
#include <sys/syscall.h>
#include <string.h>
+#define LTP_RT_SIG_TEST
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
@@ -92,8 +93,7 @@ static int set_handler(int sig, int sig_to_mask, int mask_flags)
* sigsetsize was not equivalent to the size of a sigset_t type *
*/
- return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction,
- INVAL_SIGSETSIZE);
+ return ltp_rt_sigaction(sig, &sa, &oldaction, INVAL_SIGSETSIZE);
}
int main(int ac, char **av)
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
index f13edbf..2b131c2 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
@@ -76,18 +76,11 @@ void sig_handler(int sig)
int main(int ac, char **av)
{
-#if __x86_64
- struct kernel_sigaction act, oact;
- sig_initial(TEST_SIG);
- act.sa_flags |= SA_RESTORER;
- act.sa_restorer = restore_rt;
- act.k_sa_handler = sig_handler;
-#else
struct sigaction act, oact;
memset(&act, 0, sizeof(act));
memset(&oact, 0, sizeof(oact));
act.sa_handler = sig_handler;
-#endif
+
sigset_t set, oset;
int lc;
char *msg;
@@ -111,8 +104,8 @@ int main(int ac, char **av)
"sigaddset call failed");
/* call rt_sigaction() */
- TEST(ltp_syscall(__NR_rt_sigaction, TEST_SIG, &act,
- &oact, SIGSETSIZE));
+ TEST(ltp_rt_sigaction(TEST_SIG, &act, &oact,
+ SIGSETSIZE));
if (TEST_RETURN < 0)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction call failed");
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
index 6ee41d0..5c77648 100644
--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
@@ -70,23 +70,12 @@ int main(int ac, char **av)
if (sigemptyset(&set) < 0)
tst_brkm(TFAIL | TERRNO, cleanup, "sigemptyset failed");
-#ifdef __x86_64__
- struct kernel_sigaction act, oact;
- sig_initial(SIGALRM);
- memset(&act, 0, sizeof(act));
- memset(&oact, 0, sizeof(oact));
- act.sa_flags |= SA_RESTORER;
- act.sa_restorer = restore_rt;
- act.k_sa_handler = sig_handler;
-#else
struct sigaction act, oact;
memset(&act, 0, sizeof(act));
memset(&oact, 0, sizeof(oact));
act.sa_handler = sig_handler;
-#endif
- TEST(ltp_syscall(__NR_rt_sigaction, SIGALRM, &act, &oact,
- SIGSETSIZE));
+ TEST(ltp_rt_sigaction(SIGALRM, &act, &oact, SIGSETSIZE));
if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction failed");
--
1.7.1
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [LTP] [PATCH 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper
2014-05-21 10:24 ` [LTP] [PATCH 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper Stanislav Kholmanskikh
@ 2014-06-04 15:53 ` chrubis
0 siblings, 0 replies; 28+ messages in thread
From: chrubis @ 2014-06-04 15:53 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
Hi!
> diff --git a/include/ltp_signal.h b/include/ltp_signal.h
> index e6fb2e0..31bb0b0 100644
> --- a/include/ltp_signal.h
> +++ b/include/ltp_signal.h
> @@ -55,6 +55,15 @@
>
> #ifdef LTP_RT_SIG_TEST
I know that the code was there allready. However can we split the header
into two and include the second one when needed in tests instead of
defining LTP_RT_SIG_TEST macro?
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 28+ messages in thread
* [LTP] [PATCH 3/3] ltp_rt_sigaction: added SPARC support
2014-05-20 14:42 ` chrubis
2014-05-21 10:24 ` [LTP] [PATCH 1/3] rt_sigaction, rt_sigprocmask, rt_sigsuspend: cleanup Stanislav Kholmanskikh
2014-05-21 10:24 ` [LTP] [PATCH 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper Stanislav Kholmanskikh
@ 2014-05-21 10:24 ` Stanislav Kholmanskikh
2014-05-21 10:31 ` Stanislav Kholmanskikh
2014-06-04 15:49 ` chrubis
2014-06-17 9:08 ` [LTP] [PATCH V2 1/3] rt_sigaction, rt_sigprocmask, rt_sigsuspend: cleanup Stanislav Kholmanskikh
` (2 subsequent siblings)
5 siblings, 2 replies; 28+ messages in thread
From: Stanislav Kholmanskikh @ 2014-05-21 10:24 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Based on patches by Jose E. Marchesi <jose.marchesi@oracle.com>.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
include/ltp_signal.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/include/ltp_signal.h b/include/ltp_signal.h
index 31bb0b0..a60ee7c 100644
--- a/include/ltp_signal.h
+++ b/include/ltp_signal.h
@@ -122,6 +122,46 @@ static inline int sig_initial(int sig)
#endif /* __x86_64__ */
+#ifdef __sparc__
+#if defined __arch64__ || defined __sparcv9
+
+/*
+ * From glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
+ */
+
+static void __rt_sigreturn_stub(void)
+{
+ __asm__ ("mov %0, %%g1\n\t"
+ "ta 0x6d\n\t"
+ : /* no outputs */
+ : "i" (__NR_rt_sigreturn));
+}
+
+#else /* sparc32 */
+
+/*
+ * From glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+ */
+
+static void __rt_sigreturn_stub(void)
+{
+ __asm__ ("mov %0, %%g1\n\t"
+ "ta 0x10\n\t"
+ : /* no outputs */
+ : "i" (__NR_rt_sigreturn));
+}
+
+static void __sigreturn_stub(void)
+{
+ __asm__ ("mov %0, %%g1\n\t"
+ "ta 0x10\n\t"
+ : /* no outputs */
+ : "i" (__NR_sigreturn));
+}
+
+#endif
+#endif /* __sparc__ */
+
/* This is a wrapper for __NR_rt_sigaction syscall.
* act/oact values of INVAL_SA_PTR is used to pass
* an invalid pointer to syscall(__NR_rt_sigaction)
@@ -159,9 +199,28 @@ static int ltp_rt_sigaction(int signum, const struct sigaction *act,
kact.sa_restorer = restore_rt;
#endif
+#ifdef __sparc__
+ unsigned long stub = 0;
+# if defined __arch64__ || defined __sparcv9
+ stub = ((unsigned long) &__rt_sigreturn_stub) - 8;
+# else /* sparc32 */
+ if ((kact.sa_flags & SA_SIGINFO) != 0)
+ stub = ((unsigned long) &__rt_sigreturn_stub) - 8;
+ else
+ stub = ((unsigned long) &__sigreturn_stub) - 8;
+# endif
+#endif
+
+
+#ifdef __sparc__
+ ret = ltp_syscall(__NR_rt_sigaction, signum,
+ kact_p, koact_p,
+ stub, sigsetsize);
+#else
ret = ltp_syscall(__NR_rt_sigaction, signum,
kact_p, koact_p,
sigsetsize);
+#endif
if (ret >= 0) {
if (oact && (oact != INVAL_SA_PTR)) {
--
1.7.1
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [LTP] [PATCH 3/3] ltp_rt_sigaction: added SPARC support
2014-05-21 10:24 ` [LTP] [PATCH 3/3] ltp_rt_sigaction: added SPARC support Stanislav Kholmanskikh
@ 2014-05-21 10:31 ` Stanislav Kholmanskikh
2014-06-04 15:49 ` chrubis
1 sibling, 0 replies; 28+ messages in thread
From: Stanislav Kholmanskikh @ 2014-05-21 10:31 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
On 05/21/2014 02:24 PM, Stanislav Kholmanskikh wrote:
> Based on patches by Jose E. Marchesi <jose.marchesi@oracle.com>.
>
> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Sorry, I forgot to mention why we are doing this in the commit message.
If the patches are ok, I'll add a few strings at the push time.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [LTP] [PATCH 3/3] ltp_rt_sigaction: added SPARC support
2014-05-21 10:24 ` [LTP] [PATCH 3/3] ltp_rt_sigaction: added SPARC support Stanislav Kholmanskikh
2014-05-21 10:31 ` Stanislav Kholmanskikh
@ 2014-06-04 15:49 ` chrubis
1 sibling, 0 replies; 28+ messages in thread
From: chrubis @ 2014-06-04 15:49 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
Hi!
> Based on patches by Jose E. Marchesi <jose.marchesi@oracle.com>.
>
> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
> ---
> include/ltp_signal.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 59 insertions(+), 0 deletions(-)
>
> diff --git a/include/ltp_signal.h b/include/ltp_signal.h
> index 31bb0b0..a60ee7c 100644
> --- a/include/ltp_signal.h
> +++ b/include/ltp_signal.h
> @@ -122,6 +122,46 @@ static inline int sig_initial(int sig)
>
> #endif /* __x86_64__ */
>
> +#ifdef __sparc__
> +#if defined __arch64__ || defined __sparcv9
It's a bit more readable if we indent the innter ifdefs as:
#ifdef __sparc__
# if defined __arch64__ || defined __sparcv9
# endif
#endif /* __sparc__ */
> +/*
> + * From glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
> + */
> +
> +static void __rt_sigreturn_stub(void)
> +{
> + __asm__ ("mov %0, %%g1\n\t"
> + "ta 0x6d\n\t"
> + : /* no outputs */
> + : "i" (__NR_rt_sigreturn));
> +}
> +
> +#else /* sparc32 */
> +
> +/*
> + * From glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
> + */
> +
> +static void __rt_sigreturn_stub(void)
> +{
> + __asm__ ("mov %0, %%g1\n\t"
> + "ta 0x10\n\t"
> + : /* no outputs */
> + : "i" (__NR_rt_sigreturn));
> +}
> +
> +static void __sigreturn_stub(void)
> +{
> + __asm__ ("mov %0, %%g1\n\t"
> + "ta 0x10\n\t"
> + : /* no outputs */
> + : "i" (__NR_sigreturn));
> +}
> +
> +#endif
> +#endif /* __sparc__ */
> +
> /* This is a wrapper for __NR_rt_sigaction syscall.
> * act/oact values of INVAL_SA_PTR is used to pass
> * an invalid pointer to syscall(__NR_rt_sigaction)
> @@ -159,9 +199,28 @@ static int ltp_rt_sigaction(int signum, const struct sigaction *act,
> kact.sa_restorer = restore_rt;
> #endif
>
> +#ifdef __sparc__
> + unsigned long stub = 0;
> +# if defined __arch64__ || defined __sparcv9
> + stub = ((unsigned long) &__rt_sigreturn_stub) - 8;
> +# else /* sparc32 */
> + if ((kact.sa_flags & SA_SIGINFO) != 0)
> + stub = ((unsigned long) &__rt_sigreturn_stub) - 8;
> + else
> + stub = ((unsigned long) &__sigreturn_stub) - 8;
> +# endif
> +#endif
Here they are intended correctly.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 28+ messages in thread
* [LTP] [PATCH V2 1/3] rt_sigaction, rt_sigprocmask, rt_sigsuspend: cleanup
2014-05-20 14:42 ` chrubis
` (2 preceding siblings ...)
2014-05-21 10:24 ` [LTP] [PATCH 3/3] ltp_rt_sigaction: added SPARC support Stanislav Kholmanskikh
@ 2014-06-17 9:08 ` Stanislav Kholmanskikh
2014-06-17 9:08 ` [LTP] [PATCH V2 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper Stanislav Kholmanskikh
2014-06-17 9:08 ` [LTP] [PATCH V2 3/3] ltp_rt_sigaction.h: added SPARC support Stanislav Kholmanskikh
5 siblings, 0 replies; 28+ messages in thread
From: Stanislav Kholmanskikh @ 2014-06-17 9:08 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
No changes since V1.
.../kernel/syscalls/rt_sigaction/rt_sigaction01.c | 88 +++-----------
.../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 85 +++-----------
.../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 105 ++++-------------
.../syscalls/rt_sigprocmask/rt_sigprocmask01.c | 112 +++++-------------
.../syscalls/rt_sigprocmask/rt_sigprocmask02.c | 89 +++------------
.../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 125 +++++--------------
6 files changed, 132 insertions(+), 472 deletions(-)
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
index fda733c..fb698f8 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
@@ -12,36 +12,22 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigaction01.c */
-/* */
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction alters an action taken by a process on receipt */
/* of a particular signal. The action is specified by the */
/* sigaction structure. The previous action on the signal is */
/* saved in oact.sigsetsize should indicate the size of a */
/* sigset_t type. */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigaction01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigaction01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -57,75 +43,35 @@
#include "ltp_signal.h"
char *TCID = "rt_sigaction01";
-int testno;
+static int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int test_flags[] =
+static int test_flags[] =
{ SA_RESETHAND | SA_SIGINFO, SA_RESETHAND, SA_RESETHAND | SA_SIGINFO,
SA_RESETHAND | SA_SIGINFO, SA_NOMASK };
char *test_flags_list[] =
{ "SA_RESETHAND|SA_SIGINFO", "SA_RESETHAND", "SA_RESETHAND|SA_SIGINFO",
"SA_RESETHAND|SA_SIGINFO", "SA_NOMASK" };
-void handler(int sig)
+static void handler(int sig)
{
tst_resm(TINFO, "Signal Handler Called with signal number %d\n", sig);
return;
}
-int set_handler(int sig, int sig_to_mask, int mask_flags)
+static int set_handler(int sig, int sig_to_mask, int mask_flags)
{
#ifdef __x86_64__
struct kernel_sigaction sa, oldaction;
@@ -141,18 +87,18 @@ int set_handler(int sig, int sig_to_mask, int mask_flags)
sigaddset(&sa.sa_mask, sig);
return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction, SIGSETSIZE);
-
}
int main(int ac, char **av)
{
- int signal, flag;
+ unsigned int flag;
+ int signal;
int lc;
const char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
@@ -162,7 +108,7 @@ int main(int ac, char **av)
for (testno = 0; testno < TST_TOTAL; ++testno) {
- for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) { //signal for 34 to 65
+ for (signal = SIGRTMIN; signal <= SIGRTMAX; signal++) {
#ifdef __x86_64__
sig_initial(signal);
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
index bf0605c..8cf0f14 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
@@ -12,32 +12,18 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigaction02.c */
-/* */
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction Expected EFAULT error check */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigaction02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigaction02 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -54,70 +40,31 @@
#define INVAL_STRUCT -1
char *TCID = "rt_sigaction02";
-int testno;
+static int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
tst_exit();
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int test_flags[] =
+static int test_flags[] =
{ SA_RESETHAND | SA_SIGINFO, SA_RESETHAND, SA_RESETHAND | SA_SIGINFO,
SA_RESETHAND | SA_SIGINFO, SA_NOMASK };
char *test_flags_list[] =
{ "SA_RESETHAND|SA_SIGINFO", "SA_RESETHAND", "SA_RESETHAND|SA_SIGINFO",
"SA_RESETHAND|SA_SIGINFO", "SA_NOMASK" };
-struct test_case_t {
+static struct test_case_t {
int exp_errno;
char *errdesc;
} test_cases[] = {
@@ -127,23 +74,24 @@ struct test_case_t {
int main(int ac, char **av)
{
- int signal, flag;
+ unsigned int flag;
+ int signal;
int lc;
const char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
for (lc = 0; TEST_LOOPING(lc); ++lc) {
tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
+ for (signal = SIGRTMIN; signal <= SIGRTMAX; signal++) {
+ tst_resm(TINFO, "Signal %d", signal);
- for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) { //signal for 34 to 65
- for (flag = 0; flag < 5; flag++) {
+ for (flag = 0; flag < (sizeof(test_flags) / sizeof(test_flags[0])); flag++) {
/* *
* long sys_rt_sigaction (int sig, const struct sigaction *act, *
@@ -178,7 +126,6 @@ int main(int ac, char **av)
test_flags_list[flag]);
}
}
- printf("\n");
}
}
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
index 4111da9..9ae8d0e 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
@@ -12,32 +12,18 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigaction03.c */
-/* */
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction Expected EINVAL error check */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigaction03 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigaction03 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -54,70 +40,29 @@
#define INVAL_SIGSETSIZE -1
char *TCID = "rt_sigaction03";
-int testno;
+static int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
- tst_exit();
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int test_flags[] =
+static int test_flags[] =
{ SA_RESETHAND | SA_SIGINFO, SA_RESETHAND, SA_RESETHAND | SA_SIGINFO,
SA_RESETHAND | SA_SIGINFO, SA_NOMASK };
char *test_flags_list[] =
{ "SA_RESETHAND|SA_SIGINFO", "SA_RESETHAND", "SA_RESETHAND|SA_SIGINFO",
"SA_RESETHAND|SA_SIGINFO", "SA_NOMASK" };
-struct test_case_t {
+static struct test_case_t {
int exp_errno;
char *errdesc;
} test_cases[] = {
@@ -125,13 +70,13 @@ struct test_case_t {
EINVAL, "EINVAL"}
};
-void handler(int sig)
+static void handler(int sig)
{
tst_resm(TINFO, "Signal Handler Called with signal number %d\n", sig);
return;
}
-int set_handler(int sig, int sig_to_mask, int mask_flags)
+static int set_handler(int sig, int sig_to_mask, int mask_flags)
{
struct sigaction sa, oldaction;
@@ -147,25 +92,20 @@ int set_handler(int sig, int sig_to_mask, int mask_flags)
* sigsetsize was not equivalent to the size of a sigset_t type *
*/
- TEST(ltp_syscall
- (__NR_rt_sigaction, sig, &sa, &oldaction, INVAL_SIGSETSIZE));
- if (TEST_RETURN == 0) {
- return 0;
- } else {
- return TEST_RETURN;
- }
+ return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction,
+ INVAL_SIGSETSIZE);
}
int main(int ac, char **av)
{
- int signal, flag;
+ unsigned int flag;
+ int signal;
int lc;
const char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
@@ -173,8 +113,10 @@ int main(int ac, char **av)
tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
- for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) { //signal for 34 to 65
- for (flag = 0; flag < 5; flag++) {
+ for (signal = SIGRTMIN; signal <= (SIGRTMAX); signal++) {
+ tst_resm(TINFO, "Signal %d", signal);
+
+ for (flag = 0; flag < (sizeof(test_flags) / sizeof(test_flags[0])); flag++) {
TEST(set_handler
(signal, 0, test_flags[flag]));
if ((TEST_RETURN == -1)
@@ -200,7 +142,6 @@ int main(int ac, char **av)
test_flags_list[flag]);
}
}
- printf("\n");
}
}
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
index 2d13212..bdfa6dd 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
@@ -12,14 +12,14 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 59 Temple Place, Suite TEST_SIG0, Boston, MA 02111-1307 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 59 Temple Place, Suite TEST_SIG0, Boston, MA 02111-1307 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak <maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigprocmask01.c */
-/* */
/* Description: This tests the rt_sigprocmask() syscall */
/* rt_sigprocmask changes the list of currently blocked signals. */
/* The set value stores the signal mask of the pending signals. */
@@ -37,22 +37,8 @@
/* SIG_SETMASK */
/* The set of blocked signals is set to the set argument. */
/* sigsetsize should indicate the size of a sigset_t type. */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigprocmask01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigprocmask01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak <maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <signal.h>
#include <errno.h>
@@ -64,65 +50,25 @@
#include "ltp_signal.h"
char *TCID = "rt_sigprocmask01";
-int testno;
+static int testno;
int TST_TOTAL = 8;
+static int sig_count;
+
#define TEST_SIG SIGRTMIN+1
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-int sig_count = 0;
-
void sig_handler(int sig)
{
sig_count++;
@@ -146,9 +92,9 @@ int main(int ac, char **av)
int lc;
const char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
@@ -156,35 +102,34 @@ int main(int ac, char **av)
tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
- if (sigemptyset(&set) < 0) {
+ if (sigemptyset(&set) < 0)
tst_brkm(TFAIL | TERRNO, cleanup,
"sigemptyset call failed");
- }
- if (sigaddset(&set, TEST_SIG) < 0) {
+
+ if (sigaddset(&set, TEST_SIG) < 0)
tst_brkm(TFAIL | TERRNO, cleanup,
"sigaddset call failed");
- }
/* call rt_sigaction() */
TEST(ltp_syscall(__NR_rt_sigaction, TEST_SIG, &act,
&oact, SIGSETSIZE));
- if (TEST_RETURN < 0) {
+ if (TEST_RETURN < 0)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction call failed");
- }
+
/* call rt_sigprocmask() to block signal#TEST_SIG */
TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_BLOCK, &set,
&oset, SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigprocmask call failed");
- }
+
/* Make sure that the masked process is indeed
* masked. */
- if (kill(getpid(), TEST_SIG) < 0) {
+ if (kill(getpid(), TEST_SIG) < 0)
tst_brkm(TFAIL | TERRNO, cleanup,
"call to kill() failed");
- }
+
if (sig_count) {
tst_brkm(TFAIL | TERRNO, cleanup,
"rt_sigprocmask() failed to change "
@@ -193,26 +138,26 @@ int main(int ac, char **av)
/* call rt_sigpending() */
TEST(ltp_syscall(__NR_rt_sigpending, &oset,
SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigpending call failed");
- }
+
TEST(sigismember(&oset, TEST_SIG));
- if (TEST_RETURN == 0) {
+ if (TEST_RETURN == 0)
tst_brkm(TFAIL | TTERRNO,
cleanup,
"sigismember call failed");
- }
+
/* call rt_sigprocmask() to unblock
* signal#TEST_SIG */
TEST(ltp_syscall(__NR_rt_sigprocmask,
SIG_UNBLOCK, &set, &oset,
SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO,
cleanup,
"rt_sigprocmask call failed");
- }
+
if (sig_count) {
tst_resm(TPASS,
"rt_sigprocmask "
@@ -224,7 +169,6 @@ int main(int ac, char **av)
"rt_sigprocmask "
"functionality failed");
}
-
}
}
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
index d1d5a9d..ef8f954 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c
@@ -12,14 +12,14 @@
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
/******************************************************************************/
-/* */
-/* File: rt_sigprocmask02.c */
-/* */
/* Description: This tests the rt_sigprocmask() syscall */
/* rt_sigprocmask changes the list of currently blocked signals. */
/* The set value stores the signal mask of the pending signals. */
@@ -49,23 +49,8 @@
/* invalid. */
/* -EFAULT */
/* An invalid set, act, or oact was specified. */
-/* */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigprocmask02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 1 */
-/* */
-/* Test Name: rt_sigprocmask02 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
+
#include <stdio.h>
#include <signal.h>
#include <errno.h>
@@ -78,61 +63,21 @@
char *TCID = "rt_sigprocmask02";
int TST_TOTAL = 2;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-sigset_t set;
+static sigset_t set;
-struct test_case_t {
+static struct test_case_t {
sigset_t *ss;
int sssize;
int exp_errno;
@@ -150,21 +95,18 @@ int main(int ac, char **av)
sigset_t s;
const char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- tst_exit();
- }
setup();
tst_count = 0;
TEST(sigfillset(&s));
- if (TEST_RETURN == -1) {
- tst_resm(TFAIL | TTERRNO, "Call to sigfillset() failed.");
- cleanup();
- tst_exit();
- }
+ if (TEST_RETURN == -1)
+ tst_brkm(TFAIL | TTERRNO, cleanup,
+ "Call to sigfillset() failed.");
for (i = 0; i < test_count; i++) {
TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_BLOCK,
@@ -183,5 +125,4 @@ int main(int ac, char **av)
cleanup();
tst_exit();
-
}
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
index b27e9c6..f0fc96f 100644
--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
@@ -1,42 +1,27 @@
-/********************************************************************************/
-/* Copyright (c) Crackerjack Project., 2007 */
-/* */
-/* This program is free software; you can redistribute it and/or modify */
-/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation; either version 2 of the License, or */
-/* (at your option) any later version. */
-/* */
-/* This program is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
-/* the GNU General Public License for more details. */
-/* */
-/* You should have received a copy of the GNU General Public License */
-/* along with this program; if not, write to the Free Software */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
-/* */
-/****************************************************************************** */
-/****************************************************************************** */
-/* */
-/* File: rt_sigsuspend01.c */
-/* */
-/* Description: This tests the rt_sigsuspend() syscall. */
-/* */
-/* Usage: <for command-line> */
-/* rt_sigsuspend01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */
-/* where, -c n : Run n copies concurrently. */
-/* -e : Turn on errno logging. */
-/* -i n : Execute test n times. */
-/* -I x : Execute test for x seconds. */
-/* -P x : Pause for x seconds between iterations. */
-/* -t : Turn on syscall timing. */
-/* */
-/* Total Tests: 2 */
-/* */
-/* Test Name: rt_sigsuspend01 */
-/* History: Porting from Crackerjack to LTP is done by */
-/* Manas Kumar Nayak maknayak@in.ibm.com> */
-/********************************************************************************/
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007 */
+/* */
+/* This program is free software; you can redistribute it and/or modify */
+/* it under the terms of the GNU General Public License as published by */
+/* the Free Software Foundation; either version 2 of the License, or */
+/* (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
+/* the GNU General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
+/* */
+/* History: Porting from Crackerjack to LTP is done by */
+/* Manas Kumar Nayak maknayak@in.ibm.com> */
+/******************************************************************************/
+
+/******************************************************************************/
+/* Description: This tests the rt_sigsuspend() syscall. */
+/******************************************************************************/
#include <stdio.h>
#include <signal.h>
@@ -49,75 +34,33 @@
#include "ltp_signal.h"
char *TCID = "rt_sigsuspend01";
-int testno;
int TST_TOTAL = 1;
-/* Extern Global Functions */
-/******************************************************************************/
-/* */
-/* Function: cleanup */
-/* */
-/* Description: Performs all one time clean up for this test on successful */
-/* completion, premature exit or failure. Closes all temporary */
-/* files, removes all temporary directories exits the test with */
-/* appropriate return code by calling tst_exit() function. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */
-/* On success - Exits calling tst_exit(). With '0' return code. */
-/* */
-/******************************************************************************/
-void cleanup(void)
+static void cleanup(void)
{
-
TEST_CLEANUP;
tst_rmdir();
-
}
-/* Local Functions */
-/******************************************************************************/
-/* */
-/* Function: setup */
-/* */
-/* Description: Performs all one time setup for this test. This function is */
-/* typically used to capture signals, create temporary dirs */
-/* and temporary files that may be used in the course of this */
-/* test. */
-/* */
-/* Input: None. */
-/* */
-/* Output: None. */
-/* */
-/* Return: On failure - Exits by calling cleanup(). */
-/* On success - returns 0. */
-/* */
-/******************************************************************************/
-void setup(void)
+static void setup(void)
{
- /* Capture signals if any */
- /* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
}
-void sig_handler(int sig)
+static void sig_handler(int sig)
{
}
int main(int ac, char **av)
{
-
sigset_t set, set1, set2;
int lc;
const char *msg;
- if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+ msg = parse_opts(ac, av, NULL, NULL);
+ if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
- }
setup();
@@ -125,9 +68,8 @@ int main(int ac, char **av)
tst_count = 0;
- if (sigemptyset(&set) < 0) {
+ if (sigemptyset(&set) < 0)
tst_brkm(TFAIL | TERRNO, cleanup, "sigemptyset failed");
- }
#ifdef __x86_64__
struct kernel_sigaction act, oact;
sig_initial(SIGALRM);
@@ -145,16 +87,15 @@ int main(int ac, char **av)
TEST(ltp_syscall(__NR_rt_sigaction, SIGALRM, &act, &oact,
SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction failed");
- }
+
TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_UNBLOCK, 0,
&set1, SIGSETSIZE));
- if (TEST_RETURN == -1) {
+ if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigprocmask failed");
- }
TEST(alarm(5));
int result;
--
1.7.1
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 28+ messages in thread* [LTP] [PATCH V2 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper
2014-05-20 14:42 ` chrubis
` (3 preceding siblings ...)
2014-06-17 9:08 ` [LTP] [PATCH V2 1/3] rt_sigaction, rt_sigprocmask, rt_sigsuspend: cleanup Stanislav Kholmanskikh
@ 2014-06-17 9:08 ` Stanislav Kholmanskikh
2014-06-17 9:08 ` [LTP] [PATCH V2 3/3] ltp_rt_sigaction.h: added SPARC support Stanislav Kholmanskikh
5 siblings, 0 replies; 28+ messages in thread
From: Stanislav Kholmanskikh @ 2014-06-17 9:08 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
These testcases use many pieces of duplicated code to test
syscall(__NR_rt_sigaction). Thus it's not beautiful to add support
for other architectures there.
To overcome this I:
* moved everything inside '#ifdef LTP_RT_SIG_TEST' to a separate
header file - 'include/lapi/rt_sigaction.h'
So if we need to test the rt_sigaction syscall, we include 'lapi/sigaction.h',
otherwise - include 'ltp_signal.h'.
* moved struct kernel_sigaction out of '#ifdef __x86_64__', because
it is not specific only for x86_64
* implemented a wrapper for the rt_sigaction syscall and put it
into 'include/lapi/rt_sigaction.h'
* modified the above test cases to use this wrapper
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
Changes since V1:
* Splitted include/ltp_signal.h into two headers
include/lapi/rt_sigaction.h | 154 ++++++++++++++++++++
include/ltp_signal.h | 69 ---------
.../kernel/syscalls/rt_sigaction/rt_sigaction01.c | 18 +--
.../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 9 +-
.../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 5 +-
.../syscalls/rt_sigprocmask/rt_sigprocmask01.c | 16 +--
.../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 16 +--
7 files changed, 168 insertions(+), 119 deletions(-)
create mode 100644 include/lapi/rt_sigaction.h
diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
new file mode 100644
index 0000000..efe7f69
--- /dev/null
+++ b/include/lapi/rt_sigaction.h
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2009 Cisco Systems, Inc. All Rights Reserved.
+ * Copyright (c) 2009 FUJITSU LIMITED. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Author: Liu Bo <liubo2009@cn.fujitsu.com>
+ * Author: Garrett Cooper <yanegomi@gmail.com>
+ *
+ */
+
+#ifndef LTP_RT_SIGACTION_H
+#define LTP_RT_SIGACTION_H
+
+#include "ltp_signal.h"
+
+#define INVAL_SA_PTR ((void *)-1)
+
+struct kernel_sigaction {
+ __sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer) (void);
+ sigset_t sa_mask;
+};
+
+#ifdef __x86_64__
+
+/*
+ * From asm/signal.h -- this value isn't exported anywhere outside of glibc and
+ * asm/signal.h and is only required for the rt_sig* function family because
+ * sigaction(2), et all, appends this if necessary to
+ * (struct sigaction).sa_flags. HEH.
+ *
+ * I do #undef though, just in case...
+ *
+ * Also, from .../arch/x86/kernel/signal.c:448 for v2.6.30 (something or
+ * other):
+ *
+ * x86-64 should always use SA_RESTORER.
+ *
+ * -- thus SA_RESTORER must always be defined along with
+ * (struct sigaction).sa_restorer for this architecture.
+ */
+#undef SA_RESTORER
+#define HAVE_SA_RESTORER
+#define SA_RESTORER 0x04000000
+
+void (*restore_rt)(void);
+
+static void handler_h(int signal)
+{
+ return;
+}
+
+/* Setup an initial signal handler for signal number = sig for x86_64. */
+static inline int sig_initial(int sig)
+{
+ int ret_code = -1;
+ struct sigaction act, oact;
+
+ act.sa_handler = handler_h;
+ act.sa_flags = 0;
+ /* Clear out the signal set. */
+ if (sigemptyset(&act.sa_mask) < 0) {
+ /* Add the signal to the mask set. */
+ } else if (sigaddset(&act.sa_mask, sig) < 0) {
+ /* Set act.sa_restorer via syscall(2) */
+ } else if (sigaction(sig, &act, &oact) < 0) {
+ /* Copy oact.sa_restorer via syscall(2) */
+ } else if (sigaction(sig, &act, &oact) < 0) {
+ /* And voila -- we just tricked the kernel into giving us our
+ * restorer function! */
+ } else {
+ restore_rt = oact.sa_restorer;
+ ret_code = 0;
+ }
+
+ return ret_code;
+}
+
+#endif /* __x86_64__ */
+
+/* This is a wrapper for __NR_rt_sigaction syscall.
+ * act/oact values of INVAL_SA_PTR is used to pass
+ * an invalid pointer to syscall(__NR_rt_sigaction)
+ *
+ * Based on glibc/sysdeps/unix/sysv/linux/{...}/sigaction.c
+ */
+
+static int ltp_rt_sigaction(int signum, const struct sigaction *act,
+ struct sigaction *oact, size_t sigsetsize)
+{
+ int ret;
+ struct kernel_sigaction kact, koact;
+ struct kernel_sigaction *kact_p = NULL;
+ struct kernel_sigaction *koact_p = NULL;
+
+ if (act == INVAL_SA_PTR) {
+ kact_p = INVAL_SA_PTR;
+ } else if (act) {
+ kact.k_sa_handler = act->sa_handler;
+ memcpy(&kact.sa_mask, &act->sa_mask, sizeof(sigset_t));
+ kact.sa_flags = act->sa_flags;
+ kact.sa_restorer = NULL;
+
+ kact_p = &kact;
+ }
+
+ if (oact == INVAL_SA_PTR)
+ koact_p = INVAL_SA_PTR;
+ else if (oact)
+ koact_p = &koact;
+
+#ifdef __x86_64__
+ sig_initial(signum);
+ kact.sa_flags |= SA_RESTORER;
+ kact.sa_restorer = restore_rt;
+#endif
+
+ ret = ltp_syscall(__NR_rt_sigaction, signum,
+ kact_p, koact_p,
+ sigsetsize);
+
+ if (ret >= 0) {
+ if (oact && (oact != INVAL_SA_PTR)) {
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy(&oact->sa_mask, &koact.sa_mask,
+ sizeof(sigset_t));
+ oact->sa_flags = koact.sa_flags;
+ oact->sa_restorer = koact.sa_restorer;
+ }
+ }
+
+ return ret;
+}
+
+#endif /* LTP_RT_SIGACTION_H */
diff --git a/include/ltp_signal.h b/include/ltp_signal.h
index e6fb2e0..294007b 100644
--- a/include/ltp_signal.h
+++ b/include/ltp_signal.h
@@ -53,73 +53,4 @@
#define SIGSETSIZE (_NSIG / 8)
#endif
-#ifdef LTP_RT_SIG_TEST
-
-#ifdef __x86_64__
-
-/*
- * From asm/signal.h -- this value isn't exported anywhere outside of glibc and
- * asm/signal.h and is only required for the rt_sig* function family because
- * sigaction(2), et all, appends this if necessary to
- * (struct sigaction).sa_flags. HEH.
- *
- * I do #undef though, just in case...
- *
- * Also, from .../arch/x86/kernel/signal.c:448 for v2.6.30 (something or
- * other):
- *
- * x86-64 should always use SA_RESTORER.
- *
- * -- thus SA_RESTORER must always be defined along with
- * (struct sigaction).sa_restorer for this architecture.
- */
-#undef SA_RESTORER
-#define HAVE_SA_RESTORER
-#define SA_RESTORER 0x04000000
-
-struct kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_flags;
- void (*sa_restorer) (void);
- sigset_t sa_mask;
-};
-
-void (*restore_rt)(void);
-
-static void handler_h(int signal)
-{
- return;
-}
-
-/* Setup an initial signal handler for signal number = sig for x86_64. */
-static inline int sig_initial(int sig)
-{
- int ret_code = -1;
- struct sigaction act, oact;
-
- act.sa_handler = handler_h;
- act.sa_flags = 0;
- /* Clear out the signal set. */
- if (sigemptyset(&act.sa_mask) < 0) {
- /* Add the signal to the mask set. */
- } else if (sigaddset(&act.sa_mask, sig) < 0) {
- /* Set act.sa_restorer via syscall(2) */
- } else if (sigaction(sig, &act, &oact) < 0) {
- /* Copy oact.sa_restorer via syscall(2) */
- } else if (sigaction(sig, &act, &oact) < 0) {
- /* And voila -- we just tricked the kernel into giving us our
- * restorer function! */
- } else {
- restore_rt = oact.sa_restorer;
- ret_code = 0;
- }
-
- return ret_code;
-
-}
-
-#endif /* __x86_64__ */
-
-#endif /* LTP_RT_SIG_TEST */
-
#endif
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
index fb698f8..396f798 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
@@ -36,11 +36,10 @@
#include <sys/syscall.h>
#include <string.h>
-#define LTP_RT_SIG_TEST
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
-#include "ltp_signal.h"
+#include "lapi/rt_sigaction.h"
char *TCID = "rt_sigaction01";
static int testno;
@@ -73,20 +72,14 @@ static void handler(int sig)
static int set_handler(int sig, int sig_to_mask, int mask_flags)
{
-#ifdef __x86_64__
- struct kernel_sigaction sa, oldaction;
- mask_flags |= SA_RESTORER;
- sa.sa_restorer = restore_rt;
- sa.k_sa_handler = (void *)handler;
-#else
struct sigaction sa, oldaction;
+
sa.sa_handler = (void *)handler;
-#endif
sa.sa_flags = mask_flags;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, sig);
- return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction, SIGSETSIZE);
+ return ltp_rt_sigaction(sig, &sa, &oldaction, SIGSETSIZE);
}
int main(int ac, char **av)
@@ -109,11 +102,6 @@ int main(int ac, char **av)
for (testno = 0; testno < TST_TOTAL; ++testno) {
for (signal = SIGRTMIN; signal <= SIGRTMAX; signal++) {
-
-#ifdef __x86_64__
- sig_initial(signal);
-#endif
-
for (flag = 0;
flag <
(sizeof(test_flags) /
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
index 8cf0f14..5989657 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
@@ -35,9 +35,7 @@
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
-#include "ltp_signal.h"
-
-#define INVAL_STRUCT -1
+#include "lapi/rt_sigaction.h"
char *TCID = "rt_sigaction02";
static int testno;
@@ -100,9 +98,8 @@ int main(int ac, char **av)
* An invalid act or oact value was specified *
*/
- TEST(ltp_syscall
- (__NR_rt_sigaction, signal,
- INVAL_STRUCT, NULL, SIGSETSIZE));
+ TEST(ltp_rt_sigaction(signal,
+ INVAL_SA_PTR, NULL, SIGSETSIZE));
if ((TEST_RETURN == -1)
&& (TEST_ERRNO ==
test_cases[0].exp_errno)) {
diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
index 9ae8d0e..1b1554a 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
@@ -35,7 +35,7 @@
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
-#include "ltp_signal.h"
+#include "lapi/rt_sigaction.h"
#define INVAL_SIGSETSIZE -1
@@ -92,8 +92,7 @@ static int set_handler(int sig, int sig_to_mask, int mask_flags)
* sigsetsize was not equivalent to the size of a sigset_t type *
*/
- return ltp_syscall(__NR_rt_sigaction, sig, &sa, &oldaction,
- INVAL_SIGSETSIZE);
+ return ltp_rt_sigaction(sig, &sa, &oldaction, INVAL_SIGSETSIZE);
}
int main(int ac, char **av)
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
index bdfa6dd..035ecdb 100644
--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
@@ -46,8 +46,7 @@
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
-#define LTP_RT_SIG_TEST
-#include "ltp_signal.h"
+#include "lapi/rt_sigaction.h"
char *TCID = "rt_sigprocmask01";
static int testno;
@@ -76,18 +75,11 @@ void sig_handler(int sig)
int main(int ac, char **av)
{
-#if __x86_64
- struct kernel_sigaction act, oact;
- sig_initial(TEST_SIG);
- act.sa_flags |= SA_RESTORER;
- act.sa_restorer = restore_rt;
- act.k_sa_handler = sig_handler;
-#else
struct sigaction act, oact;
memset(&act, 0, sizeof(act));
memset(&oact, 0, sizeof(oact));
act.sa_handler = sig_handler;
-#endif
+
sigset_t set, oset;
int lc;
const char *msg;
@@ -111,8 +103,8 @@ int main(int ac, char **av)
"sigaddset call failed");
/* call rt_sigaction() */
- TEST(ltp_syscall(__NR_rt_sigaction, TEST_SIG, &act,
- &oact, SIGSETSIZE));
+ TEST(ltp_rt_sigaction(TEST_SIG, &act, &oact,
+ SIGSETSIZE));
if (TEST_RETURN < 0)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction call failed");
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
index f0fc96f..edcb4a8 100644
--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
@@ -30,8 +30,7 @@
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
-#define LTP_RT_SIG_TEST
-#include "ltp_signal.h"
+#include "lapi/rt_sigaction.h"
char *TCID = "rt_sigsuspend01";
int TST_TOTAL = 1;
@@ -70,23 +69,12 @@ int main(int ac, char **av)
if (sigemptyset(&set) < 0)
tst_brkm(TFAIL | TERRNO, cleanup, "sigemptyset failed");
-#ifdef __x86_64__
- struct kernel_sigaction act, oact;
- sig_initial(SIGALRM);
- memset(&act, 0, sizeof(act));
- memset(&oact, 0, sizeof(oact));
- act.sa_flags |= SA_RESTORER;
- act.sa_restorer = restore_rt;
- act.k_sa_handler = sig_handler;
-#else
struct sigaction act, oact;
memset(&act, 0, sizeof(act));
memset(&oact, 0, sizeof(oact));
act.sa_handler = sig_handler;
-#endif
- TEST(ltp_syscall(__NR_rt_sigaction, SIGALRM, &act, &oact,
- SIGSETSIZE));
+ TEST(ltp_rt_sigaction(SIGALRM, &act, &oact, SIGSETSIZE));
if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, cleanup,
"rt_sigaction failed");
--
1.7.1
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 28+ messages in thread* [LTP] [PATCH V2 3/3] ltp_rt_sigaction.h: added SPARC support
2014-05-20 14:42 ` chrubis
` (4 preceding siblings ...)
2014-06-17 9:08 ` [LTP] [PATCH V2 2/3] rt_sigaction, rt_sigprocmask01, rt_sigsuspend: use rt_sigaction wrapper Stanislav Kholmanskikh
@ 2014-06-17 9:08 ` Stanislav Kholmanskikh
2014-06-23 15:21 ` chrubis
2014-08-11 15:04 ` chrubis
5 siblings, 2 replies; 28+ messages in thread
From: Stanislav Kholmanskikh @ 2014-06-17 9:08 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
syscall(__NR_rt_sigaction) on SPARC requires more arguments, than
it does in x86_64 environment.
Therefore to make ltp_rt_sigaction() work on SPARC, we modify it
the same way as it's done in glibc, i.e. by hiding the additional
argument - the stub - inside the wrapper.
Based on patches by Jose E. Marchesi <jose.marchesi@oracle.com>.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
Changes since V1:
* Added indentions to ifdefs
* Added a more detailed description message
include/lapi/rt_sigaction.h | 59 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
index efe7f69..9ea5e0f 100644
--- a/include/lapi/rt_sigaction.h
+++ b/include/lapi/rt_sigaction.h
@@ -97,6 +97,46 @@ static inline int sig_initial(int sig)
#endif /* __x86_64__ */
+#ifdef __sparc__
+# if defined __arch64__ || defined __sparcv9
+
+/*
+ * From glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
+ */
+
+static void __rt_sigreturn_stub(void)
+{
+ __asm__ ("mov %0, %%g1\n\t"
+ "ta 0x6d\n\t"
+ : /* no outputs */
+ : "i" (__NR_rt_sigreturn));
+}
+
+# else /* sparc32 */
+
+/*
+ * From glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+ */
+
+static void __rt_sigreturn_stub(void)
+{
+ __asm__ ("mov %0, %%g1\n\t"
+ "ta 0x10\n\t"
+ : /* no outputs */
+ : "i" (__NR_rt_sigreturn));
+}
+
+static void __sigreturn_stub(void)
+{
+ __asm__ ("mov %0, %%g1\n\t"
+ "ta 0x10\n\t"
+ : /* no outputs */
+ : "i" (__NR_sigreturn));
+}
+
+# endif
+#endif /* __sparc__ */
+
/* This is a wrapper for __NR_rt_sigaction syscall.
* act/oact values of INVAL_SA_PTR is used to pass
* an invalid pointer to syscall(__NR_rt_sigaction)
@@ -134,9 +174,28 @@ static int ltp_rt_sigaction(int signum, const struct sigaction *act,
kact.sa_restorer = restore_rt;
#endif
+#ifdef __sparc__
+ unsigned long stub = 0;
+# if defined __arch64__ || defined __sparcv9
+ stub = ((unsigned long) &__rt_sigreturn_stub) - 8;
+# else /* sparc32 */
+ if ((kact.sa_flags & SA_SIGINFO) != 0)
+ stub = ((unsigned long) &__rt_sigreturn_stub) - 8;
+ else
+ stub = ((unsigned long) &__sigreturn_stub) - 8;
+# endif
+#endif
+
+
+#ifdef __sparc__
+ ret = ltp_syscall(__NR_rt_sigaction, signum,
+ kact_p, koact_p,
+ stub, sigsetsize);
+#else
ret = ltp_syscall(__NR_rt_sigaction, signum,
kact_p, koact_p,
sigsetsize);
+#endif
if (ret >= 0) {
if (oact && (oact != INVAL_SA_PTR)) {
--
1.7.1
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [LTP] [PATCH V2 3/3] ltp_rt_sigaction.h: added SPARC support
2014-06-17 9:08 ` [LTP] [PATCH V2 3/3] ltp_rt_sigaction.h: added SPARC support Stanislav Kholmanskikh
@ 2014-06-23 15:21 ` chrubis
2014-08-11 15:04 ` chrubis
1 sibling, 0 replies; 28+ messages in thread
From: chrubis @ 2014-06-23 15:21 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
Hi!
Whole patchset looks good to me, acked.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [LTP] [PATCH V2 3/3] ltp_rt_sigaction.h: added SPARC support
2014-06-17 9:08 ` [LTP] [PATCH V2 3/3] ltp_rt_sigaction.h: added SPARC support Stanislav Kholmanskikh
2014-06-23 15:21 ` chrubis
@ 2014-08-11 15:04 ` chrubis
[not found] ` <53E9C7B8.1040504@oracle.com>
1 sibling, 1 reply; 28+ messages in thread
From: chrubis @ 2014-08-11 15:04 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list
Hi!
I've started to prepare for release and tried to build LTP on as much
arch/distro combination I could, for ia64 the rt_sigaction fails with:
In file included from rt_sigaction01.c:42:
[ 349s] ../../../../include/lapi/rt_sigaction.h: In function
'ltp_rt_sigaction':
[ 349s] ../../../../include/lapi/rt_sigaction.h:206: error: 'struct
sigaction' has no member named 'sa_restorer'
[ 349s] rt_sigaction01.c: In function 'set_handler':
[ 349s] rt_sigaction01.c:73: warning: unused parameter 'sig_to_mask'
[ 349s] make[4]: *** [rt_sigaction01] Error 1
[ 349s] make[4]: Leaving directory
`/usr/src/packages/BUILD/ltp-full-git/testcases/kernel/syscalls/rt_sigaction'
[ 349s] make[3]: *** [all] Error 2
[ 349s] make[3]: Leaving directory
`/usr/src/packages/BUILD/ltp-full-git/testcases/kernel/syscalls'
[ 349s] make[2]: *** [all] Error 2
[ 349s] make[2]: Leaving directory
`/usr/src/packages/BUILD/ltp-full-git/testcases/kernel'
[ 349s] make[1]: *** [all] Error 2
[ 349s] make[1]: Leaving directory
`/usr/src/packages/BUILD/ltp-full-git/testcases'
[ 349s] make: *** [testcases-all] Error 2
[ 349s] error: Bad exit status from /var/tmp/rpm-tmp.20244 (%build)
Looking into glibc they have #ifdef HAVE_SA_RESTORER around code that
accesses the field. I guess that we have to add corresponding configure
check and ifdef too...
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 28+ messages in thread