Skip to content

Commit

Permalink
netlib: processor_affinity conflicts in solaris
Browse files Browse the repository at this point in the history
Solaris has a syscall with the same name:
   https://docs.oracle.com/cd/E88353_01/html/E37841/processor-affinity-2.html

This change renames the function parameter to "use_cpu_affinity"
to match the use_cpu_map parameter.
  • Loading branch information
grundlerchromium committed Jun 8, 2018
1 parent 3ce554d commit 2315a69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/netlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ shutdown_control()
2004/12/13 */

void
bind_to_specific_processor(int processor_affinity, int use_cpu_map)
bind_to_specific_processor(int use_cpu_affinity, int use_cpu_map)
{

int mapped_affinity;
Expand All @@ -2281,10 +2281,10 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map)
a suitable CPU id even when the space is not contiguous and
starting from zero */
if (use_cpu_map) {
mapped_affinity = lib_cpu_map[processor_affinity];
mapped_affinity = lib_cpu_map[use_cpu_affinity];
}
else {
mapped_affinity = processor_affinity;
mapped_affinity = use_cpu_affinity;
}

#ifdef HAVE_MPCTL
Expand Down Expand Up @@ -2377,7 +2377,7 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map)
if ((mapped_affinity < 0) ||
(mapped_affinity > MAXIMUM_PROCESSORS)) {
fprintf(where,
"Invalid processor_affinity specified: %d\n", mapped_affinity); fflush(where);
"Invalid use_cpu_affinity specified: %d\n", mapped_affinity); fflush(where);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/netlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ extern double calc_thruput_omni(double units_received);
extern double calc_thruput_interval_omni(double units_received,double elapsed);
extern float calibrate_local_cpu(float local_cpu_rate);
extern float calibrate_remote_cpu();
extern void bind_to_specific_processor(int processor_affinity,int use_cpu_map);
extern void bind_to_specific_processor(int use_cpu_affinity,int use_cpu_map);
extern int set_nonblock (SOCKET sock);
extern char *find_egress_interface(struct sockaddr *source, struct sockaddr *dest);
extern char *find_interface_slot(char *interface_name);
Expand Down

0 comments on commit 2315a69

Please sign in to comment.