the code is as follows:
local ffi = require("ffi")
ffi.cdef[[
struct timeval {
long int tv_sec;
long int tv_usec;
};
int gettimeofday(struct timeval *tv, void *tz);
]];
local tm = ffi.new("struct timeval");
report the following error after running:
2018/11/19 08:53:55 [error] 24046-sharp0: init_worker_by_lua_file error: lua/ngx_base/resty/utils/time/time_help.lua:24: attempt to redefine "timeval"
stack traceback:
[C]: in function "cdef"
lua/ngx_base/resty/utils/time/time_help.lua:24: in main chunk
[C]: in function "require"
lua/ngx_base/resty/utils/incr_help.lua:15: in main chunk
[C]: in function "require"
...s/trade/third_party_union_payment/model/trade_tf_dao.lua:30: in main chunk
[C]: in function "require"
lua/modules/trade/task/trade_task.lua:14: in main chunk
[C]: in function "require"
lua/ngx_base/server/sys_task.lua:11: in function "init_task"
lua/ngx_base/server/sys.lua:13: in function "init"
./lua/init_worker_by_lua.lua:16: in main chunk