1 : /*
2 : * This file is part of MIN Test Framework. Copyright © 2008 Nokia Corporation
3 : * and/or its subsidiary(-ies).
4 : * Contact: Konrad Marek Zapalowicz
5 : * Contact e-mail: DG.MIN-Support@nokia.com
6 : *
7 : * This program is free software: you can redistribute it and/or modify it
8 : * under the terms of the GNU General Public License as published by the Free
9 : * Software Foundation, version 2 of the License.
10 : *
11 : * This program is distributed in the hope that it will be useful, but WITHOUT
12 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 : * more details. You should have received a copy of the GNU General Public
15 : * License along with this program. If not, see
16 : * <http://www.gnu.org/licenses/>.
17 : */
18 :
19 :
20 : /**
21 : * @file combined_test_process.c
22 : * @version 0.1
23 : * @brief This file contains implementation of Combined Test Process.
24 : */
25 :
26 : /* ------------------------------------------------------------------------- */
27 : /* INCLUDE FILES */
28 : #include "combined_test_process.h"
29 :
30 : /* ------------------------------------------------------------------------- */
31 : /* EXTERNAL DATA STRUCTURES */
32 : /* None */
33 :
34 : /* ------------------------------------------------------------------------- */
35 : /* EXTERNAL GLOBAL VARIABLES */
36 : /* ------------------------------------------------------------------------- */
37 : extern TMC_t *ptmc;
38 : extern DLList *tp_handlers;
39 : extern TSBool ctprun;
40 : /* ------------------------------------------------------------------------- */
41 : /* EXTERNAL FUNCTION PROTOTYPES */
42 : /* None */
43 :
44 : /* ------------------------------------------------------------------------- */
45 : /* GLOBAL VARIABLES */
46 : /* None */
47 :
48 : /* ------------------------------------------------------------------------- */
49 : /* CONSTANTS */
50 : /* None */
51 :
52 : /* ------------------------------------------------------------------------- */
53 : /* MACROS */
54 : /* None */
55 :
56 : /* ------------------------------------------------------------------------- */
57 : /* LOCAL GLOBAL VARIABLES */
58 : /* None */
59 :
60 : /* ------------------------------------------------------------------------- */
61 : /* LOCAL CONSTANTS AND MACROS */
62 : /* None */
63 :
64 : /* ------------------------------------------------------------------------- */
65 : /* MODULE DATA STRUCTURES */
66 : /* None */
67 :
68 : /* ------------------------------------------------------------------------- */
69 : /* LOCAL FUNCTION PROTOTYPES */
70 : /* ------------------------------------------------------------------------- */
71 : /* FORWARD DECLARATIONS */
72 : /* None */
73 :
74 : /* ------------------------------------------------------------------------- */
75 : /* ==================== LOCAL FUNCTIONS ==================================== */
76 : /* None */
77 :
78 : /* ------------------------------------------------------------------------- */
79 : /* ======================== FUNCTIONS ====================================== */
80 : /* ------------------------------------------------------------------------- */
81 : void ctp_handle_sigusr2 (int signum)
82 6 : {
83 6 : ctprun = ESFalse;
84 : return;
85 : }
86 :
87 :
88 : void ctp_hande_sigtstp (int signo, siginfo_t * info, void *context)
89 2 : {
90 2 : int sleeptime = info->si_int;
91 : int secs;
92 : long usecs;
93 :
94 : /* MIN_DEBUG ("SIGTSTP caught: sleep time %d",
95 : * sleeptime); -- do *not* call non reentrant functions from signal
96 : * handlers
97 : */
98 2 : if (sleeptime) {
99 1 : secs = sleeptime / 1000;
100 1 : usecs = (sleeptime * 1000) / 1000000;
101 : /*MIN_DEBUG ("Pausing for %d secs and %d usecs",
102 : secs, usecs); */
103 :
104 1 : if (secs)
105 1 : sleep (secs);
106 1 : usleep (usecs);
107 : } else {
108 1 : kill (getpid (), SIGSTOP);
109 : }
110 :
111 2 : }
112 :
113 : /* ------------------------------------------------------------------------- */
114 : /* ================= OTHER EXPORTED FUNCTIONS ============================== */
115 : /* None */
116 :
117 : /* ------------------------------------------------------------------------- */
118 : /* ================= TESTS FOR LOCAL FUNCTIONS ============================= */
119 : #ifdef MIN_UNIT_TEST
120 :
121 : #endif /* MIN_UNIT_TEST */
122 : /* End of file */
|