aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/top/username.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix multiple warnings in usr.bin/top about variables shadowing globalDimitry Andric2019-02-101-3/+3
| | | | | | | | | declarations from base gcc, by renaming those variables. MFC after: 1 week Notes: svn path=/head/; revision=343958
* top(1): style(9)Eitan Adler2018-06-131-3/+6
| | | | | | | | - split return type from function name - Sprinkle a __pure where possible. Notes: svn path=/head/; revision=335043
* top(1): filter fewer warnings; clean upEitan Adler2018-06-101-3/+1
| | | | | | | | | | | - remove WARNS?=6. It is default - we no longer have cast-qual problems - remove unused macros - remove unneeded casts - add include guard for loadavg.h Notes: svn path=/head/; revision=334917
* top(1): fix several style & const related issuesEitan Adler2018-06-081-1/+1
| | | | | | | | | - use parens for return - put function names on newline - sprinkle const where possible Notes: svn path=/head/; revision=334822
* top(1): include what you useEitan Adler2018-06-041-1/+0
| | | | | | | | | | | | - Change headers to more closely match what we use - use more standard functions instead of bzero, bcmp, bcopy - Add myself to authors. Tested with: base clang (amd64), gcc 9 (amd64), base clang (i386), base gcc (mips) Notes: svn path=/head/; revision=334600
* top(1): partial revert of r334517Eitan Adler2018-06-031-7/+6
| | | | | | | | | | In fixing issues with uid > INT_MAX, I broke the uid without username case. The latter is more important so return the old state. Discussed with: allanjude Notes: svn path=/head/; revision=334553
* top(1): Use uid_t for uid rather than 'int'Eitan Adler2018-06-021-9/+7
| | | | | | | Remove unneeded define while here. Notes: svn path=/head/; revision=334517
* top(1): ansify, style(9). and nitsEitan Adler2018-06-021-14/+5
| | | | | | | | | | - Prefer using ansi prototypes rather than C prototypes - Keep type on separate line from name of function - Try to keep things const where possible. This will help get to WARNS=6 - switch to "bool" where it makes sense Notes: svn path=/head/; revision=334509
* top(1): fix buildEitan Adler2018-05-211-1/+0
| | | | | | | | | | | | Remove 'top.local.hs'. This was not noticed since /srv/obj/fbsd/srv/src/freebsd/svn/head/amd64.amd64/usr.bin/top/top.local.h existed locally on my machine despite "make clean". Only fully removing the objdir allowed me to observe the error directly. Pointyhat to: me Notes: svn path=/head/; revision=333974
* top(1): modernize a bit; reduce warningsEitan Adler2018-05-211-1/+1
| | | | | | | | | | | | | | | | | | - Replace caddr_t with "void *". This reduces the number of warnings at WARNS=6 - use "static" where possible - sprinkle const where possible This leaves at WARNS=6: 35 warnings in top.c 88 warnings in machine.c 7 warnings in commands.c all of which are either "incompatible-pointer-types-discards-qualifiers" or "cast-qual" Notes: svn path=/head/; revision=333972
* Revert r333969 which contained one too many changesEitan Adler2018-05-211-1/+1
| | | | Notes: svn path=/head/; revision=333970
* top(1): modernize a bit; reduce warningsEitan Adler2018-05-211-1/+1
| | | | | | | | | | | | | | | | | | - Replace caddr_t with "void *". This reduces the number of warnings at WARNS=6 - use "static" where possible - sprinkle const where possible This leaves at WARNS=6: 35 warnings in top.c 72 warnings in machine.c 5 warnings in commands.c all of which are either "incompatible-pointer-types-discards-qualifiers" or "cast-qual" Notes: svn path=/head/; revision=333969
* top(1): pull configuration directly into header filesEitan Adler2018-05-201-38/+3
| | | | | | | | | This sets configuration variables directly in the various header files, avoiding the need to have special logic in our Makefile to build the header. Notes: svn path=/head/; revision=333946
* top(1): set max username length based on system constantEitan Adler2018-05-201-11/+0
| | | | | | | | | | | | | | | | | | | This changes previous behavior of calculating it at startup based on the current max username length. This is done because: - it is in theory possible for the max length to change at run-time (e.g., a new user is added after top starts running) - on machines with many users this delays startup significantly PR: 20799 PR: 89762 Reported by: ob@e-Gitt.NET Reported by: wkwu@Kavalan.csie.NCTU.edu.tw Reported on: 2000-08-23 and 2005-11-30 Notes: svn path=/head/; revision=333945
* top(1): remove use of 'register' keywordEitan Adler2018-05-201-2/+2
| | | | | | | | This keyword is meaningless is obscures future diffs that help clear up warnings in top. Notes: svn path=/head/; revision=333908
* top(1): Migrate top to usr.binEitan Adler2018-05-191-0/+195
We've been maintaining top(1) for a long time, and the upstream hasn't existed/been used in similarly as long. Make it clear that we own top(1) Tested with 'make universe'. Everything passed except MIPS which failed for unrelated reasons. Install also tested for amd64. Reviewed by: sbruno No objections: imp, mmacy Differential Revision: https://reviews.freebsd.org/D15387 Notes: svn path=/head/; revision=333898