mirror of
https://github.com/nginx/nginx.git
synced 2026-08-27 04:07:18 +00:00
Core: expose maximum values of time_t and ngx_int_t.
These are needed to detect overflows.
This commit is contained in:
parent
d81db90455
commit
309928b941
3 changed files with 6 additions and 0 deletions
|
|
@ -85,8 +85,11 @@ typedef intptr_t ngx_flag_t;
|
|||
|
||||
#if (NGX_PTR_SIZE == 4)
|
||||
#define NGX_INT_T_LEN NGX_INT32_LEN
|
||||
#define NGX_MAX_INT_T_VALUE 2147483647
|
||||
|
||||
#else
|
||||
#define NGX_INT_T_LEN NGX_INT64_LEN
|
||||
#define NGX_MAX_INT_T_VALUE 9223372036854775807
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ typedef int sig_atomic_t;
|
|||
#define NGX_MAX_SIZE_T_VALUE 9223372036854775807
|
||||
#define NGX_TIME_T_LEN (sizeof("-9223372036854775808") - 1)
|
||||
#define NGX_TIME_T_SIZE 8
|
||||
#define NGX_MAX_TIME_T_VALUE 9223372036854775807
|
||||
|
||||
#else
|
||||
|
||||
|
|
@ -204,6 +205,7 @@ typedef int sig_atomic_t;
|
|||
#define NGX_MAX_SIZE_T_VALUE 2147483647
|
||||
#define NGX_TIME_T_LEN (sizeof("-2147483648") - 1)
|
||||
#define NGX_TIME_T_SIZE 4
|
||||
#define NGX_MAX_TIME_T_VALUE 2147483647
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue