diff options
| author | Ruslan Ermilov <ru@nginx.com> | 2012-03-21 13:58:51 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@nginx.com> | 2012-03-21 13:58:51 +0000 |
| commit | fbd32d4d19cf7996e1d54b548744639b93f94459 (patch) | |
| tree | d8ea2879887aa37e39587d2d377d8b18c88cdd55 /auto | |
| parent | d4b1e5f58b999ad9c36d150ceb4493662f0188dc (diff) | |
| download | nginx-fbd32d4d19cf7996e1d54b548744639b93f94459.tar.gz nginx-fbd32d4d19cf7996e1d54b548744639b93f94459.tar.bz2 | |
worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.
Diffstat (limited to 'auto')
| -rw-r--r-- | auto/os/freebsd | 8 | ||||
| -rw-r--r-- | auto/os/linux | 5 | ||||
| -rw-r--r-- | auto/sources | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/auto/os/freebsd b/auto/os/freebsd index 88654ba60..6aa823f92 100644 --- a/auto/os/freebsd +++ b/auto/os/freebsd @@ -134,3 +134,11 @@ END exit 1 fi fi + + +# cpuset_setaffinity() + +if [ $version -ge 701000 ]; then + echo " + cpuset_setaffinity() found" + have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have +fi diff --git a/auto/os/linux b/auto/os/linux index dba11a4bc..c506d3dc3 100644 --- a/auto/os/linux +++ b/auto/os/linux @@ -128,8 +128,9 @@ ngx_feature_run=no ngx_feature_incs="#include <sched.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="long mask = 0; - sched_setaffinity(0, 32, (cpu_set_t *) &mask)" +ngx_feature_test="cpu_set_t mask; + CPU_ZERO(&mask); + sched_setaffinity(0, sizeof(cpu_set_t), &mask)" . auto/feature diff --git a/auto/sources b/auto/sources index c48c3adf4..374ad667c 100644 --- a/auto/sources +++ b/auto/sources @@ -145,6 +145,7 @@ UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \ src/os/unix/ngx_channel.h \ src/os/unix/ngx_shmem.h \ src/os/unix/ngx_process.h \ + src/os/unix/ngx_setaffinity.h \ src/os/unix/ngx_setproctitle.h \ src/os/unix/ngx_atomic.h \ src/os/unix/ngx_gcc_atomic_x86.h \ @@ -179,6 +180,7 @@ UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \ src/os/unix/ngx_shmem.c \ src/os/unix/ngx_process.c \ src/os/unix/ngx_daemon.c \ + src/os/unix/ngx_setaffinity.c \ src/os/unix/ngx_setproctitle.c \ src/os/unix/ngx_posix_init.c \ src/os/unix/ngx_user.c \ |
