bin/ps: Avoid function name conflict with libc uname()

This prevents ps from being built with address sanitizer instrumentation.

Reviewed By:	trasz
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D31048
This commit is contained in:
Alex Richardson 2021-07-19 15:03:38 +01:00
parent 9009d36afd
commit 2423585b1d
3 changed files with 3 additions and 3 deletions

View File

@ -86,7 +86,7 @@ char *tdev(KINFO *, VARENT *);
char *tdnam(KINFO *, VARENT *);
char *tname(KINFO *, VARENT *);
char *ucomm(KINFO *, VARENT *);
char *uname(KINFO *, VARENT *);
char *username(KINFO *, VARENT *);
char *upr(KINFO *, VARENT *);
char *usertime(KINFO *, VARENT *);
char *vsize(KINFO *, VARENT *);

View File

@ -222,7 +222,7 @@ static VAR var[] = {
{"upr", "UPR", NULL, "user-priority", 0, upr, 0, CHAR, NULL, 0},
{"uprocp", "UPROCP", NULL, "process-address", 0, kvar, KOFF(ki_paddr),
KPTR, "lx", 0},
{"user", "USER", NULL, "user", LJUST, uname, 0, CHAR, NULL, 0},
{"user", "USER", NULL, "user", LJUST, username, 0, CHAR, NULL, 0},
{"usertime", "USERTIME", NULL, "user-time", USER, usertime, 0, CHAR,
NULL, 0},
{"usrpri", "", "upr", NULL, 0, NULL, 0, CHAR, NULL, 0},

View File

@ -311,7 +311,7 @@ upr(KINFO *k, VARENT *ve __unused)
#undef scalepri
char *
uname(KINFO *k, VARENT *ve __unused)
username(KINFO *k, VARENT *ve __unused)
{
return (strdup(user_from_uid(k->ki_p->ki_uid, 0)));