diff -uNr nginx-1.11.6.orig/src/os/unix/ngx_posix_init.c nginx-1.11.6/src/os/unix/ngx_posix_init.c
|
old
|
new
|
|
| 36 | 36 | { |
| 37 | 37 | ngx_time_t *tp; |
| 38 | 38 | ngx_uint_t n; |
| | 39 | cpu_set_t set; |
| 39 | 40 | |
| 40 | 41 | #if (NGX_HAVE_OS_SPECIFIC_INIT) |
| 41 | 42 | if (ngx_os_specific_init(log) != NGX_OK) { |
| … |
… |
|
| 51 | 52 | ngx_cacheline_size = NGX_CPU_CACHE_LINE; |
| 52 | 53 | |
| 53 | 54 | for (n = ngx_pagesize; n >>= 1; ngx_pagesize_shift++) { /* void */ } |
| 54 | | |
| 55 | 55 | #if (NGX_HAVE_SC_NPROCESSORS_ONLN) |
| 56 | 56 | if (ngx_ncpu == 0) { |
| | 57 | #ifdef CPU_COUNT |
| | 58 | if (sched_getaffinity (0, sizeof (set), &set) == 0) |
| | 59 | { |
| | 60 | ngx_ncpu = CPU_COUNT (&set); |
| | 61 | } |
| | 62 | #else |
| 57 | 63 | ngx_ncpu = sysconf(_SC_NPROCESSORS_ONLN); |
| | 64 | #endif |
| 58 | 65 | } |
| 59 | 66 | #endif |
| 60 | 67 | |