Commit Graph

1546 Commits

Author SHA1 Message Date
phk
5e1cf3ad98 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
jedgar
47acb76e7c Add semicolon to empty default case to silence warning. 2002-05-11 03:12:02 +00:00
wollman
a04093f9b6 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
2864dba864 while i'm breaking stuff, use __dead2 instead of GCC specific __attribute__. 2002-05-11 01:25:54 +00:00
alfred
2f75a283e0 backout additional include of cdefs.h, it's not helping any. 2002-05-11 01:24:39 +00:00
alfred
83d76dffe1 include cdefs.h for __printf0like to silence warning. 2002-05-11 00:54:33 +00:00
jedgar
818f9c0a64 Add semicolon to empty default case to silence warning. 2002-05-11 00:45:01 +00:00
alfred
c4d4a5fa12 Add semicolon to empty default case to silence warning. 2002-05-11 00:21:00 +00:00
wollman
e11cb46ee8 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
obrien
88b6275cf8 Remove gCC'isms. 2002-05-10 01:48:15 +00:00
joe
36c976074e 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
des
84dfbe4ad5 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
jmallett
0871762074 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
jmallett
896541a042 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
markm
09b63c5efb Reorder for style. 2002-04-28 13:54:45 +00:00
wollman
e46c2e6ba9 Provide an environment variabloe, EXPR_COMPAT, which disables option
parsing for compatibility with old implementations.
2002-04-22 21:23:09 +00:00
des
4d6b787d2d 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
charnier
0865462d56 Use `The .Nm utility' 2002-04-21 12:53:08 +00:00
charnier
487a22adbf Use `The .Nm utility' 2002-04-20 11:58:12 +00:00
mux
f446eb58b0 Add a reference to the kenv(2) manpage. 2002-04-18 18:49:41 +00:00
ru
8a3e2794af 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
mux
ef239236f8 Use the new functionalities provided by the kenv(2) syscall.
Reviewed by:	peter
2002-04-17 13:08:14 +00:00
charnier
79b89ed363 Use `The .Nm utility' 2002-04-16 20:08:06 +00:00
charnier
d219790077 ls(1) is utility not function 2002-04-16 20:03:54 +00:00
trhodes
ba4684c0e7 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
trhodes
4afe0b0679 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
greid
5486a1c99e 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
jwd
a3fe1a7096 Document option to option dependancy. Fix typo.
MFC after:	1 week
2002-04-15 02:21:12 +00:00
charnier
64ab19a185 Do not return(f_returning_void());. Spell FALLTHROUGH to make it lint()able. 2002-04-12 20:23:51 +00:00
bmilekic
890c5794a5 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
jedgar
f7f35bd6ba errx()/strerror() -> err() 2002-04-07 04:59:13 +00:00
keramida
9e46855391 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
ache
0b9df2f267 Use intmax_t as quad_t replacement, like in expr 2002-03-28 16:30:42 +00:00
iedowse
87a3c1d190 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
ru
f6da61bcc9 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
markm
67e76f4ab3 Replace use of __progname with the functionally identical and more
acceptable getprogname(3).
2002-03-24 14:56:55 +00:00
wollman
7282a3b32e 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
wollman
d1fbde7cf6 Typo (if => of). 2002-03-22 20:49:29 +00:00
wollman
dc0ab81475 Add a word of caution about integer arithmetic range and overflow detection. 2002-03-22 20:46:59 +00:00
wollman
c1037fd271 Fix a few formatting brainos and make the formatting of the EXAMPLES
section somewhat clearer.
2002-03-22 20:38:44 +00:00
wollman
2e02d4aae7 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
obrien
785ec6a1f4 Update SCM ID. 2002-03-22 19:52:59 +00:00
obrien
8f7b828bab Note that -n is non-standard. 2002-03-22 19:52:48 +00:00
markm
09171e09d6 No need to cast; ().gr_gid is already the correct type. 2002-03-22 15:54:44 +00:00
obrien
6295b3bfe1 Add the -n option, which automatically answers "no" to the overwrite question. 2002-03-22 07:45:36 +00:00
imp
74d826c7a6 remove __P 2002-03-22 01:22:50 +00:00
ru
cebc449d30 mdoc(7) police: use precise width specifier. 2002-03-15 14:21:13 +00:00
rwatson
94342978a6 NAI DBA update. 2002-03-14 21:51:00 +00:00
markm
43cc55dd2f 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
7d69422196 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
imp
f0662fdefd Use ANSI-99 int names (uintXX_t) over traditional BSD int names
(u_intXX_t).
2002-03-05 05:28:49 +00:00
phantom
9124a610d0 Use NLSLINKS to setup symbolic links in NLS area 2002-03-04 12:29:21 +00:00
phantom
63f07ef33b This file is not used anymore 2002-03-04 11:10:17 +00:00
phantom
d12220dfdb Use bsd.nls.mk for building/installing NLS files
XXX: links handling simplify
2002-03-04 10:34:51 +00:00
alfred
fd4aa99c82 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
dwhite
12798316b8 Update STANDARDS section on rm(1) to reflect current conformance.
PR:		35471
2002-03-02 05:10:11 +00:00
ache
4ac9e16668 Add (unsigned char) cast lost in WARNS=4 fixes which break 8bit locales
PR:		35421
2002-02-28 18:52:47 +00:00
sobomax
521f052069 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
bde
cf8ef037c8 #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
bde
0a286122a7 Fixed unsorting. 2002-02-23 21:00:14 +00:00
bde
be1787bc6d Fixed some style bugs in revs 1.1 and 1.4. 2002-02-23 17:05:32 +00:00
markm
5b69d7da62 ANSIfy. 2002-02-22 23:31:57 +00:00
markm
2b941891db Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:24:14 +00:00
markm
3ce9528bfb Fix a boatload of warnings inspired by lint, a commercial lint
and WARNS=4.
2002-02-22 21:21:37 +00:00
markm
3b69d13d7c Warnings fixes. 2002-02-22 21:13:31 +00:00
markm
2e9a506a04 Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:11:03 +00:00
markm
02fae8d816 Partially fix (well, work around) warnings inspired by lint, a
commercial lint and WARNS=4.
2002-02-22 21:02:58 +00:00
markm
d2f778cddf Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 21:00:16 +00:00
markm
1fb3e88343 Warnings fixes inspired by lint, a commercial lint and WARNS=4. 2002-02-22 20:57:53 +00:00
markm
863c4cc748 Warning fix. Enter into the spirit of getopt(3) a bit more. 2002-02-22 20:55:04 +00:00
markm
7b7558d884 Fix warnings inspired by lint, a commercial lint and WARNS=4. 2002-02-22 20:51:00 +00:00
markm
f24931e332 Fix warnings inspired by lint, a commercial lint and WARNS=4 2002-02-22 20:45:09 +00:00
dillon
23fcffffc9 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
jedgar
8cdc9fd108 Remove extraneous blank line 2002-02-19 02:36:35 +00:00
jedgar
8df81cb659 Use acl_dup() to duplicate an ACL instead of rolling our own 2002-02-19 02:36:15 +00:00
imp
60cc340d82 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
imp
d4f0b8fef8 Remove now-obsolete __STDC__ ifdefs, remove redundant NULL definition and
include stdlib.h for NULL.
2002-02-18 06:08:23 +00:00
gshapiro
730b12a9a9 Update build infrastructure for sendmail 8.12. 2002-02-17 22:05:07 +00:00
dillon
77112edb7c 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
des
66be93a737 Document the 'M' state. 2002-02-16 18:47:22 +00:00
imp
f58558abb7 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
mp
5d2ae7a01f 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
72a803ac5e 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
e9400873cc 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
18a66da4bb 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
c9034a8d20 Use the getprogname(3) function instead of directly accessing
`__progname'.

Submitted by:	dd
2002-02-10 05:56:36 +00:00
markm
ae2558974f 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
green
b3206d8278 Correct a logic bug that snuck in and broke multiplication of off_ts. 2002-02-07 02:54:30 +00:00
zarzycki
98e34f92cb Fix the race between the stat() and the mkdir().
Reviewed by:	jkh
2002-02-05 21:55:12 +00:00
mike
9ee57bcb7f 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
a1a10418c8 Correct inadvertent style botches in previous commit. 2002-02-04 03:06:51 +00:00
kris
bb3058824a 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
6ca02c8912 __printflike() should really be __printf0like() since verrx() can
accept a NULL format string.
2002-02-04 01:11:48 +00:00
kris
51396a4bd6 Add a __printflike() attribute to silence warning with FORMAT_AUDIT=1 2002-02-04 01:07:07 +00:00
markm
2973d46886 Use __FBSDID() and clean up the vendor tags. 2002-02-03 20:55:54 +00:00
markm
1084c0a6b2 WARNS=4 fixes, plus a healthy dose of fixes inspired by lint. 2002-02-03 19:11:32 +00:00
markm
aa05461c14 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
knu
396a7859f4 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
jedgar
2547546bed Use a more correct method of copying entire ACLs (fixes
operation under Linux).
2002-02-03 02:37:43 +00:00
imp
e2889aca77 Fix unused variable. 2002-02-02 07:10:02 +00:00
imp
1733865f62 missed a few registers 2002-02-02 07:09:30 +00:00
imp
0496eb97bd Ooops, forgot to remove the registers here. 2002-02-02 07:07:59 +00:00
imp
c4d9fbc331 %.* takes an int, not a size_t. 2002-02-02 07:06:58 +00:00
imp
5ef5088ac4 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
imp
50014e3541 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
imp
3fc8df52e3 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
imp
5203a0a465 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
imp
41e5cc1a95 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
imp
ef44ec93a7 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
sheldonh
84ced5c708 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
ru
2137f05783 Remove a stray :' after v' in the getopt() call.
Submitted by:	bde
2002-01-28 13:43:22 +00:00
ru
8c5c420dd3 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
green
db659d013d 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
mikeh
b216600a84 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
sobomax
99ceec2679 Add missed includes.
Reviewed by:	md5
2002-01-15 12:23:52 +00:00
babkin
6f66434b4f 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
ru
108589a3f2 mdoc(7) police: tidy up. 2002-01-09 13:29:39 +00:00
peter
8b9a0acd48 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
mckay
9ad6c9c9e7 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
bde
997e80f81f Fixed style bug (unsorting of SRCS) in rev.1.15. 2001-12-29 12:05:30 +00:00
bde
3df6b14036 Fixed style bugs in revs. 1.6, 1.10 and 1.12. 2001-12-29 11:59:26 +00:00
bde
412b81cedf 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
joe
42e2c5321a LSCOLOURS should be spelt LSCOLORS.
Submitted by:	Jordan DeLong <fracture@allusion.net
2001-12-29 10:13:43 +00:00
ben
8bd06e165d Remove part of a diff committed at the end of the file. 2001-12-29 00:51:23 +00:00
joe
e16986212d Force raw printing of non-printable characters via the -w option.
PR:		bin/28007
2001-12-29 00:22:29 +00:00
joe
4771d61303 Restore these files to shiny KNF. 2001-12-29 00:18:16 +00:00
joe
e208ef8e1a Convert some spaces into tabs that I missed first time around. 2001-12-28 21:55:23 +00:00
joe
d2121ec1c3 Revert most of rev 1.42, to restore KNF style.
Requested by:	bde
2001-12-28 21:47:33 +00:00
joe
dfee532b86 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
joe
4f254fdc50 Make it clearer what changed to a user using the old format of LSCOLORS. 2001-12-28 19:27:30 +00:00
joe
b4f7193e80 Mop up some warnings. 2001-12-28 19:26:06 +00:00
joe
22810faf4b Make the style more consistent throughout the file. 2001-12-28 18:43:32 +00:00
joe
731819d234 Use the default colour instead if a bad colour specification is given. 2001-12-28 18:20:23 +00:00
joe
dcc10c8b7b 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
ache
befc49edf5 strtoq -> strtoll (strtoq is deprecated) 2001-12-25 08:10:34 +00:00
alfred
39b93da10a backout rev 1.14, it's breaking things. 2001-12-24 22:27:04 +00:00
mckay
841620acfc 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
babkin
a0dab54592 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
ru
3145320d58 Make ``df -l'' work when no network filesystems are loaded.
PR:		bin/32397
2001-12-19 08:38:02 +00:00
ache
67e3e37c96 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
ache
7c495473b7 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
6f50cc5876 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
charnier
39a78fb21e Do not dot terminate errx() strings 2001-12-11 18:22:01 +00:00
mckay
a6a1f2b728 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
mckay
dd266e645e Typo in warning message (chown should be chmod). 2001-12-11 13:14:15 +00:00
dwmalone
d9613ea383 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
ru
f0ecccca2c -lcipher is an installable library. 2001-12-06 10:50:23 +00:00
keramida
83a1efaf60 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
ru
52cba5d797 Spelling. 2001-12-04 14:20:46 +00:00
ru
2e1b22fe1b mdoc(7) police: s/LKM/KLD/, sort xrefs. 2001-12-04 14:17:52 +00:00
obrien
099f8ecbe9 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
jedgar
a7e3b4261a 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
jedgar
38cc4cae2f 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
jedgar
30f5e7ea6e 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
jedgar
e0f46659fc Correct example to remove *all* extended ACL entries and
clarify description.
2001-12-03 00:27:15 +00:00
markm
b3be1b374c Slight makefile style.
Use __FBSDID().
2001-12-02 23:04:14 +00:00
jedgar
e95759f464 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
jedgar
c3aedf8ced 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
jedgar
f1ae0d570c Use calloc(3) instead of rolling our own. 2001-12-02 01:52:34 +00:00
green
74b53a2f1a Note that stty is a utility and not... err... a program....
Submitted by:	ru
2001-11-29 15:46:54 +00:00
green
77ac0dbce8 Stty is a program, not a function. 2001-11-29 03:26:42 +00:00
green
d741ed6f56 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
knu
96265e088e 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
knu
9a58963b18 Fix style bugs I found, and add a comment. 2001-11-19 20:39:24 +00:00
knu
959d37723b Oops sorry, forgot to add a #include. 2001-11-19 20:15:10 +00:00
knu
0fe2ba5388 - 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
knu
b58a3e4078 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
rwatson
cb22385a83 o Update licenses, comments.
Obtained from:	TrustedBSD Project
2001-11-16 15:59:46 +00:00
dd
bbce60529d 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
tegge
c98a8251e8 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
dillon
4394f0950f 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
dillon
6ce5111d95 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
dillon
5bb0a362e0 Remove unnecessary casts in timeval.tv_sec load from st_*time 2001-10-28 02:42:26 +00:00
dillon
78601098af Remove assumption that time_t is an int
MFC after:	1 day
2001-10-28 02:28:04 +00:00
ru
b28c3d865f mdoc(7) police: join OS version with the corresponding macro. 2001-10-19 14:44:13 +00:00
tegge
e6528784cf Repair normally unused is_digit() macro. 2001-10-14 21:11:33 +00:00
obrien
d9494059c0 *** empty log message *** 2001-10-01 08:43:58 +00:00
ru
eb7cee6686 WARNSify. 2001-09-26 11:34:14 +00:00
ru
e43023b2d0 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
ru
7f833143d7 mdoc(7) police: fixed markup. 2001-09-25 18:10:18 +00:00
ru
f9bcfb7e53 mdoc(7) police: markup nits. 2001-09-21 07:04:47 +00:00
tegge
b0e7279ba2 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
tegge
0c39138a0b 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
tegge
221fff6437 Adjust some type checks to include CTLQUOTEMARK in the range of
shell control characters.
2001-09-19 19:58:09 +00:00
dillon
0718b5e9ed 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
5596676e6c 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
8b50e616bf 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
mp
1674546f60 Enable BSD style color ls support.
PR:		23161
Submitted by:	Anand Ranganathan <anand@blandings.com>
2001-09-05 22:56:58 +00:00
mp
99362cccf4 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
mp
e74bda1062 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
ache
df6c6c6c15 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
dd
088dc2ef52 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
c05ab921af 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
de99d815fd Handle kvm_getprocs() returning nothing. Dont pass -1 to a size
for malloc().
2001-08-24 09:53:26 +00:00
dd
b5c6e30e9c Implement stty ek as documented.
PR:		24063
Submitted by:	Seth Kingsley <sethk@osd.bsdi.com>
2001-08-23 22:31:13 +00:00
brian
9efa99824a 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
ru
bde8ec1b70 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
ru
24c7b0a61d mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
peter
a28e7a866a Initialize infp at main() 2001-08-13 21:55:04 +00:00
peter
d58a143b4f Initialize listf at main() 2001-08-13 21:54:47 +00:00
ru
e8e5635e4a Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
ru
95ce4d2cdc Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
ru
f858dca3dc mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
sheldonh
7950d85ec2 can not -> cannot 2001-08-08 18:32:06 +00:00
ru
4345758876 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
mike
eced21209c o Correctly define rcsid.
o Add consts where appropriate.
o Rename some variables that were shadowing global declarations.
o Remove register storage-classes.
o Make errmsg a const, so we can just set error messages instead
  of using sprintf/strcpy.
o Set WARNS=2

Reviewed by:	bde, des
2001-08-06 22:01:31 +00:00
obrien
b8605bc696 style(9) 2001-08-01 05:12:39 +00:00
obrien
cd3f6b3b20 Remove a misplaced space. 2001-08-01 02:09:09 +00:00
sheldonh
9bfb9eedcd Use STD{ERR,IN,OUT}_FILENO instead of their numeric values. The
definitions are more readable, and it's possible that they're
more portable to pathalogical platforms.

Submitted by:   David Hill <david@phobia.ms>
2001-07-26 11:02:39 +00:00
sheldonh
8eba0410f0 Break the list of parameter expansions into two lists so that
the paragraph introducing the prefix and suffix pattern expansions
does not appear as part of the explanation for the string length
expansion.
2001-07-23 10:18:05 +00:00
dd
ccce8005b4 Don't use the pronoun "you".
Reviewed by:	sheldonh, mpp
2001-07-23 09:46:17 +00:00
dd
ae62c846d3 Don't put a shell prompt in the example since none of the other man
pages do it.  Also, don't use brackets to indicate optional options in
the example; instead, add a paragraph below the example explaining it.
2001-07-22 10:33:31 +00:00
ben
bd6df0c72b Add missing closing parenthesis. 2001-07-21 05:33:33 +00:00
obrien
9ad3c1f1f7 Show an example of how to sort a file listing by size. Hopefully this
will reduce the number of people calling for this functionality to be
added to ls(1).
2001-07-21 05:01:50 +00:00
wollman
4281e598d5 Fix style bugs introduced by rev 1.28. No functional changes. 2001-07-16 15:49:58 +00:00
dd
0f445ae1d8 Set WARNS=2 on programs which compile cleanly.
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-07-15 10:30:46 +00:00
dd
a145482cf6 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
ru
36f138439b mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 14:16:33 +00:00
ru
2149a5069b mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 10:04:09 +00:00
dd
eaa6ee03b8 mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
brian
8636b161b3 Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
ru
05e503d80a mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2). 2001-07-06 16:46:48 +00:00
mikeh
04b5406a22 Fix warnings on alpha and re-enable WARNS=2.
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-07-04 21:35:15 +00:00
mikeh
54186427e0 Argh...this isn't ready for WARNS=2 on alpha. 2001-07-03 03:34:42 +00:00
mikeh
36ddbd4e6c Constify and lockdown with WARNS=2.
Submitted by:	Mike Barcroft <mike@q9media.com>
MFC after:	2 weeks
2001-07-03 03:22:49 +00:00
green
a9b531b74d Use __unused for non-used variables.
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-06-29 20:06:47 +00:00
yar
d6f3122a76 Add a note on what happens if the "-p" option is specified
and a final directory already exists.

Reviewed by:	freebsd-audit
MFC after:	5 days
2001-06-29 11:45:14 +00:00
dd
6854d0f52c Back out previous commit: it doesn't help anything since write_file(),
which is also called from handle_hup(), uses stdio(3).  Furthermore,
this means that calling exit(3) (via quit()) there is required to
flush the buffer write_file() was working on.

Submitted by:	bde
2001-06-28 22:06:27 +00:00
dwmalone
977c2968e4 Use the correct printf format to print a long.
Approved by:	cracauer
2001-06-26 11:11:30 +00:00
dd
3dc2f99bef Previous commit broke dd(1)'s I/O summary when it's terminated by a
signal.  Fix it by adding an explicit call to summary() in terminate()
(it was previously called implicitly by exit() because summary() was
registered with atexit()).  summary() is supposed to be signal-safe--
it handles SIGINFO almost exclusively--so this should be safe.

Submitted by:	bde
2001-06-25 06:17:02 +00:00
dd
ef9ae51ffe Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).
2001-06-24 23:04:23 +00:00
dd
7438ee8a47 Don't call exit(3) from a signal handler.
Obtained from:	OpenBSD
2001-06-24 01:55:17 +00:00
dd
04d1b1c8dd Remove duplicate words. 2001-06-24 01:34:38 +00:00
dd
d705df8034 WARNS= -> WARNS?=
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-06-22 21:38:30 +00:00
des
8e8983228c Add more headers that are required with -fno-builtin (stdlib and strings) 2001-06-19 15:41:57 +00:00
des
059ac03bdf <stdlib.h> is needed for exit(3) when building with -fno-builtin. 2001-06-19 12:03:14 +00:00
dd
e55cc77a7f Xref zcat(1). 2001-06-18 20:00:39 +00:00
tegge
6008da3fbd Check for the PS_SINTR flag in the right field of struct kinfo_proc
(ki_sflag).
2001-06-16 21:39:29 +00:00
ru
a5389d379b Removed wrong cast for fts_open()'s third argument. 2001-06-13 15:01:25 +00:00
bde
5f8a4bf5ab Removed the broken code which claimed to lose the set[ug]id bits in
the !(pflag && setfile()) case for regular files unless the copy is
owned by the same user and group.  These bits have already been lost
(or never gained) in the correct way.  The code didn't actually lose
the bits; it depended on them being lost already (apparently in all
cases) and attempted to gain them as necessary, but it often gained
them (and sometimes collateral bits) when wrong:
- pflag && setfile() == 0 case (i.e., for a successful cp -p):
  setfile() copies all the attributes as correctly as possible (as
  specified by POSIX), and we sometimes messed up the up the mode by
  setting it again.  Also, if the file is immutable, then setting the
  mode again gave spurious errors (PR 20646).
- !pflag case.  If the target is created, POSIX requires it to not
  have the set[ug]id bits, but we sometimes copied them from the source.
  If the target already exists, POSIX requires its mode to be unchanged,
  but we sometimes copied the whole mode from the source.

PR:		20646
MFC after:	4 weeks
2001-06-11 13:57:54 +00:00
ache
df5dcfcf6e Use new locale names 2001-06-10 15:28:39 +00:00
ru
640330f7ff Simplify, with the power of new mdoc(7). 2001-06-09 11:20:31 +00:00
dd
0383b1c18b Add -j to the usage string.
PR:		27986
Submitted by:	Cyrille Lefevre <clefevre@redirect.to>
2001-06-09 06:14:05 +00:00
dd
aa18b0b032 Correct a typo.
Submitted by:	Alexey V. Neyman <avn@any.ru>
2001-06-08 04:41:21 +00:00
nectar
cc91420e2c Add parens to get the cast that was meant in previous commit.
While we're at it, this file seems to prefer `unsigned int'
over `u_int', so go with that.
2001-06-05 21:55:57 +00:00
mjacob
023821479e Wrong. The size of size_t is *not* the same as the size of an integer.
MFC after:	2 weeks
2001-06-05 21:16:27 +00:00
dd
1b83a0aef8 Correct a spelling nit (a -> an). 2001-06-04 23:33:02 +00:00
pirzyk
7e25cedba6 Added the -l option to df, so to be compatable with other unicies.
PR:		bin/27240
Reviewed by:	GAWollman
MFC after:	2 weeks
2001-06-04 23:07:15 +00:00
dd
e74fefcf8f Mention the kern.ps_showallprocs sysctl.
PR:		24804
Submitted by:	Mike Meyer <mwm@mired.org>
2001-06-02 04:02:36 +00:00
ru
e7a85be33f Remove vestiges of MFS. 2001-06-01 10:07:28 +00:00