- if (GetProcessGroupAffinity(handle, &group_count, current_groups) == 0) {
- /* NB: we also fail here if we are a multi-group process */
- log_err("fio_getaffinity: failed to get single group affinity for pid %d\n", pid);
+ if (!GetProcessGroupAffinity(handle, &group_count, current_groups)) {
+ log_err("%s: failed to get single group affinity for pid %d (%d)\n",
+ __func__, pid, GetLastError());
+ goto err;
+ }
+ if (group_count > 1) {
+ log_err("%s: pid %d is associated with %d process groups\n",
+ __func__, pid, group_count);
+ goto err;
+ }
+ if (!GetProcessAffinityMask(handle, &process_mask, &system_mask)) {
+ log_err("%s: GetProcessAffinityMask() failed for pid\n",
+ __func__, pid);