Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lhanjian committed Nov 6, 2023
1 parent a38a9c0 commit f263f10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/nginx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ ngx_get_cpu_affinity(ngx_uint_t n)
ngx_cpuset_t *mask;
ngx_core_conf_t *ccf;

#if (T_NGX_HAVE_SCHED_GETAFFINITY)
#if (T_NGX_HAVE_SCHED_GETAFFINITY && NGX_HAVE_SC_NPROCESSORS_ONLN && NGX_HAVE_SC_NPROCESSORS_CONF)
ngx_int_t worker_i, machine_core, all_machine_cores;
#endif

Expand Down
12 changes: 5 additions & 7 deletions src/os/unix/ngx_getaffinity.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
* Copyright (C) lhanjian ([email protected])
*/

#ifndef _NGX_SETAFFINITY_H_INCLUDED_
#define _NGX_SETAFFINITY_H_INCLUDED_
#ifndef _NGX_GETAFFINITY_H_INCLUDED_
#define _NGX_GETAFFINITY_H_INCLUDED_


#if (NGX_HAVE_SCHED_SETAFFINITY)

#define NGX_HAVE_CPU_AFFINITY 1
#if (T_NGX_HAVE_SCHED_GETAFFINITY)

typedef cpu_set_t ngx_cpuset_t;

void ngx_setaffinity(ngx_cpuset_t *cpu_affinity, ngx_log_t *log);
void ngx_getaffinity(ngx_cpuset_t *cpu_affinity, ngx_log_t *log);

#else

#define ngx_setaffinity(cpu_affinity, log)
#define ngx_getaffinity(cpu_affinity, log)

typedef uint64_t ngx_cpuset_t;

Expand Down

0 comments on commit f263f10

Please sign in to comment.