63 struct passwd pwd, *
result;
72 getpwnam_r(str, &pwd, buf,
sizeof(buf), &result);
79 int uid = strtol(str, &endptr, 10);
84 getpwuid_r(uid, &pwd, buf,
sizeof(buf), &result);
90 target->
uid = result->pw_uid;
97 static const char *perf_target__error_str[] = {
98 "PID/TID switch overriding CPU",
99 "PID/TID switch overriding UID",
100 "UID switch overriding CPU",
101 "PID/TID switch overriding SYSTEM",
102 "UID switch overriding SYSTEM",
104 "Problems obtaining information for user %s",
116 const char *
err = strerror_r(errnum, buf, buflen);
121 *(buf +
min(buflen - 1, len)) =
'\0';
132 msg = perf_target__error_str[
idx];