xref: /unit/src/nxt_main.c (revision 2023:72edfa4fe03c)
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) NGINX, Inc.
5  */
6 
7 #include <nxt_main.h>
8 #include <nxt_runtime.h>
9 
10 
11 extern char  **environ;
12 
13 
14 int nxt_cdecl
main(int argc,char ** argv)15 main(int argc, char **argv)
16 {
17     nxt_int_t  ret;
18 
19     if (nxt_lib_start("unit", argv, &environ) != NXT_OK) {
20         return 1;
21     }
22 
23 //    nxt_main_log.level = NXT_LOG_INFO;
24 
25     nxt_main_log.handler = nxt_log_time_handler;
26 
27     ret = nxt_runtime_create(&nxt_main_task);
28 
29     if (ret != NXT_OK) {
30         return 1;
31     }
32 
33     nxt_log(&nxt_main_task, NXT_LOG_INFO, "unit " NXT_VERSION " started");
34 
35     nxt_event_engine_start(nxt_main_task.thread->engine);
36 
37     nxt_unreachable();
38     return 0;
39 }
40