summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
...
* In the sorting routine, sort by thread-id if two processes have the same PID.gad2004-06-231-0/+2
| | | | Submitted by: Cyrille Lefevre
* Fix some style bugs I introduced pointed out by bde. Also add a blankdwmalone2004-06-231-15/+23
| | | | | | line after the empty variable declarations. Reviewed by: md5
* Use nanoseconds and then lexicographic ordering when the seconds ofdwmalone2004-06-221-6/+42
| | | | | | | | the [acm]time are the same. I was going to use Scott's patch, but I couldn't get the style quite right, so I used a patch of my own. Submitted by: Scott Mitchell <scott+freebsd at fishballoon.org> MFC after: 3 weeks
* Get rid of a cast to '(void) ' on the return of a call to strcpy.gad2004-06-221-1/+1
|
* Oops. Undo that last 'const' change. It expects similar changes to somegad2004-06-222-13/+11
| | | | other files that I am not ready to commit yet...
* Add 'const' to a few places.gad2004-06-222-11/+13
| | | | | PR: bin/65803 Submitted by: Cyrille Lefevre
* When displaying the "COMMAND" field for system-processes and/or kernelgad2004-06-222-1/+4
| | | | | | | | | | threads, put the command name in square brackets instead of parenthesis. This matches NetBSD, and also seems to be what linux does. The sentence which is added to the man page is taken straight from NetBSD. PR: bin/65803 Submitted by: Cyrille Lefevre Obtained from: NetBSD
* Have `ps' return the cputimes for zombies, with the assumption thatgad2004-06-211-1/+1
| | | | | | | kvm_getprocs() will provide useful information if it can, or *it* will provide a zero value if it can not find something appropriate. Submitted by: bde
* Add the `-O emul' format option, which prints the name of the system-callgad2004-06-203-0/+13
| | | | | | | | emulation environment the process is in. "emul" as a keyword is picked up from OpenBSD. PR: bin/65803 Submitted by: Cyrille Lefevre
* From SUSv3:gad2004-06-201-1/+1
| | | | | | | | | | | Any [standard output] field need not be meaningful in all implementations. In such a case a hyphen ('-') should be output in place of the field value So have the `-O label' option print out the string " -" if the process has no label. Approved by: Silence from rwatson and green (when asked in March...)
* Add new output-format keywords of LWP and NLWP, which show the thread-idgad2004-06-201-0/+8
| | | | | | | | | | and number-of-threads tied to a process. Result can be seen by typing, e.g.: ps -HO lwp,nlwp These new options are not documented yet. More options will be coming, and I will update the man page after I get farther along. PR: bin/65803 (though adjusted to fit our present source) Submitted by: Cyrille Lefevre
* Have the main() routine calculate %CPU and (if needed) memory informationgad2004-06-202-36/+31
| | | | | | | when copying per-process info before starting to sort the list. This way, sort-by-CPU or sort-by-memory will only calculate values once-per-process, instead of twice-per-comparison. Also take advantage of this to simplify the pscomp() routine.
* Typo: s/SunOP/SunOS/g.maxim2004-06-161-2/+2
|
* style.Makefile(5)obrien2004-06-131-2/+2
|
* If we are asked to print the total number of blocks, do so even if wedas2004-06-081-12/+14
| | | | | | | | | | | | | have no entries to print (either due to an empty directory or an error). This makes the -l and -s options more consistent, like Solaris and (Debian) Linux. To make this happen, tweak two optimizations on the second call to display(): - Don't skip display() altogether, even if list == NULL. - Don't skip the call to the printfn in display() if we need to print the total. PR: 45723
* Remove from the printfns the assumption that dp->list != NULL. Evendas2004-06-081-2/+6
| | | | | if there are no entries, these functions may be called to print the total number of blocks (0) for consistency's sake.
* Remove a duplicated description of the test for the null string.yar2004-06-071-5/+0
| | | | MFC after: 3 days
* Describe how test(1) will evaluate its expressions for a symlink.yar2004-06-071-1/+13
| | | | | Inspired by: SUSv3 MFC after: 1 week
* Plug file descriptor leak in implementation of -n option.tjr2004-06-051-0/+1
|
* Convert fsbtoblk() from a macro to a function. The redundantdas2004-06-041-8/+13
| | | | | | | | | | instances of 64-bit arithmetic were costing 775 bytes, and the inlining offered no benefit. Moreover, ambiguity as to the argument types led to the introduction of a bug (see rev 1.56). Also, remove some casts that are now clearly redundant. Inspired by: 67467
* Plug small memory leak.le2004-06-031-0/+1
| | | | | | PR: bin/67392 Submitted by: Matthew Emmerton <matt@gsicomp.on.ca> MFC in: 1 week
* Try to change the isdigitch() macro to something that Bruce won't rollgad2004-06-011-3/+3
| | | | | his eyes at quite so much... (actually someone else pointed this out to me a long time ago, but apparently I never fixed it)
* A few more style-fixes from Bruce. The only non-cosmetic changegad2004-06-011-16/+9
| | | | | | is to drop a call to setuid() which has not been needed for years. Noticed by: bde
* Since I'm not ready to add the non-standard ADD_PS_LISTRESET feature,gad2004-06-011-26/+1
| | | | | remove the #ifdef for it for now. I might add the feature for real at some later date, there isn't much reason for the #ifdef for now.
* Make a few style-istic improvements to the previous commits.gad2004-06-011-16/+15
| | | | Noticed by: bde
* Fix so `ps' catches and complains about null-values specified for agad2004-06-011-3/+8
| | | | | | | process id, instead of using pid==0. Ie, `ps -p 12,' and `ps -p ,12' are now errors (instead of being treated like `ps -p 0 -p 12'). Noticed by: Cyrille Lefevre on freebsd-arch
* Additional tiny adjustment to kludge-option processing so `ps t p0'gad2004-06-011-6/+7
| | | | | | | | is treated like `ps -t p0', instead of changing it to `ps -T p0'. Note that `ps t' is still changed to `ps -T', since that is one of the main reasons for this kludge processing... Noticed by: Jilles Tjoelker on freebsd-arch
* Rewrite the kludge-option processing to improve how it handles a fewgad2004-06-011-62/+91
| | | | | | | | | | | | | | | | | | | | more special situations. This is the code which process `ps blah', when "blah" does not include a leading '-'. This change also removes a long-undocumented BACKWARD_COMPATIBILITY compile-time option, where: ps -options arg1 arg2 (with no '-' on "arg1" and "arg2") was treated as: ps -options -N arg1 -M arg2 This also changes `ps' to check for any additional arguments after processing all the '-'-options, and attempt to use those arguments as a pid or pidlist. If an extra argument is not a valid pidlist, then `ps' will print an error and exit. This seems a more generally useful extension of the kludge-option processing than the -N/-M behavior, and has fewer confusing side-effects. Reviewed by: freebsd-arch
* Use humanize_number(3).pjd2004-05-252-60/+7
| | | | Reminded by: jhb
* Add pgrep(1) and pkill(1) to the cross-reference section of ps(1).gad2004-05-251-0/+2
|
* Use humanize_number(3) to format sizes into a human readable form.pjd2004-05-242-88/+19
|
* Include <stdio.h> for a sprintf() prototype.stefanf2004-05-241-0/+2
| | | | Approved by: das (mentor)
* Add the 'sid' info to the output of `ps -j', to make up for the 'sess'gad2004-05-232-2/+2
| | | | | | | (session-pointer) info which was dropped from `ps' earlier in 5.x. PR: bin/59423 Submitted by: Jilles Tjoelker
* Fix the kludge-old-options processing so `ps tpt' will be treated thegad2004-05-231-4/+5
| | | | | | | | same as `ps -tpt', instead of being changed into `ps -tpT'. PR: bin/52489 Submitted by: Jilles Tjoelker MFC after: 1 week
* Change `ps' to use the KERN_PROC_RGID and KERN_PROC_SESSION optionsgad2004-05-221-8/+5
| | | | | | | | (if trying to match only one real-group or one session-id), now that those options are implemented in src/sys/kern/kern_proc.c (v1.203). PR: bin/65803 (a very tiny piece of the PR) Submitted by: Cyrille Lefevre
* Assorted markup fixes.ru2004-05-161-209/+227
|
* Punctuation.ru2004-05-161-1/+1
|
* Fixed spelling of the document date.ru2004-05-161-2/+2
|
* Bump document date for the latest functional change.ru2004-05-162-11/+12
| | | | Minor markup tweaks.
* DESCRIPTION was not updated for the new SYNOPSIS.ru2004-05-161-6/+7
|
* Added -v to usage().ru2004-05-161-1/+1
|
* Use WARNS?=3 for these in the arm case for now, due to toolchain issues.cognet2004-05-141-0/+4
|
* 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.
OpenPOWER on IntegriCloud