Commit Graph

1868 Commits

Author SHA1 Message Date
maxim
0593a5cf63 Typo: s/SunOP/SunOS/g. 2004-06-16 12:57:31 +00:00
obrien
fd072ddeb0 style.Makefile(5) 2004-06-13 19:22:53 +00:00
das
7a9a1abd40 If we are asked to print the total number of blocks, do so even if we
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
2004-06-08 09:30:10 +00:00
das
e79220be15 Remove from the printfns the assumption that dp->list != NULL. Even
if there are no entries, these functions may be called to print the
total number of blocks (0) for consistency's sake.
2004-06-08 09:27:42 +00:00
yar
b6777db5c3 Remove a duplicated description of the test for the null string.
MFC after:	3 days
2004-06-07 12:47:31 +00:00
yar
567ef40f7c Describe how test(1) will evaluate its expressions for a symlink.
Inspired by:	SUSv3
MFC after:	1 week
2004-06-07 12:42:38 +00:00
tjr
910a337577 Plug file descriptor leak in implementation of -n option. 2004-06-05 02:32:21 +00:00
das
a1578f8ca1 Convert fsbtoblk() from a macro to a function. The redundant
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
2004-06-04 09:30:51 +00:00
le
2d21611274 Plug small memory leak.
PR:             bin/67392
Submitted by:   Matthew Emmerton <matt@gsicomp.on.ca>
MFC in:         1 week
2004-06-03 15:04:00 +00:00
gad
77ecbca56f Try to change the isdigitch() macro to something that Bruce won't roll
his eyes at quite so much...  (actually someone else pointed this out
to me a long time ago, but apparently I never fixed it)
2004-06-01 23:27:11 +00:00
gad
60e8e40dcb A few more style-fixes from Bruce. The only non-cosmetic change
is to drop a call to setuid() which has not been needed for years.

Noticed by:	bde
2004-06-01 22:19:16 +00:00
gad
cada0251dc Since I'm not ready to add the non-standard ADD_PS_LISTRESET feature,
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.
2004-06-01 19:00:42 +00:00
gad
a100c13940 Make a few style-istic improvements to the previous commits.
Noticed by:	bde
2004-06-01 18:12:04 +00:00
gad
e731d42790 Fix so `ps' catches and complains about null-values specified for a
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
2004-06-01 03:01:51 +00:00
gad
5fd6ebe556 Additional tiny adjustment to kludge-option processing so `ps t p0'
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
2004-06-01 02:31:44 +00:00
gad
021eb8fec4 Rewrite the kludge-option processing to improve how it handles a few
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
2004-06-01 02:03:21 +00:00
pjd
cf0d941cbc Use humanize_number(3).
Reminded by:	jhb
2004-05-25 14:53:47 +00:00
gad
3ae386f0f4 Add pgrep(1) and pkill(1) to the cross-reference section of ps(1). 2004-05-25 14:05:25 +00:00
pjd
00ba733985 Use humanize_number(3) to format sizes into a human readable form. 2004-05-24 22:22:29 +00:00
stefanf
5b88d9b80f Include <stdio.h> for a sprintf() prototype.
Approved by:	das (mentor)
2004-05-24 10:11:31 +00:00
gad
b306a280d2 Add the 'sid' info to the output of `ps -j', to make up for the 'sess'
(session-pointer) info which was dropped from `ps' earlier in 5.x.

PR:		bin/59423
Submitted by:	Jilles Tjoelker
2004-05-23 21:35:35 +00:00
gad
0474dcf34b Fix the kludge-old-options processing so `ps tpt' will be treated the
same as `ps -tpt', instead of being changed into `ps -tpT'.

PR:		bin/52489
Submitted by:	Jilles Tjoelker
MFC after:	1 week
2004-05-23 21:21:07 +00:00
gad
02b7ff88ea Change `ps' to use the KERN_PROC_RGID and KERN_PROC_SESSION options
(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
2004-05-22 23:13:58 +00:00
ru
7c9db78ce6 Assorted markup fixes. 2004-05-16 21:35:05 +00:00
ru
ae79646ad9 Punctuation. 2004-05-16 21:34:49 +00:00
ru
ee95a80180 Fixed spelling of the document date. 2004-05-16 21:34:31 +00:00
ru
338f050222 Bump document date for the latest functional change.
Minor markup tweaks.
2004-05-16 21:34:15 +00:00
ru
414a4ac92c DESCRIPTION was not updated for the new SYNOPSIS. 2004-05-16 21:33:48 +00:00
ru
ef7ae94c87 Added -v to usage(). 2004-05-16 20:41:11 +00:00
cognet
548b0bdf38 Use WARNS?=3 for these in the arm case for now, due to toolchain issues. 2004-05-14 13:31:21 +00:00
tjr
29e5113dea Only add the widths together for printable characters in prn_normal();
unprintable characters have a "width" of -1.
2004-05-03 11:48:55 +00:00
tjr
94b5610007 Treat filenames as multibyte character strings (according to the current
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.
2004-05-02 11:25:37 +00:00
das
7a3d9994db Various quibbles:
- 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.
2004-04-28 01:27:36 +00:00
obrien
5a20695040 Fix some style issues in rev 1.58.
Use 64-bit integer math vs. mixed FP & integer.
Add -g to the usage().
2004-04-22 17:05:08 +00:00
obrien
e8080c6d24 Add 'g' to SYNOPSIS. 2004-04-22 16:33:54 +00:00
obrien
a29d7229cd Fix printing of the "Mounted on" values for 'df -i'.
Fix spacing before "Mounted on" column in general.

Submitted by:	bde
2004-04-22 16:26:05 +00:00
obrien
4462face4e Add -c option simular to du(1).
PR:		19635
Submitted by:	cyrille.lefevre@laposte.net
2004-04-18 20:56:31 +00:00
green
3f49d29659 Document the "return" built-in better: it will exit . (sources) and
the top-level shell instance, too.
2004-04-14 15:58:50 +00:00
njl
be3c824822 Style fixes and add gen to CLEANFILES.
Submitted by:	bde
2004-04-09 07:13:27 +00:00
green
65e2cfe074 Give date(1) a much better SYNOPSIS section which is useful as more than
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.
2004-04-06 22:03:38 +00:00
markm
0336d895cd Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
gad
a3fdd69ecb Drop the include of <stdint.h>, since r1.84 removed references of intmax_t. 2004-04-04 17:43:48 +00:00
gad
3af54ea26e Add back the `-e' option, which was mistakenly dropped when cleaning
up the PS_ARGS string in revision 1.69 (and which was apparently not
missed by anyone...).
2004-04-04 17:15:44 +00:00
gad
7bb4d45ef8 Give a name of 'l' (list) to the union in struct listinfo. This is
because some compilers (such as gcc 2.95.4) do not support having an
unnamed union for a field in a struct.
2004-04-04 04:41:51 +00:00
bmilekic
647416eb9f Stop iterating over ACLs if we've already determined we
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>
2004-04-03 16:55:56 +00:00
gad
0c94e316aa Add spaces after flag names on .Fl macros.
Noticed by:	ru
MFC after:	4 days
2004-04-01 13:28:36 +00:00
gad
6e145dcd55 Describe the sorting options in better and more complete detail.
Also improve the description of `-L' a little.

MFC after:	4 days
2004-03-31 23:51:12 +00:00
gad
e4a143a3f5 Switch to using strtoul() for parsing a potential UID or GID, which gets
this to correctly handle UID's and GID's larger than 2147483647.

Noticed by:	bde
MFC after:	1 week
2004-03-30 04:20:33 +00:00
gad
0cf1ff6e50 Bruce would really like the prototype for fmt() to be split across lines
this way (although I still think it "looks weird"...).

Requested by:	bde
MFC after:	1 week
2004-03-30 02:02:40 +00:00
gad
00c1b0c660 Minor style fixes, mostly adding indent-protection on some comment-blocks.
Noticed by:	bde
MFC after:	1 week
2004-03-30 01:59:22 +00:00