23 RCSID(
"$Id: 848ad9d7760d336c923d3ca8b3e059135a24fe72 $")
25 #include <freeradius-devel/io/schedule.h>
26 #include <freeradius-devel/util/time.h>
27 #include <freeradius-devel/radius/defs.h>
28 #include <freeradius-devel/util/debug.h>
29 #include <freeradius-devel/util/inet.h>
30 #include <freeradius-devel/util/md5.h>
31 #include <freeradius-devel/util/syserror.h>
33 #include <sys/event.h>
47 fprintf(stderr,
"usage: schedule_test [OPTS]\n");
48 fprintf(stderr,
" -n <num> Start num network threads\n");
49 fprintf(stderr,
" -w <num> Start num worker threads\n");
50 fprintf(stderr,
" -x Debugging mode.\n");
55 int main(
int argc,
char *argv[])
67 while ((c = getopt(argc, argv,
"n:w:x")) != -1)
switch (c) {
69 num_networks = atoi(optarg);
70 if ((num_networks <= 0) || (num_networks > 16))
usage();
95 fprintf(stderr,
"schedule_test: Failed to create scheduler\n");
#define NEVER_RETURNS
Should be placed before the function return type.
#define fr_exit_now(_x)
Exit without calling atexit() handlers, producing a log message in debug builds.
int fr_log_init_legacy(fr_log_t *log, bool daemonize)
Initialise file descriptors based on logging destination.
@ L_DBG_LVL_MAX
Lowest priority debug messages (-xxxxx | -Xxxx).
static TALLOC_CTX * autofree
fr_schedule_t * fr_schedule_create(TALLOC_CTX *ctx, fr_event_list_t *el, fr_log_t *logger, fr_log_lvl_t lvl, fr_schedule_thread_instantiate_t worker_thread_instantiate, fr_schedule_thread_detach_t worker_thread_detach, fr_schedule_config_t *config)
Create a scheduler and spawn the child threads.
int fr_schedule_destroy(fr_schedule_t **sc_to_free)
Destroy a scheduler, and tell its child threads to exit.
int main(int argc, char *argv[])
static NEVER_RETURNS void usage(void)
#define talloc_autofree_context
The original function is deprecated, so replace it with our version.
int fr_time_start(void)
Initialize the local time.