Go to the documentation of this file.
9 #define WAIT_FOR_BACKGROUND_THREAD_INSPECTION (0)
13 #include <sys/resource.h>
18 (SCHED_OTHER) // NOTE: SCHED_OTHER is the default Linux scheduler
28 if (setrlimit (RLIMIT_NICE, &rlim) == 0) {
31 printf (
"This process has enough permissions to raise ZMQ "
32 "background thread priority!\n");
37 printf (
"This process has NOT enough permissions to raise ZMQ "
38 "background thread priority.\n");
44 #define TEST_POLICY (0)
98 int cpus_add[] = {0, 1};
99 for (
unsigned int idx = 0;
idx <
sizeof (cpus_add) /
sizeof (cpus_add[0]);
106 int cpus_remove[] = {1};
107 for (
unsigned int idx = 0;
108 idx <
sizeof (cpus_remove) /
sizeof (cpus_remove[0]);
idx++) {
122 #ifdef ZMQ_BUILD_DRAFT_API
125 const char prefix[] =
"MyPrefix9012345";
129 sizeof (
prefix) /
sizeof (
char)));
132 size_t buflen =
sizeof (
buf) /
sizeof (
char);
140 #ifdef ZMQ_ZERO_COPY_RECV
161 const char *small_str =
"abcd";
162 const char *large_str =
163 "01234567890123456789012345678901234567890123456789";
189 #if defined(ZMQ_USE_SELECT)
191 #elif defined(ZMQ_USE_POLL) || defined(ZMQ_USE_EPOLL) \
192 || defined(ZMQ_USE_DEVPOLL) || defined(ZMQ_USE_KQUEUE)
210 #if defined(ZMQ_MSG_T_SIZE)
230 size_t optsize =
sizeof (int);
239 #if WAIT_FOR_BACKGROUND_THREAD_INSPECTION
242 printf (
"Sleeping for 100sec. You can now use 'top -H -p $(pgrep -f "
243 "test_ctx_options)' and 'taskset -pc <ZMQ background thread PID>' "
244 "to view ZMQ background thread properties.\n");
#define ZMQ_MAX_SOCKETS_DFLT
ZMQ_EXPORT int zmq_ctx_set(void *context_, int option_, int optval_)
#define TEST_ASSERT_EQUAL_STRING(expected, actual)
void test_ctx_option_blocky()
#define ZMQ_IO_THREADS_DFLT
#define ZMQ_THREAD_AFFINITY_CPU_REMOVE
void test_ctx_option_max_sockets()
void test_ctx_option_io_threads()
void test_ctx_option_socket_limit()
void test_ctx_option_ipv6()
#define SETUP_TEARDOWN_TESTCONTEXT
void test_ctx_zero_copy()
void bind_loopback_ipv4(void *socket_, char *my_endpoint_, size_t len_)
int zmq_ctx_get_ext(void *ctx_, int option_, void *optval_, size_t *optvallen_)
void * get_test_context()
static uint32_t idx(tarjan *t, const upb_refcounted *r)
ZMQ_EXPORT int zmq_connect(void *s_, const char *addr_)
#define ZMQ_THREAD_SCHED_POLICY
#define ZMQ_ZERO_COPY_RECV
#define ZMQ_THREAD_SCHED_POLICY_DFLT
bool is_allowed_to_raise_priority()
static const char prefix[]
int zmq_ctx_set_ext(void *ctx_, int option_, const void *optval_, size_t optvallen_)
void test_ctx_option_ipv6_set()
#define MAX_SOCKET_STRING
ZMQ_EXPORT void * zmq_socket(void *, int type_)
void * test_context_socket(int type_)
#define ZMQ_THREAD_PRIORITY
GLenum GLuint GLenum GLsizei const GLchar * buf
#define TEST_ASSERT_EQUAL_INT(expected, actual)
ZMQ_EXPORT int zmq_close(void *s_)
#define ZMQ_THREAD_AFFINITY_CPU_ADD
void send_string_expect_success(void *socket_, const char *str_, int flags_)
ZMQ_EXPORT int zmq_ctx_get(void *context_, int option_)
#define WAIT_FOR_BACKGROUND_THREAD_INSPECTION
void recv_string_expect_success(void *socket_, const char *str_, int flags_)
void setup_test_environment(int timeout_seconds_)
static void push(tarjan *t, const upb_refcounted *r)
#define TEST_ASSERT_FAILURE_ERRNO(error_code, expr)
#define ZMQ_THREAD_NAME_PREFIX
GLsizei const GLfloat * value
void * test_context_socket_close(void *socket_)
void test_ctx_option_msg_t_size()
void test_ctx_option_invalid()
#define TEST_ASSERT_SUCCESS_ERRNO(expr)
ZMQ_EXPORT int zmq_getsockopt(void *s_, int option_, void *optval_, size_t *optvallen_)
#define ZMQ_THREAD_PRIORITY_DFLT
void test_ctx_thread_opts()
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:59