#include <sys/time.h>
#include <sys/resource.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <inttypes.h>
#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#include <cmocka.h>
#include <amxc/amxc_variant_type.h>
#include <amxc/amxc_variant.h>
#include <amxp/amxp_syssig.h>
#include <amxp/variant_siginfo.h>
#include <amxp_signal_priv.h>
#include "test_syssig.h"
#include <amxc/amxc_macros.h>
Go to the source code of this file.
◆ __wrap_signalfd() [1/2]
int __wrap_signalfd |
( |
int |
fd, |
|
|
const sigset_t * |
mask, |
|
|
int |
flags |
|
) |
| |
◆ __wrap_signalfd() [2/2]
int __wrap_signalfd |
( |
int |
fd, |
|
|
UNUSED const sigset_t * |
mask, |
|
|
UNUSED int |
flags |
|
) |
| |
◆ test_slot_sigchld()
static void test_slot_sigchld |
( |
const char *const |
sig_name, |
|
|
const amxc_var_t *const |
data, |
|
|
UNUSED void *const |
priv |
|
) |
| |
|
static |
Definition at line 84 of file test_syssig.c.
89 assert_ptr_not_equal(siginfo, NULL);
90 assert_string_equal(sig_name, strsignal(SIGCHLD));
91 assert_int_equal(siginfo->ssi_signo, SIGCHLD);
92 assert_int_equal(siginfo->ssi_pid, 5012);
struct signalfd_siginfo amxp_siginfo_t
◆ test_syssig_enable()
void test_syssig_enable |
( |
UNUSED void ** |
state | ) |
|
Definition at line 113 of file test_syssig.c.
128 sigprocmask(SIG_BLOCK, NULL, &
mask);
129 assert_int_equal(sigismember(&
mask, SIGINT), 1);
130 assert_int_equal(sigismember(&
mask, SIGTERM), 1);
141 sigprocmask(SIG_BLOCK, NULL, &
mask);
142 assert_int_equal(sigismember(&
mask, SIGINT), 0);
143 assert_int_equal(sigismember(&
mask, SIGTERM), 0);
bool amxp_syssig_is_enabled(const int sigid)
Checks if a system signal is being monitored.
#define AMXP_SYSSIG_MAX
Defines highest possible system signal.
int amxp_syssig_enable(const int sigid, const bool enable)
Enables or disables monitoring of a system signal.
◆ test_syssig_get_fd()
void test_syssig_get_fd |
( |
UNUSED void ** |
state | ) |
|
Definition at line 107 of file test_syssig.c.
int amxp_syssig_get_fd(void)
Returns a file descriptor that can be used in an eventloop.
◆ test_syssig_read()
void test_syssig_read |
( |
UNUSED void ** |
state | ) |
|
Definition at line 146 of file test_syssig.c.
148 .ssi_signo = SIGCHLD,
160 assert_int_equal(
count, 1);
int amxp_slot_connect(amxp_signal_mngr_t *const sig_mngr, const char *const sig_name, const char *const expression, amxp_slot_fn_t fn, void *const priv)
Connects a slot (function) to a named signal of a signal manager.
int amxp_syssig_read(void)
Reads from the file descriptor.
static void test_slot_sigchld(const char *const sig_name, const amxc_var_t *const data, UNUSED void *const priv)
◆ count
◆ sig_pipe
int sig_pipe[20] = { -1, -1 } |