Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4404 - trunk/src/os/unix

Anonymous User
January 16, 2012 06:14AM
Author: mdounin
Date: 2012-01-16 11:13:48 +0000 (Mon, 16 Jan 2012)
New Revision: 4404

Log:
Fixed sched_setaffinity(2) to correctly pass size.

Second argument (cpusetsize) is size in bytes, not in bits. Previously
used constant 32 resulted in reading of uninitialized memory and caused
EINVAL to be returned on some Linux kernels.


Modified:
trunk/src/os/unix/ngx_process_cycle.c

Modified: trunk/src/os/unix/ngx_process_cycle.c
===================================================================
--- trunk/src/os/unix/ngx_process_cycle.c 2012-01-16 11:03:27 UTC (rev 4403)
+++ trunk/src/os/unix/ngx_process_cycle.c 2012-01-16 11:13:48 UTC (rev 4404)
@@ -914,7 +914,10 @@
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0,
"sched_setaffinity(0x%08Xl)", cpu_affinity);

- if (sched_setaffinity(0, 32, (cpu_set_t *) &cpu_affinity) == -1) {
+ 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);
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4404 - trunk/src/os/unix

Anonymous User 1308 January 16, 2012 06:14AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 321
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready