Mercurial > hg > nginx
diff src/os/unix/ngx_process_cycle.c @ 4549:f31162fefe01
worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 21 Mar 2012 13:58:51 +0000 |
parents | 9dfe02dd0f11 |
children | 626157fe6f17 |
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c Wed Mar 21 07:35:43 2012 +0000 +++ b/src/os/unix/ngx_process_cycle.c Wed Mar 21 13:58:51 2012 +0000 @@ -62,7 +62,7 @@ #endif -u_long cpu_affinity; +uint64_t cpu_affinity; static u_char master_process[] = "master process"; @@ -913,23 +913,10 @@ } } -#if (NGX_HAVE_SCHED_SETAFFINITY) - if (cpu_affinity) { - ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, - "sched_setaffinity(0x%08Xl)", cpu_affinity); - - if (sched_setaffinity(0, sizeof(cpu_affinity), - (cpu_set_t *) &cpu_affinity) - == -1) - { - ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, - "sched_setaffinity(0x%08Xl) failed", cpu_affinity); - } + ngx_setaffinity(cpu_affinity, cycle->log); } -#endif - #if (NGX_HAVE_PR_SET_DUMPABLE) /* allow coredump after setuid() in Linux 2.4.x */