summaryrefslogtreecommitdiffstats
path: root/bin/ps (follow)
Commit message (Collapse)AuthorAgeFilesLines
* clang10 identifies an argv[] comparison against '\0' instead of NULL,deraadt2020-08-031-2/+2
| | | | | it results in the same, but is incorrect. ok millert
* Make HISTORY more concise: historical section numbers are irrelevant.schwarze2020-02-081-5/+4
| | | | Fluff noticed by jsg@.
* Delete tests for P_THREAD that predate the existence ofguenther2019-12-161-3/+1
| | | | | | | | KERN_PROC_SHOW_THREADS and have been rendered superfluous by it. Similarly, some P_SYSTEM tests can be deleted or pushed to the kernel by using KERN_PROC_ALL instead of KERN_PROC_KTHREAD. ok visa@ mpi@
* Document pledge keywordkn2019-09-051-2/+6
| | | | OK millert
* tweak previous: a leading dash can only be given if an option letter follows;schwarze2019-07-251-3/+3
| | | | OK deraadt@
* Years ago the optionality of leading - was removed. dash-less is aderaadt2019-07-241-3/+3
| | | | | | | | | fact on the ground in ps everywhere, even on linux, and it is not going to go away, and denying the existance is pointless. The SYNOPSIS cannot proscriptively document all the cases without a madness. I also feel there is very little need to explain the behaviour differences relative to the sparse POSIX standard for ps, everyone's ps has oodles of extensions.
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-5/+5
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* sort previous; ok deraadtjmc2019-06-231-9/+9
|
* add "ps -o pledge" option, which prints a comma-seperated list of pledgesderaadt2019-06-233-3/+29
| | | | | | | | | active on each process. So go forth and "ps agux -o pledge" to find pledges which can be improved. (I hesitated adding this before because I am afraid of people enforcing extra-strict pledge in programs without testing all the use cases -- thereby breaking software).
* Export unveil state so that ps(8) can show it. Two new status flags,deraadt2019-06-233-5/+19
| | | | | | | | you'll see one, or neither. 'u' - process installed unveils, but not yet locked with unveil(0,0) or pledge w/o "unveil" 'U' - process has installed unveils, and locked. ok rob
* detect -t argument being too long, rather than truncatingderaadt2019-03-241-5/+8
|
* 16 chars is not enough for the maximum reach major() and minor()deraadt2019-03-241-2/+3
| | | | could have, so let's formally expand the buffer to what it needs to be.
* Let ps(1) work in single user mode where /var/run does not exist.florian2019-02-051-3/+3
| | | | | | | | Give the same treatment if /dev doesn't exist. While things will be real interesting without /dev there is no reason to stop ps(1). Fix suggested by & OK deraadt OK millert
* dev_t is signed to permit passing -1 as an invalid condition, but thederaadt2019-02-051-2/+2
| | | | | | decomposition into major and minor is unsigned, so we should print them with %u instead of %d. ok guenther
* Use uid_from_user(3) and gid_from_group(3) in utilities thatmillert2018-09-161-6/+2
| | | | do repeated lookups. OK tb@
* unveil dev.db "r" for devname(), /dev "r", and in the non-sysctl casederaadt2018-08-081-1/+14
| | | | some kernel memory/symbol files.
* handle the seperation of kvm_getenvv() and kvm_getargv() more cleanlyderaadt2018-06-121-6/+7
| | | | ok kettenis, plus a fix from tb
* Since rev 1.61 of print.c exp(3) and log(3) are not used anymore.bluhm2017-08-291-3/+3
| | | | | Do not link ps(1) with libm. from miod@; OK millert@
* stop reacharound from w(1) to ps(1); no functional change;schwarze2017-05-301-82/+0
| | | | diff from bcallah@; OK tedu@ deraadt@
* do not need sys/proc.hderaadt2017-01-242-4/+2
|
* Document LC_CTYPE.schwarze2016-10-261-3/+19
| | | | | The lack of this entry was reported by Jan Stary <hans at stare dot cz>. OK czarkoff@ jmc@
* Make the description of COLUMNS a bit more readable.schwarze2016-10-191-6/+7
| | | | | Triggered by a different patch from Michal Mazurek. Joint work by tb@, jmc@, and tedu@, but no one ever committed it.
* Attempt to use stdout, stderr, or stdin terminal widths if they exist.bentley2016-09-232-6/+14
| | | | | | | This behavior already existed but was unintentionally lost in revision 1.70 of ps.c. ok millert@ tb@
* The bug about not displaying exact information because ps can't runtedu2016-09-081-6/+3
| | | | | | | | faster than the system is more of a caveat than a bug. The comment also dates back to ye olden times when the information was collected via multiple kvm reads. The sysctl interface provides a much more consistent snapshot, albeit one that may be outdated by the time it's printed. Reword accordingly.
* etime isn't just an alias for start. the output format is different.tedu2016-09-084-8/+53
| | | | diff from Carlin Bingham. ok millert.
* simplify comment to remove reference to sparc.tedu2016-09-011-4/+2
|
* remove list item left in previous;jmc2016-04-251-2/+1
|
* remove references to systracetedu2016-04-252-8/+3
|
* simplify previous; ok bentleyjmc2016-03-171-2/+1
|
* Switch (non-curses, non-ksh) programs that use COLUMNS to a single idiom.bentley2016-03-172-22/+17
| | | | | | | | Previously behaviors were all over the map. This changes them to use COLUMNS first, and either terminal width or a hardcoded value (typically 80) as appropriate. ok deraadt@; man bits ok jmc@
* Partial revert: put back the file fmt.c.schwarze2016-01-101-0/+82
| | | | | It's no longer used by ps(1), but w(1) reaches around to it. Cluestick applied by deraadt@.
* UTF-8 support:schwarze2016-01-106-152/+129
| | | | | | | | In a UTF-8 locale, columnate correctly and replace valid, but non- printable characters with the Unicode replacement character U+FFFD. No change in the C/POSIX locale, and no change for invalid bytes. Grand total, the code becomes shorter by almost 30 lines. Feedback from czarkoff@, OK millert@.
* rename a few variables/functions to avoid shadowingtedu2015-12-303-6/+6
|
* fix pledge error messagederaadt2015-11-111-2/+2
|
* strvis directory names in psczarkoff2015-10-251-4/+7
| | | | OK stsp@
* need "getpw" pledge; spotted by matthieuderaadt2015-10-251-2/+2
|
* With new pledge "ps" and "vminfo" requests, ps/top/w become possible.deraadt2015-10-231-1/+4
|
* document tid keyword.benno2015-10-221-2/+6
| | | | found with and ok bluhm@
* Change all tame callers to namechange to pledge(2).deraadt2015-10-092-9/+9
|
* show tame flagderaadt2015-07-192-3/+9
|
* After removing the p_swtime from the kernel, ps always printed 0.0bluhm2015-06-294-37/+12
| | | | | | | as %cpu time. Remove the calculation in ps that includes the process lifetime. Just print the p_pctcpu value, that was done before when ps was called with -C. Keep -C as a no-op for existing scripts. OK millert@
* struct usave is unused, and eproc is gone; delete the former andguenther2015-05-031-11/+3
| | | | stop referencing them in comments
* kflag and wflag don't need to be counters; wflag only needs to know ifokan2015-04-091-3/+3
| | | | | | greater than 0 for its one test case. ok deraadt
* tzfile.h is an internal header that should never have been installed.millert2015-03-151-2/+4
| | | | | | | | | What's worse, the tzfile.h that gets installed is over 20 years old and doesn't match the real tzfile.h in libc/time. This makes the tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE define has been moved to time.h temporarily until its usage is replaced by 1900 in the tree. Actual removal of tzfile.h is pending a ports build. Based on a diff from deraadt@
* Document P_CANTSLEEPguenther2015-02-111-2/+3
|
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-164-12/+16
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* simplify realloc loop by not using realloc. we don't care about old data,tedu2015-01-051-18/+11
| | | | | so don't make realloc copy it. just allocate what we need. ok deraadt guenther
* Remove duplicate and misleading vcmp() prototype;schwarze2014-10-131-2/+1
| | | | | patch from Martin <Natano at natano dot net>; ok deraadt
* reduce cutoff for "hours only" start times to reduce window of ambiguity.tedu2014-08-161-2/+2
| | | | ok deraadt
* zap trailing newlines; "go for it" deraadtokan2014-07-161-2/+1
|