git: 0869d85591db - stable/13 - bin/ps: Avoid function name conflict with libc uname()
Alex Richardson
arichardson at FreeBSD.org
Thu Aug 5 09:25:50 UTC 2021
The branch stable/13 has been updated by arichardson:
URL: https://cgit.FreeBSD.org/src/commit/?id=0869d85591dbe71eff4cbd9fc93077cf5943a00c
commit 0869d85591dbe71eff4cbd9fc93077cf5943a00c
Author: Alex Richardson <arichardson at FreeBSD.org>
AuthorDate: 2021-07-19 14:03:38 +0000
Commit: Alex Richardson <arichardson at FreeBSD.org>
CommitDate: 2021-08-05 08:59:59 +0000
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
(cherry picked from commit 2423585b1de50dd2daea8478318e94ff80e0e6ec)
---
bin/ps/extern.h | 2 +-
bin/ps/keyword.c | 2 +-
bin/ps/print.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/ps/extern.h b/bin/ps/extern.h
index 723d7fcb85dd..ea4362eeadd9 100644
--- a/bin/ps/extern.h
+++ b/bin/ps/extern.h
@@ -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 *);
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 2a8382a2273e..e78cf984e455 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -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},
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 3d3a543c8a5d..2b61c6b0a15a 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -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)));
More information about the dev-commits-src-all
mailing list