Commit Graph

1694 Commits

Author SHA1 Message Date
Juli Mallett
6953dff37c Use size_t consistently and complete some uncompleted code resulting in a
memory leak by assigning and freeing a variable appropriately as well as
keeping track of the amount of allocated ram properly.

MFC after:	1 month
2002-06-20 06:00:51 +00:00
Juli Mallett
0e6c085ae6 We have a place for extern declarations of global variables in ed.h, do not
use main() to do it locally.
2002-06-20 05:28:02 +00:00
Juli Mallett
4e17884ffe Remove two unused variables. 2002-06-20 05:21:43 +00:00
Juli Mallett
8b7808bc49 Minor const cleanup.
Don't discard qualifiers we don't need to discard.
2002-06-20 05:20:50 +00:00
Tim J. Robbins
029c8ee4fa Bring documentation on CDPATH and its effects on cd(1) back into sync with
reality (and POSIX): current directory isn't searched unless CDPATH has
a "." element or is unset.

PR:		38442
Submitted by:	oleg dashevskii <be9@be9.ru>
MFC after:	1 week
2002-06-19 12:04:22 +00:00
Tim J. Robbins
9a81395d08 When trying to emulate a cross-device move operation with cp and rm, add
a "--" argument after the options so filenames with leading dashes are
handled correctly.

PR:		39318
Submitted by:	Serge van den Boom <svdb@stack.nl>
MFC after:	1 week
2002-06-16 04:06:58 +00:00
Juli Mallett
ca2be2ff45 Use an usage() rather than doing the fprintf inside option parsing. 2002-06-14 09:54:48 +00:00
Tim J. Robbins
f9dc2a8b93 When -R is not specified, fail to copy the contents of dangling symlinks
instead of making a copy of the link itself (SUSv3)

Obtained from:	NetBSD
2002-06-13 15:48:36 +00:00
Tim J. Robbins
bf5f0c446e Print the "$" symbol on blank lines when the -s and -e options are used
together.

Obtained from:	OpenBSD (millert, Denis Afonin)
2002-06-13 14:05:26 +00:00
Tim J. Robbins
99cc224074 Remove bogus "-" operand from usage message. There is no restriction on
where it may be placed, it is treated the same as the file arguments.
2002-06-13 13:45:14 +00:00
Tim J. Robbins
993895ac33 Markup nits: use the Ar macro when describing the -signal_name and
-signal_number options, and for referring to the "pid" argument.
2002-06-13 08:46:01 +00:00
Tim J. Robbins
16a6357c9b Add examples and diagnostics sections 2002-06-13 08:40:01 +00:00
Tim J. Robbins
08de34ac01 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
Tim J. Robbins
83952a118b Don't list shell builtins when the hash command is used (SUSv3) 2002-06-13 07:50:50 +00:00
Juli Mallett
7140a0e9f1 ps(1) appeared in v4
Submitted by:	grog
2002-06-10 22:48:51 +00:00
Tim J. Robbins
43d088bea2 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
Tim J. Robbins
91c0081804 Add History section. sleep appeared in v4. 2002-06-10 09:07:22 +00:00
Juli Mallett
a13d4e42c2 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
Giorgos Keramidas
e02ef09616 Use socklen_t for the length of a socket structure instead of `int'.
Reviewed by:	mike
2002-06-09 04:18:45 +00:00
Giorgos Keramidas
a7c1ac2f62 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 Barcroft
f3a09c6c9b 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
Juli Mallett
2dda9fe910 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
Bruce Evans
b3a3c64940 Fixed unsorting. 2002-06-08 06:49:15 +00:00
Juli Mallett
50355bb408 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
Juli Mallett
6bb72963c0 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
Juli Mallett
eb7891df6c Remove tunables to hide warnings that no longer exist. 2002-06-07 00:01:00 +00:00
Juli Mallett
c3f1b5a9db Cast to long to match format. Hidden by revision 1.18 of Makefile. 2002-06-07 00:00:29 +00:00
Juli Mallett
ba2cd77062 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
Juli Mallett
76e1a9fe48 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
Juli Mallett
4049699b95 sysctlbyname(3) returns -1 on failure, not any other value < 0. 2002-06-06 20:59:15 +00:00
Juli Mallett
e8eef4bb45 Support the SUSv3 `rgroup' format.
Clean up some local style bogons.
2002-06-06 20:42:16 +00:00
Juli Mallett
3d0d5dccc1 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
Juli Mallett
033340171a 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
Juli Mallett
badfdad910 Refer to the command format by its SUSv3 name (comm), and list command as an
alias.
2002-06-06 18:10:12 +00:00
Juli Mallett
40fea9c3a5 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
Tim J. Robbins
8b34ad92a2 Document the -f and -v options of the unset builtin. 2002-06-06 04:12:50 +00:00
Tim J. Robbins
592588448e 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
Tim J. Robbins
45086f8cf6 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
Tim J. Robbins
dee75cf75d 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
Juli Mallett
4fa7d7880d 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
Juli Mallett
c0716492d4 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
Juli Mallett
d9cd71b6e1 Support the 'comm' keyword, which is equivalent to our 'command', but
specified by SUSv3.
2002-06-05 02:05:24 +00:00
Juli Mallett
cf77c2ce9c 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
Juli Mallett
6d041cc856 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
Juli Mallett
05051e2898 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
Juli Mallett
86f54b9fb8 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
Juli Mallett
b69566d8e1 Use of zero here meant many things, NULL, '\0' (NUL), and 0. Sort it out. 2002-06-05 01:32:21 +00:00
Juli Mallett
fdbec39885 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
Juli Mallett
a89d0c4dbc 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
Tim J. Robbins
5b96a60711 Display job status correctly when a pipeline is suspended. 2002-06-04 15:26:00 +00:00
Tim J. Robbins
5179c2f25f Describe finished jobs as "Done", not "Exit" (SUSv3) 2002-06-04 14:40:33 +00:00
Tim J. Robbins
cb1a4fb419 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
Tim J. Robbins
d982b3a5f6 Missing prototypes from previous commit. 2002-06-04 13:13:54 +00:00
Tim J. Robbins
41d09fe083 Correct minor spacing problem in output of jobs -l for pipelines. 2002-06-04 13:01:51 +00:00
Tim J. Robbins
e5341cbb17 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
Tim J. Robbins
4f18100d73 Respect setting of the COLUMNS environment variable (SUSv3) 2002-06-04 10:20:10 +00:00
Tim J. Robbins
a28edf9a4a Ignore empty COLUMNS environment variable. COLUMNS should take precedence
over TTY width found via ioctl() (SUSv3)
2002-06-04 10:11:29 +00:00
Tim J. Robbins
1be157dc3d Correct history (again): V3 had a kill command, only it was in section 8,
not 1.
2002-06-03 14:59:49 +00:00
Tim J. Robbins
1114f20173 Correct History: sync(8) appeared in V4. 2002-06-03 14:48:33 +00:00
Tim J. Robbins
e3623a80a4 Correct History section: kill(1) appeared in V4, not V6. 2002-06-03 14:45:20 +00:00
Tim J. Robbins
ee6712f2f9 Fix typo causing ``fc -e'' to not work correctly. getopt() sets optarg,
not shoptarg.
2002-06-02 08:34:09 +00:00
Tim J. Robbins
32c077867c 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
Tim J. Robbins
39dccc6f6d Implement $PPID, the parent process ID of the shell. 2002-06-01 02:14:48 +00:00
Tim J. Robbins
f63d6dbfc9 Support the remaining job ID formats required by SUSv3:
%+ (current job, same as %%),
%- (previous job),
%?str (job with "str" in its command name).
2002-06-01 01:51:42 +00:00
Tim J. Robbins
ad8a075902 Add -s (output PID's only) and -l (show PID's) options to the jobs(1)
builtin. Modify the output format to match what SUSv3 requires.
2002-05-31 14:04:23 +00:00
Tim J. Robbins
bdfc15df5e #if JOBS around a job control-related statement to allow compilation with
job control disabled.
2002-05-31 13:10:38 +00:00
Tim J. Robbins
e3f3094912 Break the code to display status info for one job out from showjobs() into
showjob(), use it inside dowait() to display status info for consistency,
and in a format closer to what the standard requires.
2002-05-31 13:07:05 +00:00
Tim J. Robbins
3771ef59ae Move job to front of most recently used job list when bg'd or fg'd. 2002-05-31 12:35:34 +00:00
Tim J. Robbins
d86825beb8 Instead of keeping just the jobid of the most recently bg'd or fg'd job,
keep a linked list of the jobs, most recently used first. This is required
to support the idea of `previous job', and to allow the jobs fg and bg
default to be correct according to POSIX.
2002-05-31 12:31:23 +00:00
Ruslan Ermilov
36588206d0 mdoc(7) police: kill hard sentence breaks. 2002-05-30 14:10:44 +00:00
Tim J. Robbins
e9393a92a6 Reject options, handle "--" correctly in unlink(1). 2002-05-30 01:05:15 +00:00
Tim J. Robbins
dab94652b1 Reject options, handle "--" end-of-options marker in link(1). 2002-05-30 00:57:38 +00:00
Ruslan Ermilov
2d341e5cc3 mdoc(7) police: punctuation. 2002-05-29 18:52:02 +00:00
Ruslan Ermilov
81e9cda2c9 mdoc(7) police: tidy up the markup a bit. 2002-05-29 15:38:59 +00:00
Ruslan Ermilov
9dfcbc3b12 mdoc(7) police: markup nits. 2002-05-29 15:18:35 +00:00
Ruslan Ermilov
3f0e2b01ff mdoc(7) police: markup nits. 2002-05-29 15:09:49 +00:00
Ruslan Ermilov
3ed30dee85 mdoc(7) police: punctuation. 2002-05-29 15:06:24 +00:00
Ruslan Ermilov
7b3e3e39c7 mdoc(7) police: replace the XXX with the correct width. 2002-05-29 14:01:27 +00:00
Marcel Moolenaar
52183d0145 Add uuidgen(2) and uuidgen(1).
The uuidgen command, by means of the uuidgen syscall, generates one
or more Universally Unique Identifiers compatible with OSF/DCE 1.1
version 1 UUIDs.

From the Perforce logs (change 11995):

Round of cleanups:
o  Give uuidgen() the correct prototype in syscalls.master
o  Define struct uuid according to DCE 1.1 in sys/uuid.h
o  Use struct uuid instead of uuid_t. The latter is defined
   in sys/uuid.h but should not be used in kernel land.
o  Add snprintf_uuid(), printf_uuid() and sbuf_printf_uuid()
   to kern_uuid.c for use in the kernel (currently geom_gpt.c).
o  Rename the non-standard struct uuid in kern/kern_uuid.c
   to struct uuid_private and give it a slightly better definition
   for better byte-order handling. See below.
o  In sys/gpt.h, fix the broken uuid definitions to match the now
   compliant struct uuid definition. See below.
o  In usr.bin/uuidgen/uuidgen.c catch up with struct uuid change.

A note about byte-order:
        The standard failed to provide a non-conflicting and
unambiguous definition for the binary representation. My initial
implementation always wrote the timestamp as a 64-bit little-endian
(2s-complement) integral. The clock sequence was always written
as a 16-bit big-endian (2s-complement) integral. After a good
nights sleep and couple of Pan Galactic Gargle Blasters (not
necessarily in that order :-) I reread the spec and came to the
conclusion that the time fields are always written in the native
by order, provided the the low, mid and hi chopping still occurs.
The spec mentions that you "might need to swap bytes if you talk
to a machine that has a different byte-order". The clock sequence
is always written in big-endian order (as is the IEEE 802 address)
because its division is resulting in bytes, making the ordering
unambiguous.
2002-05-28 06:16:08 +00:00
Tim J. Robbins
45457c7dd2 Note that the lutimes(2) and lchflags(2) syscalls also do not follow symlinks.
Remove incorrect examples.

PR:		25016
Submitted by:	Martin Kammerhofer, Joshua Goodall
2002-05-26 12:51:38 +00:00
Tim J. Robbins
f59d6e4762 Add lchmod(2) to the list of syscalls that do not follow symbolic links. 2002-05-26 12:12:36 +00:00
Tim J. Robbins
fc482908be sh appeared in Version 1, not System V.1. 2002-05-25 12:18:27 +00:00
Tim J. Robbins
d513af6a66 Implement `set +o', which displays the currently set options in a format
suitable for re-input into the shell.
2002-05-25 12:11:58 +00:00
Tim J. Robbins
09086b0499 Bring back the cd -L and -P options from revision 1.24, but try harder not
to fail when the logical current directory no longer exists. Allow changes
to absolute paths when logical cwd is invalid, fall back to physical cd
if logical cd fails.
2002-05-22 05:15:53 +00:00
Tim J. Robbins
baf3e7c14b Temporarily back out revision 1.24; it seems to handle the case where the
current directory no longer exists incorrectly and breaks `make cleandir'.
2002-05-22 03:29:20 +00:00
Tim J. Robbins
178897f127 Add the SUSv3 -L and -P options to the cd and pwd builtin utilities. `Logical'
handling of .. is now the default.
2002-05-20 07:54:39 +00:00
Juli Mallett
9e3bfadea8 Remove a small, annoying, nit I ran in to editing this file, a lone tab
on a line by itself.
2002-05-19 17:50:23 +00:00
Tim J. Robbins
1b5a48ff88 Implement the -u (-o nounset) option, which gives an error message if
an unset variable is expanded.

Obtained from:	NetBSD (bjh21, christos)
2002-05-19 08:30:16 +00:00
Tim J. Robbins
addcdbb29f Make the fg and bg commands give the output required by SUSv3.
fg outputs the name of the command, bg outputs the name of the command
and the job id.
2002-05-19 07:27:26 +00:00
Tim J. Robbins
1a958c6653 Implement the -C (-o noclobber) option, which prevents existing regular
files from being overwritten by shell redirection.
2002-05-19 06:03:05 +00:00
Tim J. Robbins
94274c73cb Add missing options required by SUSv3:
-m	List files across the page, separated by commas.
-p	Print a slash after directory names
-x	Same as -C but sort across the columns rather than down

Submitted by:	Kyle Martin <mkm@ieee.org>
2002-05-19 02:51:36 +00:00
Ian Dowse
85ed93337f Unconditionally update the maximum field width statistics when we
refetch the filesystem information in MNT_WAIT mode. This avoids
incorrect column alignment that sometimes occurs with NFS filesystems.

Submitted by:	Ian <freebsd@damnhippie.dyndns.org>
2002-05-18 21:10:40 +00:00
Tim J. Robbins
1e7e78dca4 Back out part of previous commit: make -P the default again until I'm
convinced it's a good idea.
2002-05-18 13:52:07 +00:00
Tim J. Robbins
6873c4b7aa Make -L the default, allow both -L and -P to be specified (last one used
matters), fall back to -P mode if we can't get the logical directory.
2002-05-18 02:47:25 +00:00
Andrey A. Chernov
486d038778 Optimize prev. commit code a bit 2002-05-17 12:24:19 +00:00
Andrey A. Chernov
27d3ae3587 Trailing slash fixes.
Fix the case:
        cp file nonexistent/
which create nonextstent as file while trailing slash clearly indicates
that nonexistent must be a directory.
Also fix the case:
	cp file1 file2/
which should produce error.
2002-05-17 11:52:48 +00:00
Juli Mallett
71e092d1bb Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in the
CURRENT <paths.h>.
2002-05-17 11:38:48 +00:00
Josef Karthauser
d883e289b9 The sysctl has changed from 'kern.ps_showallprocs' to
'security.bsd.see_other_uids'.
2002-05-16 11:51:05 +00:00
Tom Rhodes
4481bee462 more file system > filesystem 2002-05-16 03:51:38 +00:00
Tom Rhodes
ebd4324457 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
Bill Fumerola
568dcd5fca restore missing default case removed in ls.c:r1.57
add break statements to default cases where missing.

Submitted by:	bde
2002-05-15 18:53:56 +00:00
Juli Mallett
0928a7f16f Make 'user' and 'group' const as to not discard the qualifier from the
functions we use to assign them.  Doesn't seem to be anything else that
relies on these being non-const.
2002-05-15 09:49:59 +00:00
Juli Mallett
ff5e253326 Remove an empty default case to make this syntactically correct. Not there
is as good as blaknk.
2002-05-15 09:43:52 +00:00
Poul-Henning Kamp
532aff98f6 Remove the private code for reading UFS superblocks, this does not belong
in df(1) when we have multiple filesystem types, and the complications of
handling UFS2 pushes this over the edge.

Use the .../mount/extern.h to get prototypes of the functions we
borrow from there.  Constify things to match.  (why aren't these
functions in a lib anyway ?)

Make everything static and set WARNS?=5.

The way the "df diskdevice" thing works for unmounted diskdevices
is not very general.

Sponsored by: DARPA & NAI Labs.
2002-05-12 19:24:09 +00:00
Chris D. Faulhaber
c01df1d365 Add semicolon to empty default case to silence warning. 2002-05-11 03:12:02 +00:00
Garrett Wollman
94a48596a3 EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,
and -e reflects the historic behavior of FreeBSD's expr.
2002-05-11 03:08:12 +00:00
Alfred Perlstein
033be9ae81 while i'm breaking stuff, use __dead2 instead of GCC specific __attribute__. 2002-05-11 01:25:54 +00:00
Alfred Perlstein
46d560550a backout additional include of cdefs.h, it's not helping any. 2002-05-11 01:24:39 +00:00
Alfred Perlstein
dfe7e2f8ff include cdefs.h for __printf0like to silence warning. 2002-05-11 00:54:33 +00:00
Chris D. Faulhaber
75a011263c Add semicolon to empty default case to silence warning. 2002-05-11 00:45:01 +00:00
Alfred Perlstein
64baebf95b Add semicolon to empty default case to silence warning. 2002-05-11 00:21:00 +00:00
Garrett Wollman
1393277e29 The response to my POSIX interpretation request says that `expr'
is required to be oblivious to overflow and to use the data type `long'.
(Division by zero is undefined in ISO C so it's still OK to check for it
here.)  Add a new `-e' flag to get the old, more useful behavior.
2002-05-10 22:59:29 +00:00
David E. O'Brien
189d266f08 Remove gCC'isms. 2002-05-10 01:48:15 +00:00
Josef Karthauser
1063e12617 Replace /kernel with /boot/kernel/kernel.
PR:		docs/37757
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
Dag-Erling Smørgrav
99b82bb76a Use <paths.h> rather than "pathnames.h", and fix a couple of whitespace nits.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:47:01 +00:00
Juli Mallett
634d96e194 Check for possible overflow from sysconf _SC_ARG_MAX and error out in a
correct manner.  Revert my incorrect change to use err(3) for malloc(3)
failing.  Use a size_t variable to store the size of the argument buffer
we allocate, and remove silly casts as the result of having this around.
Modify the math in some of the paranoid checks for buffer overflow to
account for the fact we now are dealing with the actual size of the
buffer.  Remove the static qualifier for arg_max, and the bogus setting
of it to -1.

Include <limits.h> for the definitions we use to check for possible
overflows.

Submitted by:	bde
2002-05-05 04:42:50 +00:00
Juli Mallett
3d674c947c Don't cast incorrectly to malloc(3), and don't use errx(3) if malloc(3)
returns NULL, as malloc(3) sets errno.  Use err(3).
2002-05-02 05:46:37 +00:00
Mark Murray
4b1b25d919 Reorder for style. 2002-04-28 13:54:45 +00:00
Garrett Wollman
96ab7da385 Provide an environment variabloe, EXPR_COMPAT, which disables option
parsing for compatibility with old implementations.
2002-04-22 21:23:09 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Philippe Charnier
f4e4fcd30d Use `The .Nm utility' 2002-04-21 12:53:08 +00:00
Philippe Charnier
874506698f Use `The .Nm utility' 2002-04-20 11:58:12 +00:00
Maxime Henrion
7eab3d347b Add a reference to the kenv(2) manpage. 2002-04-18 18:49:41 +00:00
Ruslan Ermilov
71b3ac84e1 Replaced exists() tests with two equivalent defined().
LIBDIR is defined in bsd.own.mk but sys.mk no longer
includes bsd.own.mk as of revision 1.60.
2002-04-18 07:01:35 +00:00
Maxime Henrion
41196280ac Use the new functionalities provided by the kenv(2) syscall.
Reviewed by:	peter
2002-04-17 13:08:14 +00:00
Philippe Charnier
e004acc891 Use `The .Nm utility' 2002-04-16 20:08:06 +00:00
Philippe Charnier
093e3ce74f ls(1) is utility not function 2002-04-16 20:03:54 +00:00
Tom Rhodes
63b3046fd5 s/CMOS/hardware as talked about on cvs-committers.
Suggested by:   sheldonh
Approved by:	bde
MFC after:	1 day
2002-04-16 14:28:47 +00:00
Tom Rhodes
dfbea8a5ee Little nit pick in date(1) manual page, tell users which clock date(1)
sets

PR:		35606
2002-04-15 18:05:14 +00:00
George C A Reid
4c7e4a544a Stop a null pointer dereference in the builtin hash function.
PR:		36141
Approved by:	cracauer
MFC after:	1 week
2002-04-15 15:49:30 +00:00
John W. De Boskey
b744b6caf9 Document option to option dependancy. Fix typo.
MFC after:	1 week
2002-04-15 02:21:12 +00:00
Philippe Charnier
c113db6945 Do not return(f_returning_void());. Spell FALLTHROUGH to make it lint()able. 2002-04-12 20:23:51 +00:00
Bosko Milekic
e5f7f97622 Introduce NO_RCMNDS flag so as to not compile rsh, rlogin, and rcp on will,
and document in share/examples/etc/make.conf

Submitted by: Aleksandar Simic <asimic@dsl.pipex.com>
MFC after: 1 week
2002-04-09 18:25:44 +00:00
Chris D. Faulhaber
a5b0f3020c errx()/strerror() -> err() 2002-04-07 04:59:13 +00:00
Giorgos Keramidas
80c7362ce3 Various mdoc fixes, including a change that corrects spacing as
described in PR docs/36461.

PR:		docs/36461
Noticed by:	Gary W. Swearingen <swear@blarg.net>
Submitted by:	ru
2002-03-31 20:49:37 +00:00
Andrey A. Chernov
82ea3997c1 Use intmax_t as quad_t replacement, like in expr 2002-03-28 16:30:42 +00:00
Ian Dowse
62edbd31c7 Make the columns in the output of df(1) line up, even for very large
filesystems. We now keep track of the maximum width required for
every variable-width field instead of just the first one.

PR:		bin/15510
MFC after:	1 week
2002-03-26 20:32:37 +00:00
Ruslan Ermilov
9f1207d517 Install sys/security/lomac/*.h to /usr/include/security/lomac/.
Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

PR:		docs/29534

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>.  Three years is enough to be aware of
the change, and these weren't visible in the SHARED=symlinks
case.

Back out include/Makefile,v 1.160 that was a null change anyway
due to the bug in the path, and we now don't want to install
these headers because they would otherwise be invisible in the
SHARED=symlinks case.

Don't install IPFILTER headers.  Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR:		bin/28002

Prodded by:	bde
MFC after:	2 weeks
2002-03-26 16:05:14 +00:00
Mark Murray
55fad6bb0f Replace use of __progname with the functionally identical and more
acceptable getprogname(3).
2002-03-24 14:56:55 +00:00
Garrett Wollman
efbb5e2289 Disable -Werror when building -- the old version of gcc used on IA32 can't
deal with C99 formats.
2002-03-23 00:44:00 +00:00
Garrett Wollman
dc2f94a3ff Typo (if => of). 2002-03-22 20:49:29 +00:00
Garrett Wollman
7316a9465e Add a word of caution about integer arithmetic range and overflow detection. 2002-03-22 20:46:59 +00:00
Garrett Wollman
f477880a4f Fix a few formatting brainos and make the formatting of the EXAMPLES
section somewhat clearer.
2002-03-22 20:38:44 +00:00
Garrett Wollman
f07e42470f Make expr POSIX-compliant, and fix some bugs. Specifically:
- expr must conform to the Utility Syntax Guidelines, so use
getopt() to eat the (non-existent) options.

- Use the Standard type intmax_t for arithmetic.

- If an argument cannot be *completely* converted to an integer, then
it is a string.

Additionally make some style cleanups near the modified lines.  This
utility is still not completely style-compliant.
2002-03-22 20:18:26 +00:00
David E. O'Brien
0302f42b51 Update SCM ID. 2002-03-22 19:52:59 +00:00
David E. O'Brien
12767b8463 Note that -n is non-standard. 2002-03-22 19:52:48 +00:00
Mark Murray
d080dfa558 No need to cast; ().gr_gid is already the correct type. 2002-03-22 15:54:44 +00:00
David E. O'Brien
dce742c573 Add the -n option, which automatically answers "no" to the overwrite question. 2002-03-22 07:45:36 +00:00
Warner Losh
f1bb2cd2aa remove __P 2002-03-22 01:22:50 +00:00
Ruslan Ermilov
1640d4e019 mdoc(7) police: use precise width specifier. 2002-03-15 14:21:13 +00:00
Robert Watson
7774db9751 NAI DBA update. 2002-03-14 21:51:00 +00:00
Mark Murray
afa5289a98 1) Rev.1.35 of dd.c has a more serious regression. It backs out rev.1.31,
thus breaking systems with unpolluted <sys/stat.h>'s.

2) Back out an initialisation of a variable in BSS.

Reported by:	bde (1), many(2)
2002-03-07 14:00:33 +00:00
Maxim Konovalov
89a3a364c2 Log:
Remove eaccess(2) absence workaround. Add eaccess(2) checks for FILRD,
FILWR, FILEX and FILEXIST cases.

We cannot MFC this because there is no eaccess(2) in -stable yet.

PR:		bin/35076
Reviewed by:	ru
Approved by:	ru
2002-03-06 11:20:13 +00:00
Warner Losh
250a0cef8f Use ANSI-99 int names (uintXX_t) over traditional BSD int names
(u_intXX_t).
2002-03-05 05:28:49 +00:00
Alexey Zelkin
c1633140b7 Use NLSLINKS to setup symbolic links in NLS area 2002-03-04 12:29:21 +00:00
Alexey Zelkin
bd93868f5a This file is not used anymore 2002-03-04 11:10:17 +00:00
Alexey Zelkin
f66b3927b3 Use bsd.nls.mk for building/installing NLS files
XXX: links handling simplify
2002-03-04 10:34:51 +00:00
Alfred Perlstein
6188858ae1 clarify code:
add comments.
don't get the length of each arg passed, only the last one.
check against == or != NULL rather than using a pointer value as
truth test.
2002-03-04 05:30:04 +00:00
Doug White
0551940858 Update STANDARDS section on rm(1) to reflect current conformance.
PR:		35471
2002-03-02 05:10:11 +00:00
Andrey A. Chernov
5f7ca9ae38 Add (unsigned char) cast lost in WARNS=4 fixes which break 8bit locales
PR:		35421
2002-02-28 18:52:47 +00:00
Maxim Sobolev
42d6cdd371 Fix a bug introduced in rev.1.23 - for some reason mkdir("/", ...) system
call returns `EISDIR', not `EEXIST', so that be prepared for that. This should
fix number of ports, that often call `mkdir -p //usr/local/foobar'. This
is just a quick workaround, the real fix would be either to avoid calling
mkdir("/", ...) or fix VFS code to return consistent errno for this case.
2002-02-25 09:17:44 +00:00
Bruce Evans
434b6ea45a #include <time.h> for the definition of time functions instead of
depending on namespace pollution 2 layers deep in <sys/stat.h>.

Removed unused includes.
2002-02-25 01:36:59 +00:00
Bruce Evans
9880a81276 Fixed unsorting. 2002-02-23 21:00:14 +00:00
Bruce Evans
b909fa9cd0 Fixed some style bugs in revs 1.1 and 1.4. 2002-02-23 17:05:32 +00:00
Mark Murray
a3dbc1d804 ANSIfy. 2002-02-22 23:31:57 +00:00
Mark Murray
8bd08b5fac Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:24:14 +00:00
Mark Murray
ece5764570 Fix a boatload of warnings inspired by lint, a commercial lint
and WARNS=4.
2002-02-22 21:21:37 +00:00
Mark Murray
4b23bd7c2a Warnings fixes. 2002-02-22 21:13:31 +00:00
Mark Murray
4b4ed2fe6a Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:11:03 +00:00
Mark Murray
fab912df88 Partially fix (well, work around) warnings inspired by lint, a
commercial lint and WARNS=4.
2002-02-22 21:02:58 +00:00
Mark Murray
9b2010a2de Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:00:16 +00:00
Mark Murray
39661e26a5 Warnings fixes inspired by lint, a commercial lint and WARNS=4. 2002-02-22 20:57:53 +00:00
Mark Murray
5ca37430d9 Warning fix. Enter into the spirit of getopt(3) a bit more. 2002-02-22 20:55:04 +00:00
Mark Murray
9afa09cd0e Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 20:51:00 +00:00
Mark Murray
71bea4f79d Fix warnings inspired by lint, a commercial lint and WARNS=4 2002-02-22 20:45:09 +00:00
Matthew Dillon
d9a5f8900a Revert wchan functionality. Add 'mwchan' to supply new duel mutex/msleep
functionality and make it the default.

With additional improvements by: Mark Peek <mp@FreeBSD.org>
2002-02-21 18:27:16 +00:00
Chris D. Faulhaber
95a801b700 Remove extraneous blank line 2002-02-19 02:36:35 +00:00
Chris D. Faulhaber
32e7fd5991 Use acl_dup() to duplicate an ACL instead of rolling our own 2002-02-19 02:36:15 +00:00
Warner Losh
576541a9e6 Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h.  Update the man pages.

Submitted by: David Malone
Pointy hat to: imp
2002-02-19 00:05:59 +00:00
Warner Losh
1a24391866 Remove now-obsolete __STDC__ ifdefs, remove redundant NULL definition and
include stdlib.h for NULL.
2002-02-18 06:08:23 +00:00
Gregory Neil Shapiro
095dae9d7a Update build infrastructure for sendmail 8.12. 2002-02-17 22:05:07 +00:00
Matthew Dillon
ebc1fff946 When blocked on a mutex, display the mutex name via the wchan string field
so we can at least tell the difference between being blocked in Giant
and being blocked in some other mutex.
2002-02-16 20:10:00 +00:00
Dag-Erling Smørgrav
3ab6656108 Document the 'M' state. 2002-02-16 18:47:22 +00:00
Warner Losh
fc69394f0a Move user_from_uid to pwd.h
Move group_from_gid to grp.h
Remove from stdlib.h
Make the prototypes match the code
Fix rm and mv to include new files.

NetBSD has these defined in those files, and others too that I've not
done.

Approved by: terminal room kabal
Reviewed by: jhb, phk
2002-02-14 01:59:47 +00:00
Mark Peek
90e0035cca Install complete.tcsh and csh-mode.el into ${SHAREDIR}/examples/tcsh.
PR:		misc/34800 (from Steven Grady)
Submitted by:	phantom (patch)
MFC after:	3 days
2002-02-12 04:50:12 +00:00
Mike Barcroft
7146f7f115 Repo-copied src/bin/pwd/realpath.1' to src/bin/realpath/realpath.1',
as part of the move to seperate realpath(1) into its own directory.
2002-02-11 18:45:29 +00:00
Mike Barcroft
0dd10cae52 o Remove old code from pwd(1); realpath(1) is now in its own directory.
o Fix some unordered includes in pwd(1).
o Connect realpath(1) to the build.
2002-02-11 18:38:54 +00:00
Mike Barcroft
5330465c43 Move the realpath(1) source into its own directory. Previously, it
shared sources with pwd(1).
2002-02-11 07:32:17 +00:00
Mike Barcroft
3ce3a0bf8d Use the getprogname(3) function instead of directly accessing
`__progname'.

Submitted by:	dd
2002-02-10 05:56:36 +00:00
Mark Murray
91bd71d206 Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
Brian Feldman
2fb080722f Correct a logic bug that snuck in and broke multiplication of off_ts. 2002-02-07 02:54:30 +00:00
Dave Zarzycki
076172c5bc Fix the race between the stat() and the mkdir().
Reviewed by:	jkh
2002-02-05 21:55:12 +00:00
Mike Barcroft
7a396ef4d5 Add -L option (SUSv3) to pwd(1). Fix a bug, where realpath(1) would
complain about paths starting with `-', by not calling getopt(3).

Submitted by:	Tim J. Robbins <tim@robbins.dropbear.id.au>
Obtained from:	NetBSD (partially)
MFC after:	1 month
2002-02-04 07:26:21 +00:00
Kris Kennaway
6a99036a7f Correct inadvertent style botches in previous commit. 2002-02-04 03:06:51 +00:00
Kris Kennaway
afe781faa2 Lock down with WFORMAT=1 except those directories with unfixed warnings.
Tested on i386 and alpha.
2002-02-04 02:49:19 +00:00
Kris Kennaway
f4c1428318 __printflike() should really be __printf0like() since verrx() can
accept a NULL format string.
2002-02-04 01:11:48 +00:00
Kris Kennaway
7cbc81e6a1 Add a __printflike() attribute to silence warning with FORMAT_AUDIT=1 2002-02-04 01:07:07 +00:00
Mark Murray
c73d77cef9 Use __FBSDID() and clean up the vendor tags. 2002-02-03 20:55:54 +00:00
Mark Murray
9052855a15 WARNS=4 fixes, plus a healthy dose of fixes inspired by lint. 2002-02-03 19:11:32 +00:00
Mark Murray
871e8d8c59 WARNS=4 fixes (incomplete, so set NO_WERROR), and lots of extra
cleanup courtesy of automatic checking (lint).
2002-02-03 14:43:04 +00:00
Akinori MUSHA
5c08c7d35d Work around a buffer overflow problem on argv that has been exposed
after making test(1) a sh(1) builtin; sh(1) coredumps when you run
something like this:

	sh -c 'test ! `true 1`'

The cause is that the test(1) code totally depends on the presence of
two extra cells at the end of argv that are filled with NULL's.  The
reason why the bug hasn't been exposed would be because the C startup
code kindly prepares argv with some extra zeroed cells for a program.

I know this is not the best fix, but since there are argv++'s without
boundary checks everywhere, I'd rather patch it up like this
(preparing a copy of argv with extra NULL's) for the moment.

MFC after:	3 days
2002-02-03 10:01:49 +00:00
Chris D. Faulhaber
42dcd8695a Use a more correct method of copying entire ACLs (fixes
operation under Linux).
2002-02-03 02:37:43 +00:00
Warner Losh
900021ae8e Fix unused variable. 2002-02-02 07:10:02 +00:00
Warner Losh
b75c76877e missed a few registers 2002-02-02 07:09:30 +00:00
Warner Losh
f789b2611b Ooops, forgot to remove the registers here. 2002-02-02 07:07:59 +00:00
Warner Losh
90e41fc40a %.* takes an int, not a size_t. 2002-02-02 07:06:58 +00:00
Warner Losh
5134c3f799 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
o Change
	int
	foo() {
	...
  to
	int
	foo(void)
	{
	...
2002-02-02 06:50:57 +00:00
Warner Losh
46251dde8f o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
2002-02-02 06:48:10 +00:00
Warner Losh
7669d0fc4f o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
o gc some #ifdef sun ... #endif code

Approved by: arch@, new style(9)
2002-02-02 06:36:49 +00:00
Warner Losh
f9bcb0beb5 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.

Approved by: arch@, new style(9)
2002-02-02 06:24:13 +00:00
Warner Losh
5dce647c1b Modernization effort for bin/c*:
o __P has been reoved
  o Old-style K&R declarations have been converted to new C89 style
  o register has been removed
  o prototype for main() has been removed (gcc3 makes it an error)
  o int main(int argc, char *argv[]) is the preferred main definition.
  o Attempt to not break style(9) conformance for declarations more than
    they already are.

  Approved by: arch@, new style(9)
2002-02-02 06:15:22 +00:00
Warner Losh
78a3801de3 Drag cat(1) kicking and screaming into the late 1980's:
o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.

Approved by: arch@, new style(9)
2002-02-02 06:10:01 +00:00
Sheldon Hearn
63b46af996 Refer to the original mode of the file, not the mode of the original
file.

PR:		docs/34224
Submitted by:	"Gary W. Swearingen" <swear@blarg.net>
2002-02-01 12:37:21 +00:00
Ruslan Ermilov
9e1c120c8e Remove a stray :' after v' in the getopt() call.
Submitted by:	bde
2002-01-28 13:43:22 +00:00
Ruslan Ermilov
831c910a30 GC the -W option. kvm(3) doesn't read swap for almost 10 years.
PR:		docs/34134
Reviewed by:	bde, peter
MFC after:	1 month
2002-01-28 09:43:26 +00:00
Brian Feldman
4ed955372c Commit general cleanups (separate get_num() and get_off_t() functions to
debogosify some of the command-line string-number conversions into
an unsigned and signed variant.)
2002-01-25 17:44:47 +00:00
Mike Heffner
6b8a6a6e6c Prevent overflowing the buffer that stores the command arguments.
PR:		bin/19422
Not objected to by: -audit
MFC after:	3 weeks
2002-01-20 01:30:40 +00:00
Maxim Sobolev
f1ff35aecb Add missed includes.
Reviewed by:	md5
2002-01-15 12:23:52 +00:00
Sergey Babkin
63f901ef53 The fix for >/dev/stdout, including Tor Egge's fix for the bug in the
original attempt of the fix. And yes, this time I've tried to build
world with it and it succeeded.

Submitted by:	Tor Egge
MFC after: 1 week
2002-01-13 14:37:40 +00:00
Ruslan Ermilov
127713f491 mdoc(7) police: tidy up. 2002-01-09 13:29:39 +00:00
Peter Wemm
a2e4c36a49 Put the "mtxname" keyword in alphabetical order (t comes after s) so
that the keyword is recognized.
2002-01-05 12:19:51 +00:00
Stephen McKay
16ef4ac3a3 Bruce thought some of the comments I added were not clear enough. This is
a combination of my words and his.  We will stop fiddling now. :-)
2002-01-01 06:14:26 +00:00
Bruce Evans
baa7ecb561 Fixed style bug (unsorting of SRCS) in rev.1.15. 2001-12-29 12:05:30 +00:00
Bruce Evans
31d680507a Fixed style bugs in revs. 1.6, 1.10 and 1.12. 2001-12-29 11:59:26 +00:00
Bruce Evans
95ca089fac Fixed missing DPADD and disordered LDADD in rev.1.17
Fixed setting of WARNS in rev.1.16.  Options should normally be set using
using "?=", not using "=", so that the setting is easy to override on the
command line, and setting WARNS to 0 should not be an exception.
2001-12-29 11:51:27 +00:00
Josef Karthauser
ac639e9072 LSCOLOURS should be spelt LSCOLORS.
Submitted by:	Jordan DeLong <fracture@allusion.net
2001-12-29 10:13:43 +00:00
Ben Smithurst
887f28b380 Remove part of a diff committed at the end of the file. 2001-12-29 00:51:23 +00:00
Josef Karthauser
47f884f098 Force raw printing of non-printable characters via the -w option.
PR:		bin/28007
2001-12-29 00:22:29 +00:00
Josef Karthauser
5dda5d0df0 Restore these files to shiny KNF. 2001-12-29 00:18:16 +00:00
Josef Karthauser
b95a83b308 Convert some spaces into tabs that I missed first time around. 2001-12-28 21:55:23 +00:00
Josef Karthauser
7b3360c0e2 Revert most of rev 1.42, to restore KNF style.
Requested by:	bde
2001-12-28 21:47:33 +00:00
Josef Karthauser
0e8d1551e0 Add a new flag, -h which when combined with the -l option causes
file sizes to be displayed with unit suffixes; Byte, Kilobyte,
Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the
number of digits to three or less.

Submitted by:	nik
2001-12-28 20:50:12 +00:00
Josef Karthauser
130d15dc43 Make it clearer what changed to a user using the old format of LSCOLORS. 2001-12-28 19:27:30 +00:00
Josef Karthauser
6bd042dfe9 Mop up some warnings. 2001-12-28 19:26:06 +00:00
Josef Karthauser
b0bc91e955 Make the style more consistent throughout the file. 2001-12-28 18:43:32 +00:00
Josef Karthauser
0d72516e58 Use the default colour instead if a bad colour specification is given. 2001-12-28 18:20:23 +00:00
Josef Karthauser
c1499cf6cf Revamp the colour support to allow for bold characters. Colours
are now defined using the characters a-h and A-H for the bold
variants.  The old way using 0-7 for the colours still works, but
prints a message asking the user to switch.

PR:		bin/27374
2001-12-28 18:14:50 +00:00
Andrey A. Chernov
4cc31e55f5 strtoq -> strtoll (strtoq is deprecated) 2001-12-25 08:10:34 +00:00
Alfred Perlstein
8f5c93f79f backout rev 1.14, it's breaking things. 2001-12-24 22:27:04 +00:00
Stephen McKay
62de071bfb The previous fix caused cp to emit spurious warnings under some
circumstances.  This is a reworked version of the same fix, that does
not have this defect, and which fixes some style bugs at the same time.

Bug reported and fix reviewed by: bde
2001-12-23 11:16:14 +00:00
Sergey Babkin
41f1be05da Added ability to do ">/dev/stdout". The apsfilter people are anxious
to get it MFCed in time for release 4.5.

MFC after: 2 weeks
2001-12-22 02:40:58 +00:00
Ruslan Ermilov
cf5b29e126 Make ``df -l'' work when no network filesystems are loaded.
PR:		bin/32397
2001-12-19 08:38:02 +00:00
Andrey A. Chernov
3d09cebfce 1) Localize (LC_CTYPE)
2) Catch "" to 0 conversion for OSes that not catch it in strto*()
   (f.e. -stable). It is needed because POSIX agrees with both variants.
2001-12-17 23:14:14 +00:00
Andrey A. Chernov
9ea42c8e34 POSIX strto*() functions MAY return EINVAL, so don't assume that only one
errno from them allowed and it is always ERANGE
2001-12-14 23:20:54 +00:00
Luigi Rizzo
69393d0646 Add prototypes for main() so that these programs compile with -Werror
(which somehow now seems to be the default for compiling -current).
This error popped up while doing a PicoBSD cross-compile on a 4.3-ish system,
it may well be that there are other apps which have similar problems,
but I did not spot them as they are not included in my picobsd config.

Whether adding prototypes for main() is the correct solution or not
I have no idea, a request to -current on the matter went basically
unanswered. Those who have better ideas are welcome to back this out
and replace it with the correct fix.
2001-12-14 16:22:41 +00:00
Philippe Charnier
7b3a12a825 Do not dot terminate errx() strings 2001-12-11 18:22:01 +00:00
Stephen McKay
4a5db7acfb Preserve directory timestamps with -p. Allow non-empty read-only
directories to be copied.  Apply umask to newly created directories
when -p is not specified.

PR: 27970
PR: 31633

MFC after: 4 days
2001-12-11 13:18:10 +00:00
Stephen McKay
048e497627 Typo in warning message (chown should be chmod). 2001-12-11 13:14:15 +00:00
David Malone
9f5b04e925 Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.
2001-12-10 21:13:08 +00:00
Ruslan Ermilov
aa70e98b87 -lcipher is an installable library. 2001-12-06 10:50:23 +00:00
Giorgos Keramidas
c602ea21d7 Make a bit more clear the types of characters that -B option will
print in octal.

Reviewed by:	roam, silence on -doc
2001-12-06 00:30:53 +00:00
Ruslan Ermilov
a93dfd0f71 Spelling. 2001-12-04 14:20:46 +00:00
Ruslan Ermilov
b5f8218042 mdoc(7) police: s/LKM/KLD/, sort xrefs. 2001-12-04 14:17:52 +00:00
David E. O'Brien
a748290789 Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
Chris D. Faulhaber
a540fec399 Move the code merging ACL_USER and ACL_GROUP objects from under
two nested while loops into a separate function.

Obtained from: 	TrustedBSD Project
2001-12-03 02:24:24 +00:00
Chris D. Faulhaber
993f5df628 Add defines for access and default ACLs (ACCESS_ACL/DEFAULT_ACL)
to enhance readability.

Obtained from:	TrustedBSD Project
2001-12-03 01:20:52 +00:00
Chris D. Faulhaber
a043a09da7 style(9) cleanups mostly consisting of:
o explicitly check return values and variables against a value
o return x; -> return (x);
o fix inconsistent sysexits usage by nuking it (partially
  suggested by bde)

Obtained from:	TrustedBSD Project
2001-12-03 00:51:36 +00:00
Chris D. Faulhaber
05da5209f6 Correct example to remove *all* extended ACL entries and
clarify description.
2001-12-03 00:27:15 +00:00
Mark Murray
f614104aeb Slight makefile style.
Use __FBSDID().
2001-12-02 23:04:14 +00:00
Chris D. Faulhaber
458ad6cb17 o Expand the explaination of the -b option WRT the resulting
group ACL entry in relation to the existing group and mask
  ACL entries.
o Move the explanation of multiple ACL entries on the command
  line to the ACL ENTRIES section.

Obtained from:	TrustedBSD Project
2001-12-02 18:46:33 +00:00
Chris D. Faulhaber
405c561518 o Correct error message forgotten in the last commit (malloc() -> calloc())
o Fix style nits

Submitted by:	bde
2001-12-02 18:15:53 +00:00
Chris D. Faulhaber
d0b8d0fdfc Use calloc(3) instead of rolling our own. 2001-12-02 01:52:34 +00:00
Brian Feldman
a240291a2a Note that stty is a utility and not... err... a program....
Submitted by:	ru
2001-11-29 15:46:54 +00:00
Brian Feldman
63f9c0358e Stty is a program, not a function. 2001-11-29 03:26:42 +00:00
Brian Feldman
7304f61f9e Add LOMAC options (the "Z" flag in both cases) to display extra information
in ls(1) and ps(1).

Sponsored by:	DARPA, NAI Labs
2001-11-26 22:21:15 +00:00
Akinori MUSHA
018d9f6237 Remove the printf builtin command from sh(1), which command is not
used so often that it's worth keeping it as a builtin.

Now that all the printf invocations from within the system startup
scripts, we can safely remove it.

Urged by:	sheldonh  :)

No MFC is planned so far because it may break compatibility and
violate POLA.
2001-11-20 18:33:59 +00:00
Akinori MUSHA
bd90b9c76e Fix style bugs I found, and add a comment. 2001-11-19 20:39:24 +00:00
Akinori MUSHA
25e04004ff Oops sorry, forgot to add a #include. 2001-11-19 20:15:10 +00:00
Akinori MUSHA
d919a882fd - Do not reference argv[1] if no argument is given.
Reported by:	brian

- Call error() instead of errx() if compiled as sh(1) builtin.
2001-11-19 19:57:45 +00:00
Akinori MUSHA
d90c5c4ab4 Make test(1) a builtin command of our sh(1) for efficiency. The
binary size increase is 3,784 bytes (about 0.6%).

I don't drop the printf builtin while I'm here because some /etc/rc.*
scripts seem to use it before mounting /usr where printf(1) resides.

Reviewed by:	arch (sheldonh)
Inspired by:	NetBSD, ksh
Clued by:	ume (on how the printf builtin is used)
2001-11-17 19:10:11 +00:00
Robert Watson
9331ef537f o Update licenses, comments.
Obtained from:	TrustedBSD Project
2001-11-16 15:59:46 +00:00
Dima Dorfman
ad3f90f6ca Deuglify the usage message by putting the program name after the
"usage:" string.  This is how most (all?) other programs in the system
do it.

PR:		31596
Submitted by:	Cyrille Lefevre <clefevre@citeweb.net>
2001-11-15 15:46:45 +00:00
Tor Egge
f14c1c47f9 Don't call setvar() with the VTEXTFIXED flag. A copy is created by
setvar() and passed to setvareq(). When the VTEXTFIXED flag is set,
that copy is never freed, causing a memory leak.

PR:		31533
Submitted by:	maxim@macomnet.ru
2001-11-07 23:00:05 +00:00
Matthew Dillon
dbd9746f71 Use a quad int conversion routine for time_t instead of ulong, capable of
decoding tar's full time buffer (12 digits).
2001-10-28 02:51:43 +00:00
Matthew Dillon
2ad45bbe3d Various string fields for certain cpio types are 11 rather then 8
characters.  Use quad conversion functions rather then long conversion
where appropriate to handle the available range.  Mainly fixes time_t
but there was also a st_size ulong conversion in there that has to be
quad or cpio cannot be used to copy files > 2G.

MFC after:	1 day
2001-10-28 02:45:04 +00:00
Matthew Dillon
6e63a1049a Remove unnecessary casts in timeval.tv_sec load from st_*time 2001-10-28 02:42:26 +00:00
Matthew Dillon
cd9c425794 Remove assumption that time_t is an int
MFC after:	1 day
2001-10-28 02:28:04 +00:00
Ruslan Ermilov
4a70bdf9f6 mdoc(7) police: join OS version with the corresponding macro. 2001-10-19 14:44:13 +00:00
Tor Egge
c4c8394066 Repair normally unused is_digit() macro. 2001-10-14 21:11:33 +00:00
David E. O'Brien
757eeda04b *** empty log message *** 2001-10-01 08:43:58 +00:00
Ruslan Ermilov
43e09ab2db WARNSify. 2001-09-26 11:34:14 +00:00
Ruslan Ermilov
1b00c916a1 The "cat - -" feature was broken by the last commit.
Restore the code that avoided closing and reopening
stdin.  This is also required by POSIX.  As a bonus,
enable multiple stdin reads with the -benstv flags,
by resetting the EOF condition on stdin.
2001-09-26 11:32:23 +00:00
Ruslan Ermilov
0ec8be8404 mdoc(7) police: fixed markup. 2001-09-25 18:10:18 +00:00
Ruslan Ermilov
db1909f7d2 mdoc(7) police: markup nits. 2001-09-21 07:04:47 +00:00
Tor Egge
d2653b8806 Don't check uninitialized memory for having the shell control character
value CTLARI since this might break expansion of arithmetic expressions.

Don't access memory below start of stackblock.

Problem analyzed by hunt@iprg.nokia.com, slightly different patch applied.

PR:		24443
Submitted by:	hunt@iprg.nokia.com
2001-09-19 20:16:38 +00:00
Tor Egge
0c4eedda7b BASESYNTAX, DQSYNTAX, SQSYNTAX and ARISYNTAX handles negative indexes.
Allow those to be used to properly quote characters in the shell
control character range.
2001-09-19 20:07:47 +00:00
Tor Egge
5f2359b374 Adjust some type checks to include CTLQUOTEMARK in the range of
shell control characters.
2001-09-19 19:58:09 +00:00
Matthew Dillon
cbf2d71f0d Give /bin/cat the ability to connect to and read unix-domain sockets
MFC after:	1 week
2001-09-15 00:39:14 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Peter Wemm
85012e7c95 UPAGES as a constant is gone in KSE. We are going to have to trust
and/or fix ki_rssize.
2001-09-10 07:19:26 +00:00
Mark Peek
2441ae608e Enable BSD style color ls support.
PR:		23161
Submitted by:	Anand Ranganathan <anand@blandings.com>
2001-09-05 22:56:58 +00:00
Mark Peek
abd3657a6f Update to the tcsh-6.11 version.
This file could be removed as the alpha changes have been incorporated into
the base release. However, it is probably best to leave this here since there
are additional FreeBSD architectures in the pipeline that should be added.
2001-09-05 21:11:56 +00:00
Mark Peek
b11fbea708 Add new tcsh-6.11 NLS sets for Estonian and Russian.
(Polish was also included in tcsh-6.11 but the set1 and set3 files are broken)
2001-09-05 18:10:29 +00:00
Andrey A. Chernov
7cbfe4d8da File positions are off_t nowdays, not long, so:
fseek -> fseeko
  ftell -> ftello

  NOTE: that fseek/ftell not works for >long offsets per POSIX:

  [EOVERFLOW] For fseek( ), the resulting file offset would be a value which
  cannot be represented correctly in an object of type long.

  [EOVERFLOW] For ftell ( ), the current file offset cannot be represented
  correctly in an object of type long.
2001-09-01 23:26:40 +00:00
Dima Dorfman
46c128b5a5 The file_descriptor argument to -t isn't optional, so don't mark it up so. 2001-08-31 15:38:53 +00:00
Peter Wemm
7d1192a784 On today's kernels masking with ~KERNBASE is turning out to be less
than useful.  It still hits at least 8 digits. Adjust for reality.

This is still not satisfactory for the alpha if you add "-O paddr".
2001-08-24 09:56:44 +00:00
Peter Wemm
fbb75ab833 Handle kvm_getprocs() returning nothing. Dont pass -1 to a size
for malloc().
2001-08-24 09:53:26 +00:00
Dima Dorfman
d736886a81 Implement stty ek as documented.
PR:		24063
Submitted by:	Seth Kingsley <sethk@osd.bsdi.com>
2001-08-23 22:31:13 +00:00
Brian Somers
380434d488 Only capitalise the last `t' in ps's first argument when it's
actually part of an option argument.

Submitted by:	Chris Costello <chris@calldei.com>
MFC after:	6 weeks
2001-08-16 02:41:42 +00:00
Ruslan Ermilov
d628d776c4 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00