summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Only add the widths together for printable characters in prn_normal();tjr2004-05-031-1/+2
| | | | unprintable characters have a "width" of -1.
* Treat filenames as multibyte character strings (according to the currenttjr2004-05-024-65/+132
| | | | | | | | | | | | | LC_CTYPE setting) when determining which characters are printable. This is an often-requested feature. Use wcwidth() to determine the number of column positions a character takes up, although there are still a few places left where we assume 1 byte = 1 column position, e.g. line-wrapping when handling the -m option. The error handling here is somewhat more complicated than usual: we do our best to show what we can of a filename in the presence of conversion errors, instead of simply aborting.
* Various quibbles:das2004-04-281-15/+28
| | | | | | | | | - Print a diagnostic if kdumpenv() fails. This can occur due to MAC restrictions or lack of memory. Catch all kenv(2) failures as well. - Just of the heck of it, DTRT if the kernel environment size changes at the wrong time. The old code could fail silently or fail to null-terminate a buffer if you got exceptionally unlucky. - Sort and GC the #includes.
* Fix some style issues in rev 1.58.obrien2004-04-221-13/+12
| | | | | Use 64-bit integer math vs. mixed FP & integer. Add -g to the usage().
* Add 'g' to SYNOPSIS.obrien2004-04-221-1/+1
|
* Fix printing of the "Mounted on" values for 'df -i'.obrien2004-04-221-2/+4
| | | | | | Fix spacing before "Mounted on" column in general. Submitted by: bde
* Add -c option simular to du(1).obrien2004-04-183-15/+51
| | | | | PR: 19635 Submitted by: cyrille.lefevre@laposte.net
* Document the "return" built-in better: it will exit . (sources) andgreen2004-04-141-1/+7
| | | | the top-level shell instance, too.
* Style fixes and add gen to CLEANFILES.njl2004-04-091-12/+15
| | | | Submitted by: bde
* Give date(1) a much better SYNOPSIS section which is useful as more thangreen2004-04-061-9/+13
| | | | | | | decoration. Further improvements are welcome, but at least this is a separate of the various modes of operation date has, as well as sectioning off the two deprecated options for settimeofday(tz) that don't even apply to actual operation of date as such, anyway.
* Remove clause 3 from the UCB licenses.markm2004-04-06182-728/+0
| | | | OK'ed by: imp, core
* Drop the include of <stdint.h>, since r1.84 removed references of intmax_t.gad2004-04-041-1/+0
|
* Add back the `-e' option, which was mistakenly dropped when cleaninggad2004-04-041-1/+1
| | | | | up the PS_ARGS string in revision 1.69 (and which was apparently not missed by anyone...).
* Give a name of 'l' (list) to the union in struct listinfo. This isgad2004-04-041-28/+30
| | | | | because some compilers (such as gcc 2.95.4) do not support having an unnamed union for a field in a struct.
* Stop iterating over ACLs if we've already determined webmilekic2004-04-031-5/+11
| | | | | | | | | | will print them (i.e., number of successful calls to acl_get_entry() exceeds 3). This makes O(1) what was O(num_TYPE_ACCESS_ACLs). This is a slightly modified version of submitter's patch. PR: bin/65042 Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
* Add spaces after flag names on .Fl macros.gad2004-04-011-2/+2
| | | | | Noticed by: ru MFC after: 4 days
* Describe the sorting options in better and more complete detail.gad2004-03-311-6/+29
| | | | | | Also improve the description of `-L' a little. MFC after: 4 days
* Switch to using strtoul() for parsing a potential UID or GID, which getsgad2004-03-301-9/+8
| | | | | | | this to correctly handle UID's and GID's larger than 2147483647. Noticed by: bde MFC after: 1 week
* Bruce would really like the prototype for fmt() to be split across linesgad2004-03-301-1/+2
| | | | | | | this way (although I still think it "looks weird"...). Requested by: bde MFC after: 1 week
* Minor style fixes, mostly adding indent-protection on some comment-blocks.gad2004-03-301-6/+6
| | | | | Noticed by: bde MFC after: 1 week
* Replace pscomp() with a cleaner version, mostly written by bde (*).gad2004-03-301-14/+43
| | | | | | | | | | | This corrects a problem of lost-precision for `-r' (sort-by-CPU). Also, for sort-by-CPU and sort-by-memory, any processes which have the same value CPU or MEMORY are now sorted by TTY and then (if needed) by pid. (* - I just added the NODEV checks, after doing some testing of my own) Submitted by: bde MFC after: 1 week
* Oops. Remove some ';'s in #defines added by a previous update.gad2004-03-291-2/+2
| | | | Noticed by: bde
* Have this source explicitly include <sys/proc.h>, since it referencesgad2004-03-291-0/+1
| | | | | | | values such as P_CONTROLT and PS_INMEM. But this still won't define PID_MAX for us, since that is hidden inside of '#ifdef _KERNEL'. Noticed by: bde
* Since "kp" is a pointer, I should be comparing against NULL not 0.gad2004-03-291-1/+1
| | | | Noticed by: bde
* Various style improvements, mostly in comments and indentation.gad2004-03-291-43/+58
| | | | Suggested by: bde (well, for most of them)
* In the routines I've been working on, sort the variable declartionsgad2004-03-291-9/+9
| | | | | | so that non-pointers are listed after pointer-type variables. Noticed by: bde
* Split two 'fmt' strings so they're easier to read on 80-char windows.gad2004-03-291-2/+4
|
* Sort the declarations of global variables.gad2004-03-291-24/+25
|
* Sort the routine prototypes.gad2004-03-281-10/+9
|
* If <x> is a process id that does not exist, then just print the headergad2004-03-281-1/+1
| | | | | | | (if any) and exit, thus matching the behavior on -stable and other OS's. My earlier attempt to fix this (v1.65) only seemed to work because of a lucky random value in nentries (which was not being initialized back when I tested that earlier patch).
* Fix `-o rtprio' so it prints the correct value.gad2004-03-281-2/+2
| | | | | | PR: bin/59417 Submitted by: Jan Willem Knopper This fix by: bde (in the audit-trail of the PR)
* If a non-existent user is given as part of `-U userlist', treat it asgad2004-03-271-11/+6
| | | | | a fatal error instead of a minor warning. It is possible that a few users are used to the previous behavior, but I'm claiming it was a bug.
* Explicitly wrap two long-ish linesi of code, to make them easier to read.gad2004-03-271-2/+4
|
* Change the #if-ish logic which is used to add the `-f' option when `ps'gad2004-03-271-9/+9
| | | | | | is compiled with LAZY_PS, so that there is only one PS_ARGS string to modify when changing the option-list. Also get `-f' to show up in the usage() statement when compiled with LAZY_PS.
* Move the 'f' case so it shows up in the right place, alphabetically.gad2004-03-271-6/+6
|
* Update the date on the man page, since this the previous change addedgad2004-03-271-1/+1
| | | | a few new options.
* Support more POSIX/SUSv3 options:gad2004-03-272-187/+580
| | | | | | | | | | | | | | | | | | | | | | - Change `-p' to allow a list of process IDs, and `-t' to allow a list of terminal names, instead of only a single value for each. - Add the `-A' option of SUSv3, which is exactly the same as `-ax'. - Add the `-G gidlist' (group id). - Allow any of these "selector options" to be specified multiple times, and have `ps' keep adding to a given list -- instead of replacing the previously-specified values. - Fix interactions between selector-options, so that: "If any are specified, ... ps shall select the processes represented by the inclusive OR of all the selection-criteria options." (from SUSv3) - Add a `-X' option, which is the reverse of the `-x' option. - various minor improvements in parsing and error handling. This does not get us to match POSIX/SUSv3, but it gets us closer. The `-g pgidlist', `-R ruserlist' and `-s sidlist' options mentioned in freebsd-standards are still under debate, so they skipped for now. It should be true that this introduces no user-visible incompatible changes, except to support "new stuff" that was not supported before.
* Avoid the manpage layering violation and low-level implementationru2004-03-261-3/+2
| | | | | details of libkvm, and just tell what the getbootfile(3) function will return, by using the text from netstat(1) and dmesg(8).
* - Remove references to /dev/kmem -- ps(1) utilizes theru2004-03-261-11/+5
| | | | | | | sysctl(3) interface in kvm(3). - Document the correct default when no -N is specified. - Remove stale reference to /var/db/kvm_kernel.db. - Remove stale reference to /var/run/dev.db.
* Remove WFORMAT, style.Makefile(5).obrien2004-03-221-5/+5
|
* When symbolic link is pointed onto a mount point, it can't be movedpjd2004-03-211-6/+17
| | | | | | | | | to a different file system. Patch in PR was incorrect. PR: bin/64430 Submitted by: Samuel Tardieu MFC after: 3 days
* Document incorrect handling of multibyte characters.tjr2004-03-211-1/+6
|
* Document incorrect handling of multibyte characters in filenames.tjr2004-03-211-1/+5
|
* Reduce redundancy in the description of the -u option.tjr2004-03-211-3/+1
|
* Document incorrect handling of multibyte characters when -t and -v optionstjr2004-03-211-1/+9
| | | | are used.
* Add a -v (verbose) option.des2004-03-212-13/+26
|
* Install /bin/sh safely. This allows a shell script to be usedru2004-03-181-0/+1
| | | | | | | to strip binaries by specifying it in the STRIPBIN environment variable honoured by install(1). MFC after: 3 days
* Fix 'ps -p proclist' and 'ps -u userlist' so the command returns non-zerogad2004-03-181-3/+13
| | | | | | | | if no processes were matched. Also sorts the list of 'int's in main, as long as I had to add another one... Noticed by: Nate Lawson MFC after: 10 days
* Improvements to 'ps -p <x>'. If <x> is a process id that does not exist, thengad2004-03-172-21/+104
| | | | | | | | | | | just print the header (if any) and exit, thus matching the behavior on -stable and other OS's. Also adds support for <x> being a comma-separated list of processes, and does a much better checking for invalid-values of <x>, such as 'ps -p someword'. Reviewed by: mentioned on freebsd-current MFC after: 10 days
* Fix memory leakcperciva2004-03-161-2/+2
| | | | | | | PR: bin/64321 Submitted by: Rodney Ruddock <rodney@interopsystems.com> MFOpenBSD: rev 1.17 MFC after: 3 days
OpenPOWER on IntegriCloud