mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
lws_now_secs
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
f1bdb0fefe
commit
36f87b068f
2 changed files with 18 additions and 0 deletions
|
@ -932,6 +932,21 @@ lws_callback_vhost_protocols(struct lws *wsi, int reason, void *in, int len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* lws_now_secs() - seconds since 1970-1-1
|
||||
*
|
||||
*/
|
||||
LWS_VISIBLE LWS_EXTERN unsigned long
|
||||
lws_now_secs(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
|
||||
return tv.tv_sec;
|
||||
}
|
||||
|
||||
|
||||
#if LWS_POSIX
|
||||
|
||||
/**
|
||||
|
|
|
@ -2231,6 +2231,9 @@ lws_hdr_copy_fragment(struct lws *wsi, char *dest, int len,
|
|||
LWS_VISIBLE LWS_EXTERN const char *
|
||||
lws_get_urlarg_by_name(struct lws *wsi, const char *name, char *buf, int len);
|
||||
|
||||
LWS_VISIBLE LWS_EXTERN unsigned long
|
||||
lws_now_secs(void);
|
||||
|
||||
|
||||
/* get the active file operations struct */
|
||||
LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops * LWS_WARN_UNUSED_RESULT
|
||||
|
|
Loading…
Add table
Reference in a new issue