DELTA 433417 0 274 SVN  HCGPORTREVISION= 1ENDREP DELTA 433418 0 321 SVNL u sGs1-24 02:05:48 UTC +++ config.m4 @@ -85,7 +85,13 @@ AC_DEFUN([AC_SWOOLE_CPU_AFFINITY], AC_MSG_CHECKING([for cpu affinity]) AC_TRY_COMPILE( [ + #ifdef __FreeBSD__ + #include + #include + typedef cpuset_t cpu_set_t; + #else #include + #endif ], [ cpu_set_t cpu_set; CPU_ZERO(&cpu_set); @@ -178,7 +184ENDREP DELTA SVN " --- include/swoole.h.orig 2017-01-24 02:05:48 UTC +++ include/swoole.h @@ -40,7 +40,17 @@ extern "C" { #include #include #include + +#if defined(HAVE_CPU_AFFINITY) +#ifdef __FreeBSD__ +#include +#include +#include +typedef cpuset_t cpu_set_t; +#else #include +#endif +#endif #include #include ENDREP DELTA SVN{}{{--- src/network/Server.c.orig 2017-02-06 09:30:50 UTC +++ src/network/Server.c @@ -522,7 +522,13 @@ int swServer_worker_init(swServer *serv, { CPU_SET(SwooleWG.id % SW_CPU_NUM, &cpu_set); } + +#ifdef __FreeBSD__ + if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, + sizeof(cpu_set), &cpu_set) < 0) +#else if (sched_setaffinity(getpid(), sizeof(cpu_set), &cpu_set) < 0) +#endif { swSysError("sched_setaffinity() failed."); } ENDREP DELTA SVN M x^Ao@+&6iѪ=P^&݄a/Ԓx\v3:<e3!q7/^nucx2OaZ7 y6}<h#Pׇz#1x/4 r@*JSڱ 4$lM=e'hp'8ءmvh˵OMF.Hs w