Commit Graph

1437 Commits

Author SHA1 Message Date
tjr
313635fc7e Support the "--" end of options marker, useful to disambiguate between
signal numbers and process groups (negative pid arguments), and
required by SUSv3.
2002-06-13 08:07:20 +00:00
tjr
08e98db385 Don't list shell builtins when the hash command is used (SUSv3) 2002-06-13 07:50:50 +00:00
jmallett
d40b17fd5d ps(1) appeared in v4
Submitted by:	grog
2002-06-10 22:48:51 +00:00
tjr
b9ecc7e16c Sort sections, use Ex macro in Diagnostics section, point out that the first
example only works with csh(1).
2002-06-10 09:33:15 +00:00
tjr
c41ca971a6 Add History section. sleep appeared in v4. 2002-06-10 09:07:22 +00:00
jmallett
dcf74a7fe1 Note early appearence of some commands. These actually appeared in PWB, but
it seems we don't have a macro for that yet, so list them in the first UNIX
release since then that we have a .At for: v7.
2002-06-10 05:03:20 +00:00
keramida
3eeaf63c36 Use socklen_t for the length of a socket structure instead of `int'.
Reviewed by:	mike
2002-06-09 04:18:45 +00:00
keramida
b309515be2 Replace <strings.h> with <string.h>. No functions from the former are
used in this file, and strlen() needs to be prototyped by the latter,
for this to compile without warnings.

Reviewed by:	mike
2002-06-09 04:15:40 +00:00
mike
d86e0bcc0c Check the return value of getcwd() to avoid printf()ing a NULL. Mark
usage() as __dead2 to avoid a GCC warning.

Spotted by:	keramida
2002-06-09 00:46:24 +00:00
jmallett
ef26e821fb Allow whitespace to act as a delimiter in the keywords list given to the -o,
again, but also allow it in the user-specified header, too.  This is far more
backwards compatible and SUSv3-happy than allowing only comma to seperate the
keywords list.

Submitted by:	tjr
2002-06-08 18:11:52 +00:00
bde
fa2a4fdbfc Fixed unsorting. 2002-06-08 06:49:15 +00:00
jmallett
93d0005574 Don't say that the list of formats can be space delimited, it no longer can be.
Mention that more than one -o will concatenate formats.

Submitted by:	Jun Kuriyama <kuriyama@imgsrc.co.jp>
2002-06-08 05:47:46 +00:00
jmallett
01f3abcecd Back out previous back out of previously correct code.
Double-plus-pointy-hat to:	jmallett
Submitted by:			bde
2002-06-07 01:14:05 +00:00
jmallett
865fcaca35 Remove tunables to hide warnings that no longer exist. 2002-06-07 00:01:00 +00:00
jmallett
95a388cd9a Cast to long to match format. Hidden by revision 1.18 of Makefile. 2002-06-07 00:00:29 +00:00
jmallett
d11731ff43 Use a global `now' variable for the current time, and initialise it at
startup, right after calling setlocale(3).
2002-06-06 21:21:25 +00:00
jmallett
becd81c4a9 Implement a SUSv3-ignorant but "time"-similar format for "etime", elapsed
run time (NOT cpu time).  cputime() and elapsed() both need to honour SUSv3
now.
2002-06-06 21:18:37 +00:00
jmallett
b00060629b sysctlbyname(3) returns -1 on failure, not any other value < 0. 2002-06-06 20:59:15 +00:00
jmallett
b9515c4b9c Support the SUSv3 `rgroup' format.
Clean up some local style bogons.
2002-06-06 20:42:16 +00:00
jmallett
7916563c61 Cast arg_max to size_t when comparing it (times 4, plus 1) against SIZE_MAX. I
was worried about truncation of arg_max by this cast, but if it gets truncated,
we know it'll obviously be greater than SIZE_MAX anyway.

Big pointy hat to:	jmallett
Submitted by:		keramida
2002-06-06 20:29:39 +00:00
jmallett
562b4c0250 SUSv3 conform on the "comm" and "args" formats, and make correct the "command"
format, since it's BSDlike, and "comm" is actually different.
2002-06-06 20:21:47 +00:00
jmallett
c22ab1edea Refer to the command format by its SUSv3 name (comm), and list command as an
alias.
2002-06-06 18:10:12 +00:00
jmallett
3afc0fe273 As per behaviour on SVR4 systems, to allow any desirable type of header in the
override, seperate by comma (',') only, rather than any type of whitespace
(the literal space character (' ') had already been removed from this list).

This allows things like:
miamivice# ps -opid='Process
> Identifier'
Process
Identifier
              1350
              1445
              1450

To work.
2002-06-06 18:04:46 +00:00
tjr
8b3a40cd3f Document the -f and -v options of the unset builtin. 2002-06-06 04:12:50 +00:00
tjr
70c6f806e0 Quote the output of the no-argument form of the `set' builtin for re-input
to the shell.
2002-06-06 04:02:50 +00:00
tjr
c74ee6d523 Add the SUSv3 -p ("portable") option to both the export and readonly
builtins. This makes export/readonly print lines in the form
"export name=value".
2002-06-06 03:57:22 +00:00
tjr
d658a1e5c7 Don't modify output that is to be quoted if it contains no IFS characters
or shell metacharacters.
2002-06-06 03:29:23 +00:00
jmallett
e24090eb3a Widen the scope of fmt.c::1.19 and consistently use errx(3) if malloc(3) [or
realloc(3)] happens to fail, everywhere in ps(1).

Discussed with:	bde, charnier (a while ago)

fmt_argv() can no longer return NULL, so don't bother checking.

Submitted by:	bde
2002-06-05 18:11:25 +00:00
jmallett
9b75b96530 Comma seperate format lists, since space is no longer up to the task.
Poked by:	David Wolfskill <david@catwhisker.org>
Pointy hat to:	jmallett
2002-06-05 17:31:44 +00:00
jmallett
c2f44f7a37 Support the 'comm' keyword, which is equivalent to our 'command', but
specified by SUSv3.
2002-06-05 02:05:24 +00:00
jmallett
399bb45a09 A space cannot be a header string seperator it appears given the SUSv3
description of ps(1), which uses them.  I question whether newline and tab
can be either, but I'm not touching them.  Yet.
2002-06-05 02:01:46 +00:00
jmallett
d6bbfbe40b To comply with SUSv3, duplicate the variable contents for each given format,
so that multiple -ovar=header lines do not overwrite eachother.

This means that ps -ouser=USERNAME -ouser=WHO would now possibly print:
USERNAME WHO
juli     juli

Whereas before it would be:
WHO WHO
juli juli
2002-06-05 01:58:36 +00:00
jmallett
6cb17fa895 Returning NULL here if malloc(3) fails is silly, at this point in the codepath
we have't malloc(3)'d nearly as much as we probably will, so errx(3) away,
instead of waiting for something to fail yet again later on.
2002-06-05 01:36:30 +00:00
jmallett
b34dd0148d Remove an XXX comment that seems to be a tiny bit no longer pertinent. This
function seems to do the right thing, and is not a "stub", and whoever "marc"
is, he's had plenty of time to do "the real one", so don't wait around for
him any longer.
2002-06-05 01:33:54 +00:00
jmallett
66d6aa72a5 Use of zero here meant many things, NULL, '\0' (NUL), and 0. Sort it out. 2002-06-05 01:32:21 +00:00
jmallett
4dd8bac65f Use a const char * where it is meant to be used. There's no reason to try
to discard the const qualifier here.
2002-06-05 01:02:13 +00:00
jmallett
3139a6b754 Duplicate the pointer to the string containing the header so it does not get
frobbed when/if the pointer it is actually a part of gets freed.
2002-06-05 01:01:20 +00:00
tjr
71a01dad7b Display job status correctly when a pipeline is suspended. 2002-06-04 15:26:00 +00:00
tjr
da1177ce1d Describe finished jobs as "Done", not "Exit" (SUSv3) 2002-06-04 14:40:33 +00:00
tjr
ec349498c5 Don't output state' and current' fields for processes that aren't
leaders in -l option to jobs(1).
2002-06-04 14:37:13 +00:00
tjr
ba4116c514 Missing prototypes from previous commit. 2002-06-04 13:13:54 +00:00
tjr
de63da4c55 Correct minor spacing problem in output of jobs -l for pipelines. 2002-06-04 13:01:51 +00:00
tjr
33d27dd210 Quote alias values in the output of the alias(1) builtin so they are
suitable for re-input to the shell (SUSv3)
2002-06-04 12:59:12 +00:00
tjr
b3775d9e40 Respect setting of the COLUMNS environment variable (SUSv3) 2002-06-04 10:20:10 +00:00
tjr
c6efb66343 Ignore empty COLUMNS environment variable. COLUMNS should take precedence
over TTY width found via ioctl() (SUSv3)
2002-06-04 10:11:29 +00:00
tjr
25b36dd1e7 Correct history (again): V3 had a kill command, only it was in section 8,
not 1.
2002-06-03 14:59:49 +00:00
tjr
22070ef719 Correct History: sync(8) appeared in V4. 2002-06-03 14:48:33 +00:00
tjr
910511d3ed Correct History section: kill(1) appeared in V4, not V6. 2002-06-03 14:45:20 +00:00
tjr
0930ee47eb Fix typo causing ``fc -e'' to not work correctly. getopt() sets optarg,
not shoptarg.
2002-06-02 08:34:09 +00:00
tjr
0a9f255d03 Adding an entry to the history with H_ENTER moves libedit's internal
history cursor. Reset the cursor after adding the entry to the history
when doing ``fc -s'' so the output is correct.
2002-06-02 08:27:04 +00:00