Commit Graph

8484 Commits

Author SHA1 Message Date
Yaroslav Tykhiy
65b02a0f4b Consistently mark percentage scales as such.
PR:		bin/101975
MFC after:	3 days
2006-11-27 20:19:05 +00:00
Yaroslav Tykhiy
04f7f23bf8 Don't shadow globals.
Found by:       WARNS=6
MFC after:      3 days
2006-11-27 19:50:50 +00:00
Yaroslav Tykhiy
da67074ec6 We should return the name in cp, not printf it.
Found by:	WARNS=6
MFC after:	3 days
2006-11-27 19:48:45 +00:00
Yaroslav Tykhiy
c3d6542fd0 systat(1) reaches WARNS=6 on i386 and amd64. This is good
for catching general regressions in future.  Unfortunately,
it still displays some problems at WARNS=6 on architectures
with stricter alignment requirements, e.g., ia64.
2006-11-27 17:54:28 +00:00
Yaroslav Tykhiy
599cc46d95 The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,
we set and use xtp; if idx is 1, we set and use xip; the other cases
are impossible.  However, GCC cannot see that xip and xtp are always
initialized before use because they are initialized and used in
different if/else blocks.  So setting them to NULL at the very
beginning won't hurt.
2006-11-27 17:34:40 +00:00
Yaroslav Tykhiy
6549e8c62e + WARNS=4 reminds that nlist.n_name isn't const.
+ Use C99 initializers to be WARNS-clean.
+ The last element in a namelist should have its n_name set to NULL,
  not to an empty string.
2006-11-27 17:24:36 +00:00
Yaroslav Tykhiy
9540596e83 Don't discard a const qualifier from constant strings. 2006-11-27 17:01:31 +00:00
Yaroslav Tykhiy
2506efa78c Remove a wrong "const" qualifier.
Spotted by:	WARNS=6
2006-11-27 16:59:08 +00:00
Yaroslav Tykhiy
dfaa9125d8 Add the Tera scale factor, which is an easy job now.
More scale factors would overflow the command line where
the help for "scale" were shown.
2006-11-27 16:33:44 +00:00
Yaroslav Tykhiy
afe7b9fbb5 Stop exposing things that can be private to convtbl.c. 2006-11-27 16:23:09 +00:00
Yaroslav Tykhiy
aee371e363 Keep all convtbl-related constants and strings in convtbl.[ch]. 2006-11-27 16:14:32 +00:00
Yaroslav Tykhiy
f5d4751c8a Allow for large scale factors. C99 warrants that
ULLONG_MAX is not less than 2^64-1; and uintmax_t
cannot be more narrow than unsigned long long.
This allows for scale factors up to Exa inclusively.

Use plain int for the scale index to be consistent
with ifcmds.c and enum.
2006-11-27 15:26:26 +00:00
Yaroslav Tykhiy
41af362198 Return back one initializer, it is needed. 2006-11-27 15:14:50 +00:00
Yaroslav Tykhiy
f301488570 + Drop useless initializers.
+ style(9).
2006-11-27 15:11:30 +00:00
Yaroslav Tykhiy
ce1bff762d Drop useless #includes. 2006-11-27 14:48:46 +00:00
Yaroslav Tykhiy
0230383747 Use C99 initializers so that we don't really have to worry
about the order of related things at several places.
2006-11-27 14:18:54 +00:00
Yaroslav Tykhiy
ab5c9a0d0a C can enumerate things for us. 2006-11-27 14:16:40 +00:00
Yaroslav Tykhiy
00603ea268 There is no reason to use __inline here because we are rather far
from a path critical to performance.
2006-11-26 20:14:47 +00:00
Yaroslav Tykhiy
a3736d312c Don't overflow from the gigabyte scale to the bit scale if the
number to auto-scale is >= 1024 Gb.  Could be triggered on arches
where ifdata counters had 64 bits.

Reported by:	Miroslav Slavkov on -net
MFC after:	3 days
2006-11-26 20:08:40 +00:00
Yaroslav Tykhiy
91857186f2 The real contents of this file were repeated twice.
The repetition was harmless due to a usual #ifndef _FOO_H_ wrapper.
Fortunately, nobody started to hack the second copy,
so just remove it from the file.

MFC after:	3 days
2006-11-26 19:25:10 +00:00
Ruslan Ermilov
8af480aec1 - When building world WITHOUT_LIBPTHREAD, link libthr to libpthread.
- Don't build ngctl(8) and cached(8) if threading libs aren't built.
- Fix various issues in a cached(8) makefile.
2006-11-26 14:36:34 +00:00
Yaroslav Tykhiy
a6afe5ada8 Fix and extend the -j option to pkill/pgrep WRT the jail
wildcard specifications.  Earlier the only wildcard syntax
was "-j 0" for "any jail".  There were at least
two shortcomings in it:  First, jail ID 0 was abused; it
meant "no jail" in other utils, e.g., ps(1).  Second, it
was impossible to match processed not in jail, which could
be useful to rc.d developers.  Therefore a new syntax is
introduced: "-j any" means any jail while "-j none" means
out of jail.  The old syntax is preserved for compatibility,
but now it's deprecated because it's limited and confusing.

Update the respective regression tests.  While I'm here,
make the tests more complex but sensitive:  Start several
processes, some in jail and some out of jail, so we can
detect that only the right processes are killed by pkill
or matched by pgrep.

Reviewed by:	gad, pjd
MFC after:	1 week
2006-11-23 11:55:17 +00:00
Ruslan Ermilov
20739dfa44 Fix the format specifier suitable for uintmax_t. 2006-11-23 11:51:23 +00:00
Ruslan Ermilov
9623c97258 Oops, fix the format specifier to what was intended. 2006-11-23 11:47:34 +00:00
Greg Lehey
9f238ea6d9 Bump document date.
Nitpicked by:   ru
MFC after:	1 week
2006-11-23 05:08:06 +00:00
Greg Lehey
eb29cfdd00 usage: Include the - in the x flag.
main: Make -x set the hexdump; there's no obvious reason to toggle it.

Nitpicked by:   ru
MFC after:	1 week
2006-11-23 05:07:32 +00:00
Greg Lehey
9a2a66f1bb Add option -x to display output values in hex in addition to decimal. 2006-11-23 00:20:54 +00:00
Maxim Konovalov
0d4d06c9d7 o Check that -w width is not above maximum. Use DWIDTH instead of
hardcoded constant.

Reported by:	Gruzicki Wlodek on BugTraq
Obtained from:	NetBSD, OpenBSD
MFC after:	1 week
2006-11-22 21:05:17 +00:00
Ruslan Ermilov
5c88a11e6e - Fix types of "struct vmmeter" members so they are unsigned.
- Fix overflow bugs in sysctl(8), systat(1), and vmstat(8)
  when printing values of "struct vmmeter" in kilobytes as
  they don't necessarily fit into 32 bits.  (Fix sysctl(8)
  reporting of a total virtual memory; it's in pages too.)
2006-11-20 16:04:41 +00:00
Giorgos Keramidas
d2d77d2aee In revision 1.14 I broke the -4 and -6 options of sockstat(1).
Using either one of the two would result in an empty protos[]
array, and no sockets were actually listed:

  % sockstat -4
  USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
  % sockstat -6
  USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
  %

Fix this bug by tweaking appropriately the logic of handling opt_4,
opt_6, opt_u and protos_defined.

Submitted by:	des
Pointy hat:	keramida
2006-11-12 19:03:39 +00:00
Giorgos Keramidas
1f3d67aade Add support for filtering sockets by protocol type. The default
behavior of sockstat(1) will still be to show "udp", "tcp" and
"divert" protocols, but we can now provide a (comma-separated)
list of protocols, as in:

    % sockstat -P tcp

to list only TCP sockets, or we can filter more than one protocol
by separating the protocol names with a comma:

    % sockstat -P tcp,udp

Protocol names are parsed with getprotobyname(3), so any protocol
whose name is listed in `/etc/protocols' should work fine.

Submitted by:	Josh Carroll <josh.carroll@psualum.com>
Approved by:	des
2006-11-11 22:11:54 +00:00
Dag-Erling Smørgrav
1bac3abc07 Try to preserve ownership and permissions when replacing an existing file.
PR:		bin/104702
Submitted by:	Kevin Day <toasty@dragondata.com>
MFC after:	1 week
2006-11-10 22:05:41 +00:00
Bruce Evans
1f575ce8f9 Don't always print a space character in show_stat(), since a space
shouldn't be printed after the last column.  This restores the
formatting to 79 columns.
2006-11-08 15:15:05 +00:00
Frank J. Laszlo
f1f6c4b25e Add my birthdate to the calendar.
Approved by:	flz (mentor)
2006-11-07 14:35:34 +00:00
Bruce Evans
8dbbff5b81 Second stage of unbreaking thr formatting of the NICE field: decode the
priority class and use this to:

- print "-" instead of a garbage value for ithreads.  Print "-" instead
  of the unused nice value for kthreads which are (mis)classified as
  PRI_TIMESHARE.  For such threads, the nice value can be set to nonzero
  by root, but it is never used (at least by the 4bsd scheduler).  For
  ithreads, we didn't even print the unused value.

- print "i<priority>" and "r<priority>" instead of a biased "<priority>"
  for idletime and realtime threads,  Here <priority> is the priority
  parameter to idprio/rtprio(1).  Just add the prefix and remove the
  bias for now.  <priority> has been stored indirectly in the kernel
  since 2001/02/12, and even the kernel cannot recover the original
  value in all cases.  Here we need to handle more cases than pri_to_rtp(),
  but actually handle fewer cases, and end up printing garbage after
  a thread changes its current priority while in the kernel.

- for idletime and realtime threads, if they are kthreads then add a prefix
  of "k" to the previous string.

- for idletime and realtime threads, if they in the FIFO scheduling class
  then add a suffix of "F" to the previous string (if it fits; the other
  parts of the string are sure to fit unless <priority> is garbage).
2006-11-07 10:03:10 +00:00
Diomidis Spinellis
3241f274f1 Style facelift.
- Reduce the number of global variables
- Make global objects static
- Use bool consistently
- Sort getopt arguments and their processing
- Add function comments
- Change notlast != 0 into !last
2006-11-06 15:58:35 +00:00
Tom Rhodes
df449c3551 Add needed hyphens, note the KTRACE kernel option, bump doc date.
PR:		85186
Submitted by:	garys
2006-11-06 15:17:50 +00:00
Diomidis Spinellis
7d71f06cb4 Use a more sensible default of 1 or -1 when only the start and
end values are specified.

PR:		bin/68981
Submitted by:	Stefan `Sec` Zehl
MFC after:	2 weeks
2006-11-06 15:11:50 +00:00
Diomidis Spinellis
d129c68a14 Do What I Mean when the user asks for random integers or characters.
Up to now jot would fail to generate the last character in the range
or skew the integer distribution in a way that would generate the numbers
in the range's limits with half the probability of the rest.

This modification fixes the program, rather than documenting the
strange behavior, as suggested in docs/54879.

Also, correctly specify the range of random(3).

PR:		docs/54879
MFC after:	2 weeks
2006-11-06 13:55:11 +00:00
Diomidis Spinellis
fee14f30e9 Avoid negative array indices: an empty string can also be used
to specify a default value.
2006-11-06 11:03:43 +00:00
Diomidis Spinellis
1ab8c5be60 See also arc4random
PR:		docs/54879
MFC after:	2 weeks
2006-11-06 10:39:49 +00:00
Diomidis Spinellis
a26a66124e Restore jot's ability to use a seed for producing a deterministic
sequence of random numbers.
This functionality was lost in revision 1.9 when the random number
generator was switched to arc4random.

PR:		docs/54879
MFC after:	2 weeks
2006-11-06 10:30:29 +00:00
Diomidis Spinellis
55f965ae6a Replace obscure aliases through pointers with plain variables.
MFC after:	2 weeks
2006-11-06 09:15:21 +00:00
Diomidis Spinellis
d737ec1ad4 Merge code in common cases.
Verified by:	New regression tests in tools/regression/usr.bin/jot
MFC after:	2 weeks
2006-11-06 08:47:41 +00:00
Diomidis Spinellis
afe53a4950 Replace opaque numeric bit flag values with #defined identifiers.
While there, add some missing FALLTHROUGH comments.

Verified with:	cmp(1) on the executable
MFC after:	2 weeks
2006-11-06 07:26:16 +00:00
Robert Watson
29a055ac65 Cross-reference libmemstat(3), malloc(9), uma(9). 2006-11-02 19:53:57 +00:00
Tim Kientzle
2bb9582faf Fix "1 day ago", "yesterday" and similar relative-time phrases
when parsing dates.

PR: bin/104934: bug in some date handling of bsdtar
Reported by: Herve Boulouis
MFC after: 3 days
2006-11-02 04:16:15 +00:00
Ruslan Ermilov
324ef9892d Fix a bug converting a variable from the numeric type to a string.
PR:		bin/104795
MFC after:	3 days
2006-10-25 21:23:20 +00:00
Ruslan Ermilov
ec140c9bcf Document the NM environment variable. 2006-10-25 09:40:07 +00:00
Greg Lehey
1d59aaaa9b Bizet was only born once. 2006-10-24 23:18:07 +00:00
Maxim Sobolev
e7d4bf18db Backout previous change (SIGSYS related). The fix has been applied to the
proper place.

Pointed out by:	rwatson
2006-10-24 17:41:28 +00:00
Maxim Sobolev
a88ab48624 Ignore SIGSYS when BSM is compiled in. Otherwise, attempt to invoke su on
system that don't have audit framefork compiled into kernel or ia32 binary
on amd64 system will result in SIGSYS. There is one place in su.c itself
where it tries to check for errno != ENOSYS, but it has been a nop since su
does not catch SIGSYS anyway. There are few other places in libbsm,
where attempt to invoke audit syscal would result in SIGSYS if no audit
support is present in the kernel, so that the only reliable method for
now is to disable SIGSYS completely in the case when BSM is compiled in.

In the long run, both direct invocation of audit-related syscalls and
libbsm should be made more intellegent to handle the case when BSM is not
compiled into the kernel gracefully.

MFC after: 3 days
           (provided re@ approval)
2006-10-24 08:18:10 +00:00
Ruslan Ermilov
478bf77471 - Document the default disk block usage unit.
- Add option -h, human-readable output.

PR:		docs/53732
2006-10-21 23:57:38 +00:00
Marcel Moolenaar
d5d2cea180 Better handle the -F case:
o  When stat(2) fails (i.e. the file has been moved) there's no new
   file with the same name yet, so keep showing the file that's open.
   This yields the same behaviour as -f, for which we don't stat(2).
o  When a new file with the same name has been created (i.e stat(2)
   succeeds but the inode or device numbers differ from the opened
   file), show any new lines in the opened file (i.e. the old or
   rotated file) before reopening the new file.

These changes fix the observed behaviour that tail(1) doesn't show
the very last lines of the rotated (log) files.

PR: bin/101979
Tested by: Jos Backus <jos@catnook.com>
MFC after: 2 months
2006-10-21 18:05:06 +00:00
Ruslan Ermilov
e75d2f3694 The vm.zone sysctl has gone; zone stats are now supplied by libmemstat(3). 2006-10-21 10:40:12 +00:00
Ruslan Ermilov
ddf3250846 - Add comma after REQUESTS field missed in previous commit.
- Widen some columns; make width of header columns less cryptic.
2006-10-21 10:16:26 +00:00
Gleb Smirnoff
d0c8105042 Print the number of allocation failures in UMA zones.
PR:	kern/102940
2006-10-21 09:08:35 +00:00
Colin Percival
04f064d680 Document that jot(1), rs(1), and lam(1) first appeared in 4.2BSD.
MFC after:	1 month
2006-10-20 04:31:01 +00:00
Ruslan Ermilov
bb361298a5 Document that unexpand(1)'s -a and -t options are exclusive.
PR:		docs/85063
2006-10-13 16:22:25 +00:00
Ruslan Ermilov
0414904d4c - Document all character classes our tr(1) supports. [1]
- Mention that some of them are POSIX extensions.  [2]

PR:		docs/85062 [1]
Submitted by:	Toby Peterson [1]
Obtained from:	wctype(3) [2]
MFC after:	3 days
2006-10-13 16:13:45 +00:00
Ruslan Ermilov
82a6e39b28 At least one argument is required. 2006-10-12 21:10:55 +00:00
Ceri Davies
1abf0e15d5 Saint George replaced Saint Edward as the patron Saint of England
somewhere around 1348.

The revision log doesn't seem to go back quite that far, but I assume
that the update to this file was forgotten in the celebrations.

While, here, note which countries the other UK patron Saints hold
patronage of.

Sources include http://www.novareinna.com/festive/georgeday.html and
http://www.newadvent.org/cathen/
2006-10-12 11:08:29 +00:00
Ruslan Ermilov
c01e1768d9 Memory utilization subscreen in "vmstat" display lists numbers in KB,
not in number of pages.

PR:		docs/71690
Submitted by:	Jan Srzednicki

(A patch is only partially merged, the rest was already fixed by bde@
in rev. 1.51.)
2006-10-12 10:54:34 +00:00
Ruslan Ermilov
93f4bf61d4 Don't go beyond the provided string when parsing the `\' character.
PR:		bin/99985
Submitted by:	Nate Eldredge
MFC after:	3 days
2006-10-09 19:37:26 +00:00
Ceri Davies
659a728e18 Update the list of POSIX extensions.
PR:		docs/103859
Submitted by:	shaun
MFC after:	1 week
2006-10-08 10:31:44 +00:00
Florent Thoumie
a6a5a8f2e6 Add a missing new line at the end of the australian calendar file to
suppress and error message.

PR:		conf/99490
Submitted by:	Shaun Branden <shaun@pcuse.com>
Approved by:	cperciva (mentor)
MFC after:	1 day
Sponsored by:	FreeBSD Test-Bugathon
2006-10-06 23:20:01 +00:00
Soeren Straarup
457ce4c37b Adding my birthday
Approved by:	tmclaugh
2006-10-01 16:17:10 +00:00
Maxim Konovalov
b12f653e35 o Remove an obsoleted (and commented out) entry.
PR:		conf/85143
Submitted by:	Helge Oldach
2006-10-01 09:22:05 +00:00
Maxim Konovalov
e854ae2d06 o Strip eol w/spaces. 2006-10-01 06:30:51 +00:00
Maxim Konovalov
aa137175c2 o Add a Gedenktag.
PR:		conf/85143
Submitted by:	Helge Oldach
MFC after:	1 weeks
2006-10-01 06:29:35 +00:00
Ruslan Ermilov
e9aa046ba9 Revise markup. 2006-09-30 17:27:50 +00:00
Ruslan Ermilov
c4baa2453c Markup nit. 2006-09-29 21:17:10 +00:00
Bruce M Simpson
910e1364b6 Nits.
Submitted by:	ru
2006-09-29 16:16:41 +00:00
Bruce M Simpson
2d20d32344 Push removal of mrouted down to the rest of the tree. 2006-09-29 15:45:11 +00:00
Ruslan Ermilov
cb29445a92 Markup fixes. 2006-09-29 15:20:48 +00:00
Luoqi Chen
5a8e64ee60 Do not chdir(2) until after setuid(2), otherwise "su - username" would fail
when root doesn't have the permission to enter target user's home directory.
If set, PAM environment variable HOME will be used in chdir(2) instead of
pwd->pw_dir, this allows pam_chroot module to continue to function.
2006-09-29 04:41:37 +00:00
Matteo Riondato
9e0573fdc2 Set txrx_error to 1 when we reach abort. This makes the program correctly set the exit code.
The PR has further details on this.

PR:		bin/103206
Submitted by:	John Hickey <jjh-freebsd@daedalian.us>
MFC after:	3 days
2006-09-28 21:22:21 +00:00
Stanislav Sedov
af159726bc - Add my birthday entry to the chronicle.
Approved by:	sem (mentor)
2006-09-27 08:25:53 +00:00
Ceri Davies
de5e5e6ead Add a -a option as a no-op for Solaris compatibility, as briefly
discussed on src-committers.  This is intentionally not included in the
usage() function as it would confuse the output too much.

Approved by:	jhb
MFC after:	1 week
2006-09-26 22:28:12 +00:00
Ruslan Ermilov
acc17cb5a5 Fix both arguments to err(). 2006-09-26 05:46:55 +00:00
Dmitry Morozovsky
50789a2f3a Fix bug introduced in rev 1.23:
pw_equal does not check crypted password field, so one cannot change
crypted password keeping other fields intact.

Approved by:	des
MCF after:	3 days
2006-09-25 15:06:24 +00:00
Robert Watson
f4882b24fd Rename "-a" flag to "-A" in order to avoid conflicting with the "-a" flag
as found on Solaris.

Requested by:	ceri
MFC after:	3 days
2006-09-23 15:43:29 +00:00
Robert Watson
5bae3124ab Add a -a argument to id(1), which causes id(1) to print out process
audit properties, including the audit user id.  This can be quite
helpful in debugging audit problems.

Obtained from:	TrustedBSD Project
MFC after:	3 days
2006-09-23 12:30:31 +00:00
Alexander Kabaev
f340c84ebe Pass "-Wtraditional -Wno-system-headers" to compiler as two separate
arguments. GCC4 was unhappy with them combined, while GCC 3.4 did
not care.
2006-09-21 02:05:38 +00:00
Wojciech A. Koszek
60e15662e1 Export tcps_rcvmemdrop available in 'struct tcpstat' with netstat(1).
Requested by:	Tomasz Pilat <tomasz.pilat (at) axelspringer.pl>
Approved by:	andre
2006-09-20 12:29:12 +00:00
Ian Dowse
6508a1ecdc Add missing parentheses to fix a segmentation fault that is easily
reproducable with `jot -s " " 400 1 | column -t'. The bug was present
in the the original CSRG 'column -t' added in 1989.
2006-09-19 22:11:43 +00:00
Maxim Konovalov
a39846b5e4 o Don't leak fd on error.
o parselength() returns 0 or -1 so int is enough for its return type.

Submitted by:	Ighighi Ighighi, sheldonh
MFC after:	3 weeks
2006-09-18 16:39:23 +00:00
Maxim Konovalov
f45b405f7a o optname, the third {set,get}sockopt(2) argument, is an enum, not a bitmap.
Treat it accordingly.

PR:		bin/101642
MFC after:	3 weeks
2006-09-18 13:49:57 +00:00
Ruslan Ermilov
b43d227cab Update manpages for FILE 4.17. 2006-09-17 18:42:35 +00:00
Ruslan Ermilov
8a70619712 Initial memory allocation for fields was off-by-one.
PR:		bin/100443
MFC after:	3 days
2006-09-15 13:33:32 +00:00
Ruslan Ermilov
1007c98db6 Don't require a space between -[fv] and its argument.
PR:		bin/86514
MFC after:	3 days
2006-09-15 13:28:10 +00:00
Joel Dahl
3e1f331553 Remove references to the pam(8) manual page. It does not exist.
Requested by:	novel
Discussed with:	brueffer, simon
2006-09-13 17:46:20 +00:00
Philippe Charnier
488633c7f4 initialize variable (WARNS=6) 2006-09-13 05:06:12 +00:00
Alexander Botero-Lowry
4f9019bb29 Add my birthday to the calendar, sadly I am only the fifth youngest.
Approved by:	novel
2006-09-12 09:05:00 +00:00
Philippe Charnier
b2eeeae049 WARNS=6 chocked on unitialized variable. 2006-09-12 05:08:36 +00:00
Erwin Lansing
890fdf8de1 Update some of the bulgarian holidays since it no longer
is a socialist state.

Submitted by:	Shteryana Shopova <shteryana@FreeBSD.org>
2006-09-08 09:45:06 +00:00
Ruslan Ermilov
2aebb8bcb4 Fixed the -# option to work as documented in a manpage. 2006-09-07 19:48:52 +00:00
Ceri Davies
0033dba88b Chase revision 1.10 in usage string and a comment. 2006-09-07 17:10:26 +00:00
Ruslan Ermilov
934464be64 Bump WARNS level to 3.
OK'ed by:	make universe
2006-09-01 17:09:09 +00:00
Christian S.J. Peron
6319ad282f Integrate audit_submit(3) bits into su. This means that records for
successful and failed su attempts will be recorded using the AUE_su
event type (login or lo class) if auditing is present in the system.
Currently, the records will have a header, subject, text (with the
actual diagnostics), a return and trailer token.

See audit_submit(3) for more information.

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2006-09-01 13:39:02 +00:00
Ruslan Ermilov
763e2b058d Fix markup (in the same way as it was fixed in tip.1) and thus
make the diffs against tip.1 minimal (as in OpenBSD).
2006-08-31 20:44:59 +00:00
Ruslan Ermilov
07bb01e3d4 Fix compilation warnings (up to level 3). 2006-08-31 19:19:44 +00:00
Ruslan Ermilov
bfad8c3c1c Document the undocumented change in OpenBSD: the ${raisechar}
is no longer set to ^A by default, it's unset.

Reported by:	imp, sam
2006-08-31 16:40:30 +00:00
Ruslan Ermilov
a9f118adfd Actually merge OpenBSD changes and local changes (a diff should
be viewed relative to revision 1.24).
2006-08-31 16:26:50 +00:00
Ruslan Ermilov
2a98f027e5 Remove some dust. 2006-08-31 14:14:57 +00:00
Ruslan Ermilov
fa92e8831d Resolve merge conflicts. 2006-08-31 14:14:30 +00:00
Ruslan Ermilov
24ede41b96 This commit was generated by cvs2svn to compensate for changes in r161751,
which included commits to RCS files with non-trunk default branches.
2006-08-31 14:12:22 +00:00
Ruslan Ermilov
d391708c06 Import OpenBSD's tip(1) as of today 2006-08-31 14:12:22 +00:00
Xin LI
9dd54fbb7e In rev. 1.2 we have introduced a fallback handler for files with unknown
extensions.  This seems to be unnecessary and prevents less(1) from being
able to detect file changes, so remove the part.

Submitted by:	Eric Huss <e-huss netmeridian com>
PR:		bin/102624
Discussed with:	des
MFC After:	3 days
2006-08-30 08:20:34 +00:00
Joseph Koshy
59b2dc9f8b Manual page tweaks.
Submitted by:	Niclas Zeising <lothrandil at n00b.apagnu.se> on freebsd-doc
2006-08-29 18:11:20 +00:00
Poul-Henning Kamp
fd0232603d Improve input parsing:
Add "-C <column>" and "-d <delims>" options to chop up input lines.

Make '#' a comment character, rest of line is ignored.

Submitted by: Dmitry Morozovsky <marck@rinet.ru>
2006-08-28 08:27:02 +00:00
Ruslan Ermilov
2d05c776ef Remove alpha-specific stuff. 2006-08-23 12:12:56 +00:00
Marcel Moolenaar
e108ac655d Build libsmb and smbutil on ia64. 2006-08-22 03:22:17 +00:00
Marcel Moolenaar
4c5876d2ad Remove alpha left-overs. 2006-08-21 19:49:57 +00:00
Daniel Gerzo
695e93d68e Add myself to the FreeBSD callendar. Ooops, it seems like I'm the
second youngest.

Approved by:	keramida (mentor)
2006-08-20 18:52:37 +00:00
Xin LI
d605d70a75 Hook lessecho(1) to build. 2006-08-20 15:52:17 +00:00
Xin LI
72bc07dc83 Regen. 2006-08-20 15:51:18 +00:00
Yaroslav Tykhiy
6c43fb6f9e Tell in a comment that the symlinks from /usr/bin are
for compatibility with other OS types, too.

Pointed out by:		gad
2006-08-20 04:25:20 +00:00
Yaroslav Tykhiy
55416ca8f7 Install pkill(1), aka pgrep(1), to /bin so that rc scripts
can use this small and nifty utility.  Create compatibility
symlinks from /usr/bin for the time being to avoid breaking
custom scripts relying on the hardcoded path to the utility.

If pkill(1) takes root, its source should be repocopied some
day to src/bin.

Idea by:	des
Discussed with:	brooks (in cvs-src and cvs-all)
2006-08-19 08:24:01 +00:00
Ceri Davies
15af4b716b Further nitpicking. 2006-08-17 16:29:27 +00:00
Ceri Davies
4b3d1ae7a4 Fix a grammatical error.
Funny how one character can completely distort the perception of a sentence :)
2006-08-17 16:20:42 +00:00
Maxim Konovalov
ec2c2c379b o Fix the date of LZ 129 Hindenburg crash.
PR:		misc/102137
Submitted by:	jasper@openbsd
MFC after:	3 days
2006-08-16 11:54:07 +00:00
Giorgos Keramidas
a6dd1c93f4 Add support for splitting at gigabyte boundaries. [1]
Also make both lowercase and uppercase suffix letters work
as byte-count suffixes, i.e. the following two commands are
equivalent now:

    % split -b 4m foo
    % split -b 4M foo

Submitted by:		Roman Divacky [1]
Lots of help by:	cperciva
Reviewed by:		cperciva
MFC after:		1 week
2006-08-10 10:41:47 +00:00
Maxim Konovalov
e4df92e126 o Simple strcpy/strcat replacement.
PR:		bin/101575
Founded by:	Dan Lukes
Obtained from:	OpenBSD, rev. 1.11 by deraadt
MFC after:	2 weeks
2006-08-09 19:12:10 +00:00
Giorgos Keramidas
49198c4297 Update usage & SYNOPSIS and clarify that input files are not removed.
Sort getopt option handling of -p too, while here.

The changes are adapted from a patch by Ruslan Ermilov, posted as
followup to docs/33852.

PR:             docs/33852
Submitted by:   Gary W. Swearingen <swear@blarg.net>
MFC after:      1 week
2006-08-08 21:25:22 +00:00
Bruce M Simpson
abfdccc7ce Update document date.
Noticed by:	ru
2006-08-03 20:43:51 +00:00
Bruce M Simpson
6b04b7f63e Add a new command-line option, -P, which allows the user to specify
an arbitrary port to which syslog messages are to be sent.

PR:		bin/54026
Submitted by:	Oliver Fromme
MFC after:	10 days
2006-08-02 13:21:44 +00:00
Joseph Koshy
1ae9926515 In 'od -c' mode, deal with printable but zero-width combining
characters correctly.  These characters are displayed "combined"
with a space character.

PR:		misc/100215
Submitted by:	"J.R. Oldroyd" <<fbsd AT opal.com>>
Reviewed by:	"J.R. Oldroyd" <<fbsd AT opal.com>> (revised patch)
MFC after:	3 days
2006-07-31 14:17:04 +00:00
Yaroslav Tykhiy
594a130b8a Stop enforcing dependencies between MK_* options at Makefile level.
All the dependencies are satisfied now in <bsd.own.mk>.
2006-07-31 13:29:36 +00:00
Tim Kientzle
fc1e63e49b Remove two unused variables.
Thanks to: Stefan Farfeleder
2006-07-31 04:57:46 +00:00
Tim Kientzle
902ce6f035 Conditionally include sys/mkdev.h on platforms (such as Solaris) that need it.
While I'm here, correctly alphabetize 't' after 's'.

Thanks to: VMiklos
2006-07-30 18:34:40 +00:00
Maxim Konovalov
1b405ff747 o Kill unneeded assignment.
Obtained from:	OpenBSD
2006-07-30 07:41:28 +00:00
Yaroslav Tykhiy
096146f88b - Achieve WARNS=3 by using sparse initializers or avoiding initializers at all.
- Fix a nlist initialization: it should be terminated by a NULL entry.
- Constify.
- Catch an unused parameter.

Tested on:	i386 amd64 ia64
2006-07-28 16:16:40 +00:00
Yaroslav Tykhiy
7b95a1ebbd Achieve WARNS=2 by using uintmax_t to pass around 64-bit quantities,
including to printf().  Using uintmax_t is also robust to further
extensions in both the C language and the bitwidth of kernel counters.

Tested on:	i386 amd64 ia64
2006-07-28 16:09:19 +00:00
Yaroslav Tykhiy
778d2bddd2 Both fields of struct timeval are of a non-basic type,
so we should cast them to a type printf() knows about.
2006-07-28 11:17:17 +00:00
Yaroslav Tykhiy
b7dd94d5e6 Avoid useless work: Do not build inet6.c if INET6 support is off.
This also avoids pretending that netstat includes inet6.c in the
output from ident(1).
2006-07-28 11:09:21 +00:00
Yaroslav Tykhiy
2cc3124e10 Obey MK_INET6_SUPPORT. 2006-07-27 14:20:14 +00:00
Yaroslav Tykhiy
d1773e839f Respect MK_INET6_SUPPORT.
Move INET6 out of the RELEASE_CRUNCH conditional block
because it saves as little as 2% of the binary size and
IPv6 is rather popular today.  (Some other binaries, e.g.,
telnetd, include INET6 for RELEASE_CRUNCH already.)
2006-07-27 14:19:30 +00:00
Yaroslav Tykhiy
46ae665613 rpcinfo(1) doesn't depend on INET6 explicitly. 2006-07-27 13:47:02 +00:00
Xin LI
1aeafe6572 Make sure that the sc pointer gets initialized. No functional change
should happen with this change.
2006-07-26 08:58:00 +00:00
Jung-uk Kim
93e3b716ba Fix 32-bit integer math on 64-bit processor. Just use int32_t(!) instead
of incorrect and machine-dependent integer math.  Now we can encrypt a file
on an i386 and decrypt it on an amd64, and vice versa.

Submitted by:	Andrew Heybey < ath at niksun dot com >
2006-07-25 22:20:05 +00:00
Robert Watson
df3e013b3e Remove MT_FTABLE printout in systat, as MT_FTABLE mbufs are no longer
used in the kernel.
2006-07-24 01:49:24 +00:00
David E. O'Brien
38a1ab4173 Tell when a .include is processed with '-dd'. 2006-07-22 14:00:31 +00:00
Stefan Farfeleder
845b8cbcbf Remove break after return. 2006-07-18 10:19:46 +00:00
Stefan Farfeleder
107f86a291 Document that the pathname(s) following the options need not be given if
-f pathname was specified.
2006-07-18 07:39:22 +00:00
Stefan Farfeleder
cd1de708cd Fix type mismatch between char * and unsigned char *. C guarantees that
the values of the characters here are positive, so it's safe to index arrays
with them.
2006-07-18 07:29:42 +00:00
Stefan Farfeleder
ae66acac87 The variables i and tot don't need to be static. 2006-07-18 07:16:25 +00:00
Stefan Farfeleder
080397239a Remove break after return. 2006-07-18 07:10:30 +00:00
David E. O'Brien
2cae2b7d30 VarAdd() already does the debug printing, so Var_Set() only needs to do it
in the case the var already exists.
2006-07-17 21:05:27 +00:00
David E. O'Brien
99f08b7740 whitespace fixing 2006-07-17 19:16:12 +00:00
Julian Elischer
109dad819f Not having ipv6 in your kernel is not an error and should not be reported.
MFC after:	1 week
2006-07-14 23:32:43 +00:00
Maxim Konovalov
5a3e0a1b99 o Fix some printf(3) format nits in my patch I submitted to kib@.
Submitted by:	ru
2006-07-12 13:36:08 +00:00
Konstantin Belousov
09e7364ee9 Remove slipped in spaces.
Pointed out by:	maxim
Approved by:	pjd (mentor)
2006-07-12 12:42:47 +00:00
Konstantin Belousov
fd6afe791c Check that the signal number is in range.
Submitted by:	maxim
MFC after:	1 week
Approved by:	pjd (mentor)
2006-07-12 12:41:56 +00:00
Konstantin Belousov
1a8b0c1571 Check that the signal number is in range.
Submitted by:	Michiel Boland <michiel boland org>
MFC after:	1 week
Approved by:	pjd (mentor)
2006-07-12 09:13:33 +00:00
Oleg Bulyzhin
7c7f48f12c Since kernel & userland use different timebase and netstat is reading kernel
memory directly, we should do timebase conversion for route lifetime.

Approved by:	glebius (mentor)
2006-07-06 11:59:27 +00:00
Pyun YongHyeon
740cf1fd67 Add myself. 2006-07-04 23:52:12 +00:00
Greg Lehey
cdef7e2711 Update dillon's mail address. 2006-07-04 03:29:31 +00:00
Ruslan Ermilov
2982527d8b - Simplify the formatting in the SYNOPSIS.
- Add the forgotten new option in usage().
2006-06-30 08:19:26 +00:00
Florent Thoumie
aa1d7ce72f Add a -q option to suppress header lines when multiple files are specified.
Approved by:	cperciva (mentor)
MFC after:	1 week
2006-06-29 22:07:49 +00:00
Boris Samorodov
ecbbee76f3 Add myself to the freebsd calendar.
Approved by:	netchild (mentor)
2006-06-22 14:22:20 +00:00
David E. O'Brien
b3f1b4a2c7 Update for the 'file' 4.17 import. 2006-06-19 08:10:23 +00:00
Stefan Eßer
d1b76f3f6e Fix display of idle processes, which had been broken since rev. 1.56 of
machine.c. The traditional condition was (pctcpu > 0 || SRUN), but the
negation of the condition logic (from select to skip) made this come
out as (pctcpu > 0 && SRUN), leading to a very erratic display, except
for purely CPU bound processes.

This has been discussed in the mail lists some time ago and I have used
top with this patch on my systems for more than a year without problems
(just forgot to commit it earlier, since my systems were all fixed ...).
2006-06-11 19:18:39 +00:00
Maxim Konovalov
6d3d5db831 o Sync usage() with reality. 2006-06-11 17:40:25 +00:00
Robert Watson
b5fc62e2f7 Add audit.h to mkioctls inclusion list: audit pipe ioctls need access
to the audit types.

Submitted by:	wsalamon
Obtained from:	TrustedBSD Project
2006-06-05 10:06:51 +00:00
David E. O'Brien
bb6988aa71 Increase the field widths of flt (total number of page faults), fr (pages
freed), & cs (CPU context switch rate).  'vmstat 1' output is now lined up
for today's typical machines vs. a VAX.  [tested my modest 1.6ghz laptop]
2006-06-03 20:34:56 +00:00
Greg Lehey
a176b8d333 Correct previous commit. We don't want to suppress an entry because
it runs into the following month.  Instead adjust month and day,
wrapping round into next year where necessary.

MFC after: 14 days
2006-05-31 01:30:50 +00:00
Greg Lehey
29ef275b38 Don't go past the end of the month with a repetitive entry of the
style "every Monday":

   mon *	Do Foo.

Previously, at the end of the month, this could cause a printout of
the following nature when invoked with -A 7:

   36 May* Do Foo

MFC after:	2 weeks
2006-05-30 04:00:23 +00:00
John-Mark Gurney
50866a5cf3 remove comment about systems, I got confused which arch one of my systems
was...

Pointed out by:	ru
2006-05-29 10:57:13 +00:00
Stefan Farfeleder
311e80b148 Print the euid after the gid as demanded by POSIX.
Submitted by:	Martin Nagy <nagy.martin@gmail.com>
PR:		96239
MFC after:	2 weeks
2006-05-28 12:32:30 +00:00
John-Mark Gurney
2f25c9bd65 document that even if magic is newer than magic.mgc, it isn't used
compiling mgc on a big endian system (specificly tested sparc64) breaks,
using one from a little endian system works
2006-05-28 07:15:35 +00:00
Kirill Ponomarev
85184b8b23 Fix using "P" command on empty pattern space. If the "P" command is
used once on a non-empty pattern space and then again on an empty
pattern space, the second usage restores the pattern space length to
the length that it had when the first "P" was used.

PR:		bin/96052
Submitted by:	Andrey Zholos <aaz@althenia.net>
MFC after:	7 days
2006-05-27 19:32:28 +00:00
Kirill Ponomarev
5a890aac57 Add the capability for a trailing scale indicator to cause the
specified size to be read in the more familiar units of kilobytes,
megabytes, gigabytes, terabytes and petabytes.

PR:		bin/50988
Submitted by:	Matthew Seaman <m.seaman@infracaninophile.co.uk>
MFC after:	7 days
2006-05-27 18:27:41 +00:00
Kirill Ponomarev
4ba3b38b64 Enable numeric arguments and +/- prefixes with -user (-group)
options.

PR:		bin/71513
Submitted by:	Andre Albsmeier <Andre.Albsmeier@siemens.com>
MFC after:	7 days
2006-05-25 21:20:43 +00:00
Brad Davis
eaa9b5ef09 s/on a crt//
systat is working great on this LCD ;)

Submitted by:	Ben Haga <tuximus AT absoludicrous DOT com>
MFC after:	3 days
2006-05-25 06:05:04 +00:00
Alexander Leidinger
98a68a586f Change kdump to print more useful information, i.e. it changes from
32229 telnet   CALL  mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
 32229 telnet   CALL  open(0x2807bc28,0,0x1b6)
 32229 telnet   CALL  socket(0x2,0x2,0)
to
 32229 telnet   CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
 32229 telnet   CALL  open(0x2807bc28,O_RDONLY,<unused>0x1b6)
 32229 telnet   CALL  socket(PF_INET,SOCK_DGRAM,0)

David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.

Submitted by:	"David Kirchner" <dpk@dpk.net>
Suggested by:	FreeBSD ideas list page
Reviewed by:	arch
2006-05-20 14:27:22 +00:00
Robert Watson
99b671f5a1 In change 1.15, an arbitrary setting of the max RPC record size to
RPC_MAXDATASIZE was introduced.  This is believed to have been debugging
code committed accidentally, although I've been unable to reach the
committer to confirm this.  The effect was to limit the size of RPCs on
TCP and UDP to 9k, well below the default protocol limits in the libc
rpc code.  This change simply removes these introduced limits, falling
back on the libc definitions.

PR:		88856
Reported by:	Keith Bostic <bostic at sleepycat dot com>
Testing by:	Susan LoVerso <sue at loverso dot southborough dot ma dot us>
Reveiwed by:	cel, rees
Review timeout:	alfred, mbr
MFC after:	2 weeks
2006-05-17 23:18:17 +00:00
Pav Lucistnik
e4dfa7fd78 - Fix warning when compiling with -DDEBUG
Approved by:	alfred
2006-05-15 22:09:45 +00:00
Pav Lucistnik
081e5c4890 - Add decoding of kse_release, kevent, sigprocmask, unmount, socket, getrusage,
rename, __getcwd, shutdown, getrlimit, setrlimit, _umtx_lock, _umtx_unlock,
  pathconf, truncate, ftruncate, kill

- Decode more arguments of open, mprot, *stat, and fcntl.

- Convert all constant-macro and bitfield decoding to lookup tables; much
  cleaner than previous code.

- Print the timestamp of process exit and signal reception when -d or -D are in
  use

- Try six times with 1/2 second delay to debug the child

PR:		bin/52190 (updated)
Submitted by:	Dan Nelson <dnelson@allantgroup.com>
Approved by:	alfred
2006-05-15 21:18:28 +00:00
Pav Lucistnik
1675c32154 - Fix crash when hitting unknown syscall. Copied from i386-fbsd.c
Approved by:	alfred
2006-05-15 21:03:02 +00:00
Maxim Konovalov
df2e45f7c2 o Fix typo in a comment.
PR:		bin/97292
Submitted by:	clsung
MFC after:	3 days
2006-05-15 08:20:38 +00:00
Kirill Ponomarev
22170420ec The last execution of -exec {} + is not done if the -exec primary is
not on the top-level -and sequence, e.g. inside of ! or -or.

Create a separate linked list of all active -exec {} + primaries and
do the last execution for all at termination.

PR:		bin/79263
Submitted by:	Jilles Tjoelker <jilles@stack.nl>
MFC after:	7 days
2006-05-14 20:23:01 +00:00
Pawel Jakub Dawidek
b6d7073d13 Handle SIGINFO in time(1) by printing the time the given command is running.
I find it quite handy to just hit ^T and see the time.
2006-05-14 13:16:19 +00:00
Ruslan Ermilov
1e967a0b4e So, what's it supposed to say when you type "make love"? 2006-05-11 18:08:44 +00:00
Poul-Henning Kamp
bec1fa8607 Use sysctlbyname 2006-05-11 17:25:36 +00:00
Coleman Kane
7a1877d4c6 Add myself to the freebsd calendar. 2006-05-08 23:48:26 +00:00
Ion-Mihai Tetcu
6ce3af2460 Add myself.
Approved by:	tmclaugh (mentor)
2006-05-08 20:28:38 +00:00
Andrew Pantyukhin
cdf0b41844 Add myself
Approved by:	krion
2006-05-07 07:45:39 +00:00
Maxim Konovalov
fadc7151b7 o Implement "-n" flag: ignore files and directories with user "nodump"
flag set.  Useful for calculation dump -h dump size.

PR:		bin/96864
Submitted by:	Dmitry Kazarov
Obtained from:	NetBSD (man page)
MFC after:	1 month
2006-05-06 22:04:59 +00:00
Hajimu UMEMOTO
920b61d0bf The port number must be network byte order. 2006-05-04 11:28:16 +00:00
Maxim Konovalov
dcd61bb80c o style: WARNS= -> WARNS?=.
Spotted by:	ru
2006-05-04 09:01:54 +00:00
Maxim Konovalov
c912a3f7be o By popular demand import getent(1) utility: a program retrieves
and displays entries from the administrative database specified by
database, using the lookup order specified in nsswitch.conf(5).

PR:		bin/79903, bin/88460, bin/96536
Submitted by:	Julien Gabel, Dan Nelson, Daniel J. O'Connor
Obtained from:	NetBSD
Discussed with:	ume, soc-bushman
MFC after:	1 month
2006-05-04 08:44:44 +00:00
Bruce Evans
de916c8b74 Move the formatting of the NICE column to a new function format_nice()
so that it can be more easily unbroken and extended.

Try to use `static', `const' (as appropriate), prototypes declared together,
and parameter names in prototypes for all private functions, not just the
new one.
2006-05-04 03:56:31 +00:00
Bruce Evans
789e38771b Fixed some style bugs (mainly missing and wrong splitting of long lines). 2006-05-04 03:00:13 +00:00
Poul-Henning Kamp
5f72b6ac80 Avoid coredumps if stddev cannot be computed (if all datapoints are identical)
Small cleanup of label printing.
2006-05-02 07:34:38 +00:00
Bruce Evans
04984aac91 For the vmstat sub-display:
vmstat.c:
Move totfr to be under daefr and prcfr since it logically belongs there.

Move all the count fields (wire, act, inact, cache and free) to near
the bottom of the sub-display (after all the rate fields) to reduce
competition with adjoining sub-displays.

systat.1:
Move things as above.

Attempt to improve missing and poor wording in the description of the
fields.  The long sentence was hard to parse and didn't say anything
about the different units.

Increment .Dd.
2006-05-01 07:02:52 +00:00
Tim Kientzle
323b71146a In the examples, use "tar.gz" as the extension for
gzip-compressed tar archives.

Thanks to: Mike Hunter
2006-05-01 01:34:21 +00:00
Bruce Evans
74a2149c90 Unbreak the support for 24-row terminals in the vmstat display. The
part that handled the 17th and 18th rows of the vmstat-proper subdisplay
was deleted in rev.1.10 when these rows stopped being used and was not
restored when the 17th row was used again.  For such terminals, we now
lose the `buf' field instead of making a mess with it.  Terminals with
fewer than 24 rows have never been supported.

The problem is not avoided by using curses since we use the last line
for data entry and don't use a separate subwindow for this line.
Some other things in the vmstat display could be handled better using
subwindows.
2006-05-01 00:26:43 +00:00
Bruce Evans
1247d9c61c Sort the ex-extended vmstat fields into their documented order in the
output too.

Fine tune all coordinates and most field widths in the vmstat (sub)display
for this and previous changes now that we have to change almost all of them
just to move the ex-extended fields:
- change VMSTATROW back to 7.  It was 6 due to a hack in the extended vm
  stats changes.
- reduce the maximum field width that we try for from 9 to 8.  4 or 5 is
  enough for most fields but we try to use the same width for all fields.
  8 is enough to display everything without changing units memory sizes
  exceed 100GB.

Fix some unrelated coordinates and field widths in comments.
2006-04-30 23:52:16 +00:00
Bruce Evans
de9a857e4c Eliminate the "extended" vm stats. Move all fields in the extended
vm stats to the normal vm stats.  Sort them into the normal stats
according to the man page only in the source code so that diffs are
almost readable.  Reduce style bugs in printing the value of %ozfod.
2006-04-30 22:34:54 +00:00
Bruce Evans
71ae810140 Update for moving some fields to the new vnstat display.
Don't say that `cache' is for the buffer cache.

Describe the uselessnes of `buf'.
2006-04-30 22:05:02 +00:00
Bruce Evans
9177eda617 Reduce the namei (sub)display by 5 columns to make enough space for a
new vnstat display to the right of the namei display.

Move the non-vmstat fields {des,num,fre}vn from the vmstat display to a
new vnstat display.  Move the dtbuf field there too.  The buf and dtbuf
fields are non-vmstat and non-vnstat, so there is no good place to
display them.  I need to move at least 1 of them out of the vm stats
for further cleanups of the vm stats, and there is only space for 1
of them in the vn stats.  (The best place for the current buf field
is actually /dev/null, since it has been completely broken for about
10 years and broken for longer.  It gives an uninteresting virtual
memory count where an interesting real memory count is wanted.)
2006-04-30 20:31:00 +00:00
Bruce Evans
b16f944633 Removed the description of the nonexistent want_fd command. want_fd existed
for only 2 weeks in 1998-1999.  It was replaced by general commands to
select the set of disk drives displayed.
2006-04-30 09:23:11 +00:00
Bruce Evans
3bccedcdf8 Don't redraw the disk names on every update. This was apparently done
to handle changes to the set of disks selected, but it is unnecessary
for that since the whole screen is redrawn when this set is changed.
It was also buggy:
- MAXDRIVES*6 = 42 was hard-coded as only 30 spaces in a string literal,
  the last 2 disk names were not cleared as intended
- when the extended vmstats are active, clearing of even 30 columns
  overruns the ozfod value field by 3 columns.  This was harmless because
  the field is much wider than necessary.
2006-04-30 09:13:59 +00:00
Bruce Evans
6e977072c6 Fix "slow (on-the-fly) zero fills percentage (`%slo-z')" some more. The
value printed is actually the optimized (i.e., the non-slow, not-on-the-fly
zero fills percentage) except in overflow cases.  Describe it as %ozfod
in the display.  Move the field descriptor 1 to the left so that there
is space for 5 characters after the % sign (this leaves no space between
the number and the descriptor but the % character serves well as a
separator).

Fixed integer overflow at z.ozfod = UINT_MAX/100 in the calculation of
%ozfod.  This value can be reached just a few hours or minutes after
booting, so %ozfod was usually garbage in boot mode.  Now %ozfod is
correct in boot mode for a few days or hours.

Print a non-dummy %ozfod when the division for it isn't division by 0
instead of when the result will be less than 100%.  A result of 100%
may be correct, though a result of more than 100% indicates overflow
of one or both counters.
2006-04-30 07:27:23 +00:00
Bruce Evans
43f2757a27 If DEBUG is defined, then fill numeric fields with asterisks instead of
spaces and numbers for temporary(?) debugging.
2006-04-30 05:54:21 +00:00
Bruce Evans
a9a3dcd64f Remove trailing whitespace.
Submitted by:	Se=E1n Farley <sean-freebsd at farley dot org>
PR:		bin/81874
2006-04-30 04:47:23 +00:00
Bruce Evans
8aa22952a9 Show the load average in the tcp display (it was already shown, perhaps
not very usefully, in all other displays).  This was the original point
of the PR.

Move the load average up by 2 so that it starts in row 0 for all windows
(2 lines above it were wasted for all other windows except vmstat).
Move everything below it up by 2 or 3 (3 for icmp and icmp6 which had
an extra blank line due from not compensating for the foot-shooting in
note (3); only ip and ip6 compensated).  Reduce the magic numbers related
to this.

Notes by the submitter:
%%%
1. All the subwin() calls are identical using #define MAINWIN_ROW 3
    (systat.h).
2. The load average is at the top of the window.
3. Each display starts on the fourth line.  I made changes to those
    displays that shifted the start line (i.e., icmp).  This entailed a
    lot of changes within the comments at the top of those displays.
4. For ip6, I shifted the "Input next-header histogram" column down one
    row to separate it from "IPv6 Output".  I raised "bad scope packets"
    and "address selection failed" up one row to stay with "IPv6 Input"
    (valid?).  They were down one row to probably line up at the bottom,
    but I think they should stick with their fellow items in a column.
5. I condensed ifstat a bit.  It had a lot of empty rows.
%%%

Submitted by:	Se=E1n Farley <sean-freebsd at farley dot org>
PR:		bin/81874
2006-04-30 04:26:46 +00:00
Bruce Evans
4545c62547 Edit the interrupt name strings to shorten them. This is believed to
only affect amd64 and i386.  alpha uses "intr N" instead of "irqN" and
mostly has no device names.  ia64 uses only device names.

- Edit interrupt names once after they are read from the kernel and not
  every time they are displayed.
- Discard bogus trailing spaces so that the next step doesn't move things
  to oblivion.
- If an interrupt name starts with "irqN:" (as it usually does in on
  amd64 and i386), then move "irqN" to the end and strip ":", since we
  have no space for the ":" and don't want to start descriptions with
  "N" after stripping "irq" in the next step (since "N" would look like
  a count).  This step may need reworking for interrupt names containing
  several device names -- then moving the irq number to the end would
  lose it instead of losing some device names.
- Remove "irq" from an interrupt name if and only if the original name is
  too long to display.
2006-04-30 01:39:46 +00:00
Bruce Evans
18d3a03e13 Backed out rev.1.49 since it had buffer overruns and only worked
accidentally.

Read buffer overruns:
The size of the target array (TSOTTA == 10) is a wrong limit to use for
scanning the source string.

Write buffer overruns:
TSOTTA is also a wrong limit to use for copying to the target buffer,
since we want to add a NUL terminator afterwards.  TSOTTA was also 1
too small for holding both the desired number of visible characters
and the NUL.

Worked accidentally:
There is error in the algorithm that tends to result in the space saved
by stripping "irq" not actually being used, but some cases worked
accidentally provided "irqN" is near the end of the source string and
"N" is only 1 digit.

Starting with 5.mumble-CURRENT, "irqN" is at the beginning of the
string on all (?) arches that have it and the accidents don't happen.
E.g. on i386's, the keyboard irq is now named
"irq1: atkbd0<bogus blank padding>" by the kernel, and this name was
converted to "1: atkb" -- not only the device number but part of the
device name has been lost --, while before 5.mumble the kernel name
was "atkbd0 irq1" and systat accidentally preserved the irq number to
give "atkbd0 1".  The ":" in the string wastes precious space, and
stripping "irq" results in descriptions starting with numbers which
makes them look too much like counts.  This commit just fixes the last
problem.
2006-04-30 00:50:08 +00:00
Bruce Evans
e76bdda079 Abbreviate long field descriptors at write time so that they don't get
clobbered at runtime:
    dirtybuf -> dtbuf
    desiredvnodes -> desvn
    numvnodes -> numvn
    freevnodes -> frevn
The vmstats column has only 5 characters available for descriptors, but up
to 13 were used.  The extras get clobbered at runtime by interrupt values
and/or descriptors on systems with more than 12 interrupt sources.
    %slo-z -> %sloz
This one is in the "extended" vmstats area and doesn't get clobbered now.

Removed stale documentation of desvn.

Changed a descriptor:
    tfree -> totfr
so that it is consistent with the abbreviations for other free counts
(daefr and prcfr) and thus almost decodeable.

Fixed missing documentation of tfree/totfr.  This and everything else
in the extended vmstats area is misdocumented as being in a certain
place in the vmstats column.
2006-04-29 21:30:23 +00:00
Warner Losh
830de116de ru@ recently changed lorder to support library archives. Document
this new feature prominently.  Bump date while I'm here.
2006-04-27 15:48:54 +00:00
Joseph Koshy
ee8e4b36bb Fix a typo.
Submitted by:	Pawel Worach <pawel.worach at gmail dot com>
MFC after:	1 week
2006-04-22 03:04:24 +00:00
Xin LI
3254fa322f Because optarg and optind are defined in unistd.h,
remove the defination here.
2006-04-21 09:39:51 +00:00
Christian Brueffer
f41d690787 Indentation fixes 2006-04-19 19:09:21 +00:00
Maxim Konovalov
beb66b02a4 o Close an output file -o flag opened before execvp(3) in a child.
PR:		bin/89666
Submitted by:	Arne H Juul
MFC after:	1 month
2006-04-16 17:44:49 +00:00
Christian Brueffer
dd09eba412 Fix indentation for "Ostersonntag".
Obtained from:	OpenBSD
2006-04-16 10:34:56 +00:00
Ruslan Ermilov
e4a9274404 Add missing library dependencies. 2006-04-13 12:49:24 +00:00
Florent Thoumie
ce5756e3bb Fix Mother's/Father's day in most case.
PR:		misc/79415
Submitted by:	thierry
Approved by:	cperciva (mentor)
MFC after:	1 week
2006-04-13 12:14:44 +00:00
Ruslan Ermilov
295c5dea2c libc_r is no longer provided, and on alpha and sparc64, libthr
is (sym)linked to libpthread.  Account for this change and
check for MK_LIBTHR instead of MK_LIBC_R where appropriate.
2006-04-12 19:52:34 +00:00
Pawel Jakub Dawidek
e6f3621dd3 Allow to specify size in terabytes by using T or t suffix.
This speeds up my testing a bit. Because truncate(1) doesn't allocate
blocks on file system before they are used, it is very useful to
emulate huge file systems:

	# truncate -s 16T fs.img
	# mdconfig -a -f fs.img
	# newfs /dev/mdX

(-t swap can be used as well)
2006-04-09 19:16:24 +00:00
Max Khon
99d3c2c46c Update comment about var modifiers (add 'N' and 'O' descriptions). 2006-04-08 07:02:39 +00:00
Max Khon
66b07418fa Add :u var modifier (remove adjacent duplicate words like uniq(1).
Reviewed by:	harti
Obtained from:	NetBSD (mostly)
2006-04-08 06:59:54 +00:00
Ceri Davies
d11138e871 Fix options broken when the birthtime related primaries were added.
Note to self: if a comment says a list must be lexically sorted, sort
the list lexically.

Submitted by:	Pawel Worach
Approved by:	jhb
MFC after:	2 weeks
2006-04-05 23:06:11 +00:00
Alejandro Pulver
67e75d082d Add my birthday.
Approved by:	garga (mentor)
2006-04-04 22:32:14 +00:00
Jean Milanez Melo
aaf860a446 - Add my birthday
Approved by: mnag (mentor)
2006-04-04 13:06:21 +00:00
Ceri Davies
440a24d87d Note that all of the birthtime related primaries are non-standard. 2006-04-04 10:20:16 +00:00
Ceri Davies
bb0d5fd575 Bump .Dd for the birthtime options. 2006-04-03 20:53:34 +00:00
Ceri Davies
31d534254e Add -Btime, -Bnewer, -Bmin, -newerB[Bacmt], -newer[acmt]B options to
work with the st_birthtime field of struct stat.

'B' has been chosen to match the format specifier from stat(1).

Approved by:	jhb
MFC after:	2 weeks
2006-04-03 20:36:37 +00:00
Tim Kientzle
b8c95d3fe1 If you see a broken symlink, don't try to follow it,
just archive it as a symlink, even if -h was specified.

Thanks to: Jin Guojun
PR: bin/95175
MFC After: 1 week
2006-04-02 07:13:11 +00:00
Olivier Houchard
8f9370b050 Don't call audit_logout() if pwd is NULL, as audit_logout() attempts to
dereference it.
This will happen if we ^D at the Login: prompt without having provided a
valid login before.
Set pwd to NULL on bad login attempts to prevent audit_logout() from being
called for a user which didn't actually log on.

Reported by:    Jerome Magnin jethro at docisland dot org
2006-03-28 15:30:42 +00:00
Peter Wemm
045b6fdaf6 Make gcore(1) 64 bit safe. It was trying to parse the /proc/*/map file
using sscanf and truncating the start/end entries by writing them with a
32 bit int descriptor (%x).  The upper bytes of the 64 bit vm_offset_t
variables (for little endian machines) were uninitialized.  For big endian
machines, things would have been worse because it was storing the 32 bit
value in the upper half of the 64 bit variable.  I've changed it to use
%lx and long types.  That should work on all our platforms.
2006-03-25 01:14:20 +00:00
Tim Kientzle
6b422e20c1 Extended attribute support on write for Linux; FreeBSD hooks are
forthcoming.  This commit also has a number of style(9) fixes and
minor corrections so the code works better with the build system being
used for non-FreeBSD builds.

Many thanks to: Jaakko Heinonen, who proposed a mechanism for extended
attribute support and implemented both the machine-independent portion
and the Linux-specific portion.
2006-03-21 17:03:51 +00:00
Ruslan Ermilov
a50767eb92 Unbreak WITHOUT_LIBPHREAD/WITHOUT_LIBC_R option support, depending
on platform.
2006-03-21 11:00:54 +00:00
Ruslan Ermilov
cea557add0 Extend coverage of the MK_IPX build option to the following:
- <netipx> headers [1]
- IPX library (libipx)
- IPX support in ifconfig(8)
- IPXrouted(8)
- new MK_NCP option

New MK_NCP build option controls:

- <netncp> and <fs/nwfs> headers
- NCP library (libncp)
- ncplist(1) and ncplogin(1)
- mount_nwfs(8)
- ncp and nwfs kernel modules

User knobs: WITHOUT_IPX, WITHOUT_IPX_SUPPORT, WITHOUT_NCP.

[1] <netsmb/netbios.h> unconditionally uses <netipx> headers
so they are still installed.  This needs to be dealt with.
2006-03-20 14:24:58 +00:00
Ruslan Ermilov
5740a2b62d Convert NO_PROFILE and NO_LIB32 to new style. 2006-03-18 21:37:05 +00:00
John-Mark Gurney
b955f00544 add an entry for ozfod..
MFC after:	3 days
2006-03-18 10:40:28 +00:00
John-Mark Gurney
244bb595f4 fix spelling of ozfod... I've been wondering why we'd need to fill a page
w/ non-zero data, and it turns out we don't...  This is really optimized
zero filled on demand, or pages that were already zero'd for us...

MFC after:	3 days
2006-03-18 01:06:13 +00:00
Maxim Sobolev
d3ff297263 A few minor corrections to the mkuzip.8 man page.
PR:		92576
Submitted by:	Stefan Bethke
2006-03-17 20:48:10 +00:00
Ruslan Ermilov
e1fe3dba5c Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
Joseph Koshy
4c1a7dd294 Cross-reference basename(3) and dirname(3). 2006-03-16 17:21:52 +00:00
Robert Watson
9e92c8d486 When opening a trace file, open O_NONBLOCK so that ktrace doesn't stall
if the target is a fifo.  After opening a trace file, check that it is a
regular file, and if not, return an error.

MFC after:	3 days
Reported by:	kris
PR:		94278
2006-03-14 19:32:03 +00:00
Maxime Henrion
bb647cca85 Update make glue for csup-snap-20060313. 2006-03-14 03:53:50 +00:00
Tim Kientzle
6e64751484 Remove non-FreeBSD source from FreeBSD repository. 2006-03-12 19:55:02 +00:00
Daniel Eischen
03d485eb77 Remove including of libc sources. All the required functions
are exported by libc with prototypes in our standard headers.
I guess at one time this was necessary, but not any longer.
2006-03-10 07:58:02 +00:00
Tim Kientzle
e11aae440c Remove configure.ac.in and the 'distfile' target from
the FreeBSD makefile.  This is a step towards cleaning
out the non-FreeBSD bits from the FreeBSD source tree.
2006-03-08 02:49:12 +00:00
Tim Kientzle
8682859c8c Add a check for Linux' "libacl" library and headers. 2006-03-07 06:07:41 +00:00
Tim Kientzle
b5b5211732 Change the output of --version to match GNU "gnits" standards.
(I'm not using GPL, but I still think there are good
ideas in the GNU projects. ;-)  Among other things,
this should make it easier for clients of bsdtar to
recognize it automatically:
  bsdtar --version | grep bsdtar
2006-03-07 06:05:38 +00:00
Tim Kientzle
bce43ea96d Fix a format mismatch (%d integer format, platform-dependent
argument type).
2006-03-07 06:02:09 +00:00
David E. O'Brien
858494e461 Add an override (DONTSTRIP) so that one can easily install debugable
binaries when one cannot easily edit a package's Makefiles and/or
configure scripts.
2006-03-06 21:52:59 +00:00
Yaroslav Tykhiy
ebf3356a26 Managing login.access is no longer a responsibility of login(1).
Therefore give a xref, not details.

MFC after:	3 days
2006-03-06 13:07:17 +00:00
Yaroslav Tykhiy
d072921b75 Remove the last reference to LOGIN_ACCESS from login(1).
MFC after:	3 days
2006-03-06 12:56:35 +00:00
Yaroslav Tykhiy
700c87c3db login.access.5 and login_access.c are no longer used
in usr.bin/login because the login.access feature has
moved to PAM completely.

Their counterparts in lib/libpam/modules/pam_login_access
have been found to be in sync with, and even in better shape
than, login.access.5 and login_access.c here.

Therefore cvs rm login.access.5 and login_access.c from
usr.bin/login so that nobody will waste their time on fixing
or developing the files here.

MFC after:	3 days
2006-03-06 12:54:03 +00:00
Yaroslav Tykhiy
e65f3545ff login(1) no longer handles /etc/login.access by itself,
it's PAM's job.

MFC after:	3 days
2006-03-06 12:38:42 +00:00
Yaroslav Tykhiy
08284aaa25 Since the whole login.access feature has moved to PAM,
login.access.5 will be installed from the respective PAM
module's src directory.

MFC after:	3 days
2006-03-06 12:31:25 +00:00
Robert Watson
e0f5d997de Reduce number of spaces for full name by four, and reduce padding
after tty entry by one space in order to provide extra spaces for
the tty entry.  As a result, full pts names are now visible (up
to 999 pts's anyway):

Before:
Login            Name                 TTY  Idle  Login  Time   Office  Phone
robert           Robert Watson       *v0   3:55  Fri    02:54
robert           Robert Watson        p0     19  Sat    11:01
robert           Robert Watson        pts        Sat    14:55

After:

Login            Name             TTY      Idle  Login  Time   Office  Phone
robert           Robert Watson   *v0       5:08  Fri    02:54
robert           Robert Watson    p0          8  Sat    11:01
robert           Robert Watson    pts/5          Sat    14:55

MFC after:	1 week
2006-03-04 16:13:16 +00:00
Maxime Henrion
b0b13d1534 Don't build csup if NO_CRYPT or NO_OPENSSL is defined, since we depend
on those.

Reported by:	marius
2006-03-03 21:12:05 +00:00
Maxime Henrion
1f6fe9ace7 Connect csup the build! 2006-03-03 14:55:43 +00:00
Maxime Henrion
2ed4c88a7d - Don't put the .h in SRCS.
- Use LDADD += -lpthread and DPADD += ${LIBPTHREAD} instead of -pthread.
- s/-I${.CURDIR}/-I./ to fix make obj.

Submitted by:	ru
2006-03-03 14:54:47 +00:00
Maxime Henrion
dd78bf1a6a Add make glue for building csup. Not yet connected to the build. 2006-03-03 04:28:13 +00:00
Wojciech A. Koszek
d2f4defee2 Fix the way in which median is calculated. If the data source has even
number of data points, value should be calculated by adding two middle
elements and dividing them by 2.

Approved by:	cognet (mentor)
2006-02-23 20:46:10 +00:00
Wojciech A. Koszek
cd234bc8bc Add myself as a new src commiter:
+ extend calendar with my birth date

Approved by:    cognet (mentor)
Reviewed by:    cognet (mentor)
2006-02-22 22:02:04 +00:00
Peter Edwards
d12dff713a If opendir(".") fails after descending into a subdirectory via
chdir(), be sure to undo the effects of the chdir before continuing.

Without this, after hitting a directory with mode 0111 (for example),
tar will get lost, and won't add any yet unvisted files to your
archive.  (Or possibly add the wrong files, I suppose...)

Reviewed By: kientzle@
2006-02-22 11:13:07 +00:00
Matthew N. Dodd
c153cdd1b8 Add option -w to specify graph width.
Use COLUMNS, terminal width for default graph width.

Reviewed by:	 rwatson
2006-02-22 04:10:20 +00:00
Olivier Houchard
b457a3e19c In wall and who, check that the utmp entry isn't stalled, as it is done in w.
Apparently with the new pts code stalled entries are printed, when they are
not with the BSD ptys.

Submitted by:	Michal Mertl <mime at traveller dot cz>
2006-02-21 13:01:00 +00:00
Andre Oppermann
4b969aa55a Improved description for packet zone statistics.
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-18 16:09:38 +00:00
Andre Oppermann
1434cbd62a Print statistics on mbuf+clusters in packet zone.
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-18 16:03:07 +00:00
Andre Oppermann
2b22cf9cbe Print statistics on jumbo mbuf clusters.
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-18 15:55:19 +00:00
Bruce Evans
8d40843ab4 Move the "r p d s w" fields to the left to create space for expansion.
3 columns were wasted at the left, except these columns were used to
make the header line up.  Now there is no space on the same line for
the "Proc:" part of the header.  Try putting this on the line above
although it clutters that line (there is already similar clutter for
the "Interrupts" header).  Leave 1 column between these fields.  With
the above and a previous change there is enough of space for this.

Use 5 columns instead of 3 for the number of users since 3 is not quite
enough and there was space to spare.  This also fixes an off-by-2 error
in a previous fix forthe column count in the comment on STATROW.

Move all the pager fields 1 to the right so that the "count" and "pages"
descriptors more clearly apply to the pager fields and not the memory
fields.  There was space to space.

Waste some of the spare space at the right of the pager fields to expand
all the pager field widths to their old values (but now with a column
between the fields).  There are fields more in need of expansion but most
of them are not in places near spare space.
2006-02-14 13:27:25 +00:00
Bruce Evans
cd8ad406ad Removed the frobbing of CPU percentages from > 99.9 to 99.9. Rev.1.35
made it unnecessary.  (Rev.1.6 had to reduce the field width to 4, and
changed 100.0 and preposterous larger values down to 99.9 since 100.0
wouldn't have fitted.  Rev.1.35 handles precentages > 99.9 well enough by
changing the format to %.0f when the string given by the initial format
is too wide.)

Even with this change, during short testing I've never seen a percentage
of 100 being displayed by systat -v, although top(1) displays percentages
of 100 user or 100 idle for similar loads.
2006-02-14 12:26:51 +00:00
Bruce Evans
4bb97cfa93 Fix some minor bugs:
Always use snprintf()'s return value, since discarding it is a style
bug at best and using it here gives slightly simpler code and better
error checking.  Use snprintf() in putlongdouble() the same as in
putfloat().  (1.25 changed most sprintf()'s to snprintf()'s to fix
non-bugs without changing the logic to use the result of snprintf();
1.27 restored one of the sprintf()s by cloning a stale version of
putfloat().)

Don't print a too-long field in the unlikely case that the fallback
to M units in putint() leaves the field still too long.  (The fallback
to printing stars was lost in rev.1.58 when the fallback to M units
was added.)
2006-02-14 11:57:02 +00:00
Bruce Evans
991d33c312 Reduce the field width by 1 for many numeric fields so that most fields
cannot run into other fields or field descriptors.  If the value is
too large to fit in the field width, then the output format is adjusted
so that the value (usually) fits, but with fields running together
externally this adjustment usually didn't help.  Mostly it doesn't
matter to lose 1 digit of precision, but switching the output format
is bad if it happens often or gives bogus units.  The loss of width
is most serious for fields near "Csw" (which are also the ones which
must often ran together) since these have a high variance and large
values relative to the possible field widths so the switch occurs more
often now, and for the memory size fields where the switch gives the
bogus units kKB or MKB.

Now only the fields for r, p, d, s and w can run into each other.
These fields have width 3, and 3 cannot be reduced to 2 without losing
all precision when the value is between 100 and 999.

Trim "pdwake" to "pdwak" at think time now that it doesn't get clobbered
at runtime.  The manpage doesn't need to be changed for this because
it documents the clobbered descriptor, unlike for 4 other too-long
descriptors which only get clobbered if there are lots of interrupt
sources.

Trim "% busy" to "%busy" since most other descriptors for percentages
are spelled without the space and this change makes changing the widths
of the %busy fields unnecessary.
2006-02-14 10:47:36 +00:00
Bruce Evans
e3c53cce47 Oops, the "excessive" {} removed in the previous commit was needed
around PUTRATE() because PUTRATE() only looked like a function -- it was
multiple statements.  Use "do {...} while(0)" as usual in PUTRATE() so
that it is a single statement that can be used like a function.
2006-02-14 09:33:51 +00:00
Bruce Evans
123fa09901 Fixed all (?) bitrot in the comments about the number of columns used by
various groups of fields.
2006-02-14 08:33:02 +00:00
Bruce Evans
dc8ccdf0dc Fix all (?) cases where the field width of a numeric field was far too
large.  In most cases it is still 1 too large, so fields tend to run
together, but in the following cases it was more than 1 too large, and
the starting column was too small too, so the field started inside the
previous field or descriptor and clobbered that:
- "wire": the number for this overwrote 2 characters of the number for
  "Flt".  Reduce the field width by 3 (2 to avoid the overwrite and 1
  so that the fields don't run together).  This was already done for
  the preceding number for "cow".
- "inact": the number for this overwrote 1 character of the descriptor
  "Idle".  Reducing the field width by 2 is enough.
- "cache:" the number for this overwrote 3 characters of the scale
  "...|    |".  The field width should be reduced by 4 to keep things
  from running together, but that is a lot and not so necessary here
  since the final "|" in the scale serves as a delimiter.  Only reduce
  it by 3.
- "free": the number for this overwrote 2 characters of the bar graph.
  The character position under the final "|" in the scale is apparently
  not used, so reducing the field width by 3 is enough.

When "zfod" is in the main vmstat display:
- use the normal field width of 9 (not 5) for it since there is no shortage
  of space.  Fix style bugs (excessive {}) in the statement that
  conditionally writes it.

Write all reduced field widths for vmstat fields as "9 - <reduction>" as
a hint that we don't want to reduce them.
2006-02-14 07:44:21 +00:00
Bruce Evans
10a84fd9f7 Fixed style bugs in rev.1.12. Rev.1.12 arranged to display the interrupt
number in more cases by stealing 2 characters from the count field to
give more space in the descriptor field, but it did the column adjustments
for this strangely using an off-by-2 error in the base column and
compensating off-by-2 errors in 6 offsets from the base column (4 new
errors and 2 from not changing the offsets that actually changed).

Print the "Interrupts" header directly at its offset from the base column
instead of spacing it half using the offset and half by printing a space
character.
2006-02-14 05:37:25 +00:00
David Malone
59643a2120 The change to make column use roundup(x, TAB) rounded things to the
current tab, however the code it replaced wanted to round to the
next TAB. Consequently things like this:

	( echo 1 ; echo 2 ) | column

cause column to loop indefinitely. This patch is slightly different
from the one Gary submitted, but is closer to the original code.

Submitted by:	Gary Cody <gary@lyranthe.org>
MFC after:	1 week
2006-02-13 22:09:26 +00:00
Dmitry Morozovsky
e3f1789aa0 Default number of direct access devices had been changed from three to two.
Reflect this in other paragraphs.

PR:		93201
Submitted by:	Marian Cerny
MFC After:	1 week
2006-02-12 10:30:52 +00:00
Robert Watson
dd8dfa82e7 Sort sfbuf allocation counters with other sfbuf information.
MFC after:	3 days
2006-02-11 21:27:16 +00:00
Robert Watson
e446b85087 Un-#if 0 the printing of allocation failure counts for mbufs, clusters,
and packets in netstat -m.

MFC after:	3 days
2006-02-11 17:18:36 +00:00
Wayne Salamon
a1c73d21bf Make login audit-enabled, submitting audit records for the login and logout
events. The specifics of submitting the records is contained within
login_audit.c.
Document the auditing behavior in the man page.

Obtained from: TrustedBSD Project, Apple Computer, Inc.
Approved by: rwatson (mentor)
2006-02-04 20:20:02 +00:00
Andrey A. Chernov
fb1a11d799 Don't set time to current, if set to specific time fails
PR:             92577
2006-01-31 02:21:18 +00:00
Pawel Jakub Dawidek
d72d8f53f5 Tell the user exactly where the problem was. 2006-01-30 23:00:48 +00:00
Marcel Moolenaar
05157fa0a1 s/DT_IA64_PLT_RESERVE/DT_IA_64_PLT_RESERVE/ 2006-01-28 17:58:22 +00:00
Brad Davis
52a3a1928e - Mention that users need to be in the wheel group to `su - root' by default, and how to change it.
PR:		docs/70616
Submitted by:	Jilles Tjoelker <jilles at stack dot nl>
Reviewed by:	ru@
Approved by:	ceri@
MFC after:	3 days
2006-01-28 01:11:11 +00:00
Hajimu UMEMOTO
d042befb98 make wall(1) work with pts. 2006-01-27 08:52:14 +00:00
John Hay
23639a23a8 Add AfriNIC as a RIR.
PR:		80421
Submitted by:	Adrian Frith <adrian at frith.homelinux.org>
MFC after:	6 days
2006-01-23 13:49:39 +00:00
Matteo Riondato
ea759b3eb4 Add myself to the list (Ehi, I'm not the youngest!)
Approved by:	philip (mentor)
MFC after:	3 days
2006-01-20 13:07:09 +00:00
Vasil Dimov
5f9cc6261d Add myself to the calendar
Approved by:	garga (mentor)
2006-01-19 18:35:44 +00:00
Andrey Slusar
91eee675f4 Add myself.
Feel free to donate me a beer :)
2006-01-19 15:31:37 +00:00
Simon L. B. Nielsen
43614f10a2 Use the .Fx macro.
MFC after:	3 days
2006-01-17 19:37:07 +00:00
Gleb Smirnoff
e5ed7bcc74 Skip format flags, when parsing ktr_desc. 2006-01-12 22:32:07 +00:00
Colin Percival
9ed97bee65 Correct insecure temporary file usage in texindex. [06:01]
Correct insecure temporary file usage in ee. [06:02]
Correct a race condition when setting file permissions, sanitize file
names by default, and fix a buffer overflow when handling files
larger than 4GB in cpio. [06:03]
Fix an error in the handling of IP fragments in ipfw which can cause
a kernel panic. [06:04]

Security:	FreeBSD-SA-06:01.texindex
Security:	FreeBSD-SA-06:02.ee
Security:	FreeBSD-SA-06:03.cpio
Security:	FreeBSD-SA-06:04.ipfw
2006-01-11 08:02:16 +00:00
Tor Egge
82be0a5a24 Add marker vnodes to ensure that all vnodes associated with the mount point are
iterated over when using MNT_VNODE_FOREACH.

Reviewed by:	truckman
2006-01-09 20:42:19 +00:00
Diomidis Spinellis
f0982ce212 Document the TMPDIR environment variable.
MFC after:	1 week
2006-01-05 10:19:42 +00:00
Peter Grehan
5aedf535d3 Enable truss for powerpc 2006-01-05 05:58:16 +00:00
Peter Grehan
7fa9dc1c36 Add powerpc support for truss.
Initial work by:  Orlando Bassotto  < orlando at break net >
Modified by:	  grehan
2006-01-05 05:57:47 +00:00
Brian Somers
cd17a1f7ba Fix the other su bug reintroduced two commits ago, namely
$ su
    % kill -STOP $$

where su is executing (t)csh.  csh's job handling is a little more
special than that of (a)sh, bash and even zsh and blows up a little
more spectacularly.  This modification restores the original mucking
about with the tty pgrp, but is careful to only do it when su (or
su's child) is the foreground process.

While I'm here, fix a STDERR_FILENO spelling as suggested by bde.
2006-01-03 09:17:04 +00:00
Brian Somers
d039c62baa Handle the case (that I just broke) where the following hangs:
$ su
    # kill -STOP $$

Pointed out by:	David Xu <davidxu@freebsd.org>
2006-01-02 09:46:38 +00:00
Brian Somers
d43e192e7d Remove broken code that mucks about with tcsetpgrp() -- even if
su isn't the foreground process.  Hopefully this won't break PAM,
but I couldn't find any useful information about ache's theory
that it will.

Specifically, this change fixes the following:

    # sh
    # echo $$
    # su - root -c id &
    # echo $$

The PID output changes as su seems to be kill -STOP'ing itself
and catching the parent shell in the process.  This is especially
bad if you add a ``su - user -c command &'' to an rc script!

Sponsored by:		Sophos/Activestate
Not objected to by:	des
2006-01-02 08:51:21 +00:00