Commit Graph

8475 Commits

Author SHA1 Message Date
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
Brian Somers
0cf21b4f58 Add a -s flag for the same functionality as strace. Introduce a Name
type which is a String type that has no -s limitations applied to it.
Change most Strings in the code to Names and add a few extra syscalls,
namely munmap, read, rename and symlink.  This was enough to facilitate
following file descriptor allocations in the code more easily and
getting a hint at what's being read/written from/to files.  More
syscalls should really be added.

While here, fix an off-by-one bug in the buffer truncation code and
add a fflush so that truss's output reflects the syscall that the
program is stuck in.

Sponsored by:	Sophos/Activestate
MFC after:	2 weeks
2006-01-02 08:36:25 +00:00
Juli Mallett
b65bc26736 NUL terminate buffer from fgetln(3). From fgsch@OpenBSD. 2006-01-01 22:59:54 +00:00
Juli Mallett
f22bf18027 Whitespace after switch.
Inspired by:	OpenBSD
2006-01-01 22:54:49 +00:00
Juli Mallett
4aeb63826e Check the entire length of the current argument for the EOF string with -E,
but don't expect a proper ASCII string to exist right here right now, don't
use strcmp(3) which checks for a NUL.  As we're still building the argument
up, the next character might be garbage.  It would probably be just as safe to
temporarily write a NUL there, but if we've reached the end of argument memory
that might not be the best idea, I think.  It's unclear.

Doing it this way seems to meet the most with the original intent.

PR:		85696
Prodded by:	stefanf
2005-12-31 09:06:45 +00:00
Dag-Erling Smørgrav
15e2d64e15 Only clear sb.st_size if it is clearly wrong or meaningless. This fixes
mirror mode.

PR:		bin/86940
MFC after:	2 weeks
2005-12-30 23:36:26 +00:00
Juli Mallett
ba084f6a80 Add a FreeBSD-specific -S flag which controls the maximum size of an argument
having replacements done in it via -I.
2005-12-30 23:25:41 +00:00
Juli Mallett
38e62c6999 Handle maxsize==0 in such a way that we don't modify the string. 2005-12-30 23:22:50 +00:00
Christian S.J. Peron
6883394118 mkstemp(3) and friends use a combination of base 10 digits, along
with upper and lower case letters from the English alphabet. Change
the number of possible file names mktemp will return from 26**6
to (10+26+26)**6 instead. This keeps things consistent with mkstemp(3)
2005-12-30 20:10:21 +00:00
Dag-Erling Smørgrav
0c87874496 Reflect progress in process title.
Submitted by:	flz
MFC after:	2 weeks
2005-12-30 18:17:11 +00:00
Peter Grehan
8a2e2a8ecd Build gprof for powerpc now. 2005-12-29 04:30:03 +00:00
Peter Grehan
2315266944 clone i386.h for powerpc 2005-12-29 04:23:54 +00:00
Kelly Yancey
100b98db75 Add support for printing IPSEC protocol stats if the kernel was compiled
with FAST_IPSEC rather than the KAME IPSEC stack.

Note that the output of "netstat -s -p ipsec" differs depending on which
stack is compiled into the kernel since they each keep different stats.
This delta also adds the "esp", "ah", and "ipcomp" protocol stats, which
are also available when the kernel is compiled with the FAST_IPSEC stack
(e.g. "netstat -s -p esp").

Submitted by:	Matt Titus <titus at nttmcl dot com>
MFC after:	3 days
2005-12-28 20:36:55 +00:00
Ade Lovett
d9aef362c0 Someone buy me a beer. Now. 2005-12-28 08:41:57 +00:00
Ceri Davies
7881e1ee07 Liberation Day is no longer celebrated in Romania; rather a national
holiday is now celebrated on December 1st.  From the PR:

December 1 was adopted as National Day in 1990, being the day of
celebration of the Great Assembly of Alba Iulia which voted for the
union of Transylvania with Romania and which symbolise the union of all
Romanians within a single state and the achievement of the unity of
Romanian national state. [1]

[1] LAW Number 10 from July 31st, 1990
Regarding the proclamation of the National Day of Romania
http://www.1decembrie.ro/en/index.php?option=com_content&task=view&id=1&Itemid=4

PR:				docs/90673
Submitted by:			Ion-Mihai "IOnut" Tetcu
Originally pointed out by:	Cornel Ilie <cornel dot c punkt ilie at gmail punkt com>
2005-12-20 11:04:01 +00:00
Christian S.J. Peron
9d51867579 Provide some basic documentation explaining what the bpf(4) flags are
supposed to mean. Also, add an external references for bpf now that we
reference flags from that man page.
2005-12-18 19:38:43 +00:00
Marcel Moolenaar
757686b115 Make our ELF64 type definitions match standards. In particular this
means:
o  Remove Elf64_Quarter,
o  Redefine Elf64_Half to be 16-bit,
o  Redefine Elf64_Word to be 32-bit,
o  Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o  Use Elf_Size in MI code to abstract the difference between
   Elf32_Word and Elf64_Word.
o  Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks
2005-12-18 04:52:37 +00:00
Marcel Moolenaar
57668ad84b Know the machines FreeBSD runs on. Print the machine value for
unknown machines.

MFC after: 1 week
2005-12-17 23:24:34 +00:00
Maxim Konovalov
e20daf376d Fix the name of the country I was born. 2005-12-14 17:33:12 +00:00
Nate Lawson
ee574da534 Really fix the relative timestamp bug. It was only incorrect for the ALQ
case.  It seems entries are in reverse order when read from the kernel
memory but in the right order when read from a file (i.e. ALQ).  Handle
both cases.

MFC after:	1 day
2005-12-09 14:27:03 +00:00
Tim Kientzle
6593049efd Remove the -B option from the directory-copying examples. The -B
option is undocumented because it does nothing.  It does nothing
because bsdtar never needs it.  It is accepted because gnutar does
sometimes need it and many scripts use it.

Reported by: Pawel Jakub Dawidek
2005-12-09 05:19:00 +00:00
Maksim Yevmenkin
a9412967a2 Teach rfcomm_sppd(8) to recognize "lan" (for LAN Access Using PPP) service
name in '-c' (RFCOMM channel) option.

MFC after:	3 days
2005-12-07 19:41:58 +00:00
Dag-Erling Smørgrav
90c69417b6 Wording tweaks.
PR:		not quite docs/84620
MFC after:	2 weeks
2005-12-07 12:33:52 +00:00
Dag-Erling Smørgrav
1c6859f833 Add a -0 option for interoperability with xargs -0.
PR:		bin/56558
Submitted by:	Eugene Grosbein <eugen@grosbein.pp.ru>
MFC after:	2 weeks
2005-12-07 12:22:46 +00:00
Dag-Erling Smørgrav
2d14e0e547 Add -r option for GNU compatibility.
MFC after:	2 weeks
2005-12-07 12:20:08 +00:00
Nate Lawson
c578cf5e86 Fix -r flag to actually work. "now" comes after "then", not vice versa.
MFC after:	1 day
2005-12-06 14:13:39 +00:00
Ruslan Ermilov
8c7a62275a Prepare for MACHINE and hw.machine switching to "pc98" on FreeBSD/pc98.
Reviewed by:	nyan
2005-12-05 14:22:12 +00:00
Philip Paeps
5df9daab27 Catch up with 64bit time_t on sparc64. The rstat packet expects a 32bit
time_t and times will look incorrect on machines with 64bit time_t.

PR:		88788
Submitted by:	Keith White <Keith.White -at- site.uottawa.ca>
MFC after:	1 week
2005-12-04 18:25:26 +00:00
David Xu
0f2755724b Quickly fix brokeness in revision 1.157, that change was
free()ing stack memory which causes the program to abort,
and I can no longer make buildworld.
2005-12-01 05:59:45 +00:00
Max Khon
7d81571413 - match_var: do not address memory at invalid address (`len' can be greater
than strlen(var) + 1)
- ReadMakeFile: prevent `fname' memory leak
- ReadMakeFile: prevent double free (caused by double fclose) --
ParsePopInput() closes input file

Reviewed by:	harti
2005-11-30 20:38:03 +00:00
Robert Watson
91978388e2 Remove two lines of debugging output that accidentally snuck into the
commit to fix up kvm support for netstat -m.
2005-11-28 18:06:21 +00:00
Tim Kientzle
83b9606050 Portability: remove AC_FUNC_MALLOC from configure.ac.in.
According to Dan Nelson, this fixes the build on AIX 5.2.
2005-11-27 03:17:50 +00:00
Maksim Yevmenkin
d47d4f47b0 Teach rfcomm_sppd(1) about service names, so it is possible to specify
service name instead of channel number with -c command option. Supported
service names are: DUN (Dial-Up Networking), FAX (Fax) and SP (Serial Port).

MFC after:	1 week
2005-11-23 00:56:18 +00:00
Diomidis Spinellis
855196e9fa Use the appropriate error function for displaying the error,
instead of printing it to stdout.

MFC after:	1 week
2005-11-20 13:48:15 +00:00
Ruslan Ermilov
bf2ed57b3d Fix up markup. 2005-11-18 12:08:31 +00:00
Ruslan Ermilov
4e9e907d63 -mdoc sweep. 2005-11-18 10:36:29 +00:00
Pawel Jakub Dawidek
53ff091d14 Sync as close as possible with NetBSD.
This includes fixes and cleanups listed below:

- If a process dissappears while we are signalling it, don't count it as a
  match/error.
- Better handling of errors and messages.
- Downgrade failure to kill(2) (other than ESRCH) from fatal error to a
  warning; otherwise processing aborts and possibly matching killees would
  remain unsignalled. This makes pkill match the Solaris behavior.
- Exit with 2 on usage errors as documented.

Obtained from:	NetBSD
Glanced at by:	maintainer (gad) [a bit different version of this patch]
2005-11-16 11:03:00 +00:00
Pawel Jakub Dawidek
b77640621b I often find myself doing:
% pgrep <something> [to verify which processes match]
	% pkill <something>

To speed such operation up, add -I option which works like rm(1)'s -i
option (unfortunately -i is already used in pkill(1)), ie. pkill will
ask for confirmation before killing each matching process.

After adding -j, -F, -i, -S, -o and -L options and other improvements,
I think I can add myself to the copyright header.

Glanced at by:	maintainer (gad)
2005-11-16 10:36:44 +00:00
Craig Rodrigues
8cb6926e16 Eliminate coredump problem introduced by last commit.
Noticed by:	Guido van Rooij <guido at gvr dot org>
2005-11-14 13:35:08 +00:00
Craig Rodrigues
075775c9e4 Eliminate build breakage due to warnings about const. 2005-11-14 03:11:25 +00:00
David Malone
e390e3af7c Use ANSI definitions.
Avoid using extern by declaring shared functions in header files.
Const poision.
2005-11-13 21:17:24 +00:00
David Malone
5bbc895db6 len and len2 work better as size_t 2005-11-13 21:03:56 +00:00
David Malone
93aa4a7665 Const poision, deregister and use ANSI definitions. 2005-11-13 20:50:17 +00:00
David Malone
84032c0a6d Declare find_err in indent_globs.h where the other shared variables
live rather than listing it as an extern in indent.c.
2005-11-13 20:37:25 +00:00
David Malone
707083753a Avoid shadowing a local scratch variable, 2005-11-13 20:30:13 +00:00
Robert Watson
d4426f281d Modify netstat -mb to use libmemstat when accessing a core dump or live
kernel memory and not using sysctl.  Previously, libmemstat was used
only for the live kernel via sysctl paths.

This results in netstat output becoming both more consistent between
core dumps and the live kernel, and also more information in the core
dump case than previously (i.e., mbuf cache information).

Statistics relating to sfbufs still rely on a kvm descriptor as they
are not currently exposed via libmemstat.  netstat -m operating on a
core is still unable to print certain sfbuf stats available on the live
kernel.

MFC after:	1 week
2005-11-13 14:06:01 +00:00
Robert Watson
df0c8868b1 Add "-s" argument to kdump to suppress the display of I/O data.
MFC after:	1 week
2005-11-12 14:21:48 +00:00
Greg Lehey
b2f9e51241 Look through ext2fs file systems as well as ufs.
This should almost certainly be extended to other local file systems
as well (ntfs springs to mind), but I don't have the ability to test
it.
2005-11-12 12:45:08 +00:00
Ruslan Ermilov
b5f6749117 Align output. 2005-11-09 15:12:57 +00:00
Tim Kientzle
b3d17b1474 Edit pathnames for -x but not for -t. Otherwise, people get confused
when list the archive contents, then try to extract selected files
(file selection always works against unedited pathnames).  With this change,
-t always shows the pathnames as they appear in the archive.

Thanks to: Robert Watson
2005-11-06 22:53:51 +00:00
Christian S.J. Peron
997591ca96 Un-break processing of device major/minor values with fstat -n. We do
this by accessing the cdev_priv element of the cdev structure. Looking
forward we need a better way to handle this, as this structure shouldn't
be frobbed by userspace.

Submitted by:	Doug Steinwand
PR:		bin/88203
MFC after:	1 week
Discussed with:	phk
2005-11-05 23:38:08 +00:00
Maxim Konovalov
f1621f9999 o Update list of holidays in Russia.
Submitted by:	osa
MFC after:	1 week
2005-11-02 09:22:28 +00:00
John Polstra
dd6dea0974 Fix an erroneous description of the file descriptor assignments for
the "~C" command.

MFC After:	1 week
2005-11-02 05:47:49 +00:00
Tom Rhodes
cc22380491 Xref setlocale(3), bump document date. 2005-11-01 19:36:17 +00:00
Robert Watson
a9ac598b36 Add a "-H" argument to kdump, which causes kdump to print an additional
field holding the threadid.  This is more useful for libthr than
libpthread, but still quite useful in libpthread as it can be used to
process interlaced records from multiple threads over the course of a
system call.

Detect old ktr_buffer values using the heuristic "if it's negative,
then it must not be a valid threadid".  This may leave something to be
desired.

MFC after:	1 month
Reviewed by:	davidxu
2005-11-01 14:48:23 +00:00
Tim Kientzle
5df2705458 In mode 'u', check for an error return from archive_read_open.
This causes attempts to update a non-existent file to report
an actual error instead of triggering an assertion failure.

PR: bin/87911
Thanks to: roemer.ulrich
MFC after: 3 days

Note: This does not entirely fix bin/87911.  I need to decide on
the "correct" response when someone tries to update a non-existent
archive file.
2005-11-01 06:41:05 +00:00
Tim Kientzle
e8e12ab4e1 Include <sys/param.h> in order to get current __FreeBSD_version
in order to properly set HAVE_NL_LANGINFO.  <whew!>

Thanks to: Andrey Chernov
PR: bin/88013
MFC after: 3 days
2005-11-01 05:53:16 +00:00
Tim Kientzle
a6afb4f5dc Spell "--format" correctly in error message. (It hasn't been
called "-F" for a very long time.)

PR: bin/86915
Thanks to: Gary W. Swearingen
MFC after: 3 days
2005-11-01 05:48:02 +00:00
Aaron Dalton
5fd18d706e new committer: added my birthday to the calendar
Approved by: tobez
2005-10-30 21:02:09 +00:00
Ruslan Ermilov
2ad08c56d8 Add some significant Ukrainian dates.
PR:		88076
Submitted by:	Andriy Gapon
2005-10-28 21:25:28 +00:00
John Baldwin
444ec0d5f5 Fix misspelled 'argument' and try to make the sentence into English.
Submitted by:	Andre Guibert de Bruet andy at siliconlandmark dot com
2005-10-26 17:37:54 +00:00
Colin Percival
923e7a09b0 Use the "builtin" shell function to make sure that the requested
command is handled as a shell function.  This avoids the following
peculiar behaviour when /usr/bin is on a case-insensitive filesystem:
    # READ foo
(... long pause, depending upon the amount of swap space available ...)
    sh: Resource temporarily unavailable.

Reported by:	I can't remember; someone on IRC.
MFC after:	1 week
2005-10-24 22:32:19 +00:00
Tim J. Robbins
e21dde7b1d Document incorrect handling of multibyte characters.
PR:		87724
2005-10-23 01:37:25 +00:00
Max Laier
e5134d2e82 Fix obvious copy'n'paste-O in rev.1.36 While here nit style.
PR:		bin/87783
Submitted by:	Mats Palmgren
MFC after:	1 week
2005-10-22 17:50:45 +00:00
Stefan Farfeleder
2110d9c31a Use the new name H_SETSIZE instead of the old H_EVENT to set the history
size.

PR:	86355
2005-10-19 15:37:43 +00:00
Ruslan Ermilov
fd9070970c Make sure that files included using ".include <foo>" are really
looked for in the system make file directory or in the specified
-m paths instead of always looking in the other -I and .PATH
specified paths.  (Commit log shamelessly stolen from NetBSD.)

Reviewed by:	yar
2005-10-17 15:56:26 +00:00
Andre Oppermann
a21cbcb876 Obtain true uptime through clock_gettime(CLOCK_MONOTONIC, struct *timespec)
instead of subtracting 'bootime' from 'now'.

Sponsored by:	TCP/IP Optimization Fundraise 2005
2005-10-17 15:37:22 +00:00
Alfred Perlstein
6a6567612d The kernel accepts sockaddrs with len set to zero for sockaddr_in
types, so refactor the code here to grab them when length is zero.
2005-10-15 06:17:29 +00:00
Yaroslav Tykhiy
aeb2a851ad Revise the manpage to a certain extent, mostly with respect to
make's processing of top-level and included makefiles.  Point
out at make.conf(5) and __MAKE_CONF when telling about sys.mk.

Reviewed by:	ru
2005-10-14 23:54:20 +00:00
Ruslan Ermilov
f329a1513a Style: move .PATH to where it belongs. 2005-10-14 15:50:22 +00:00
Yaroslav Tykhiy
9c4e83a46c __MAKE_CONF doesn't really belong here because it is
a FreeBSD extension of sys.mk.  A xref to make.conf(5)
will be enough here.

Requested by:	ru
2005-10-12 10:09:36 +00:00
Yaroslav Tykhiy
253c3c7312 Clarify the usage and effects of sys.mk, make.conf(5), and __MAKE_CONF.
MFC after:	2 weeks
2005-10-10 14:49:55 +00:00
Scott Long
1030a78a12 Make sure that the created fifo gets deleted if the top level make instance
exits due to a signal.
2005-10-09 06:36:51 +00:00
Christian S.J. Peron
cc2a9f52a7 Finish off style(9) fixes which I started two revisions ago. This basically
changes the indentation style from 4 spaces to 8 spaces which we expect to
see in other FreeBSD source files.
2005-10-09 04:45:41 +00:00
Bruce Evans
762116ae25 Catch up with increasing the resolution suitable for high-res kernel
profiling from microseconds to nanoseconds in 1996.  Picoseconds are
already needed.

Describe the choice of units for the per-call times in detail.
2005-10-07 11:58:46 +00:00
Christian S.J. Peron
45edbdccd7 Do not ignore ENOENT
Pointed out by:	Amir Shalem
2005-10-07 11:49:27 +00:00
Bruce Evans
0b146898f0 Improve printing of self times in the flat profile for functions that
appear to be never called:

(1) If a function is never called according to its call count but it
    must have been called because its child time is nonzero, then print
    it in the flat profile.  Previously, if its call count was zero
    then we only printed it in the flat profile if its self time was
    nonzero.

(2) If a function has a zero call count but has a nonzero self or child
    time, then print its total self time in the self time per call
    column as a percentage of the total (self + child) time.  It is
    not possible to print the times per call in this case because the
    call count is zero.  Previously, this was handled by leaving both
    per-call columns blank.  The self time is printed in another column
    but there was no way to recover the total time.

(1) partially fixes the case of the "never called" function main() and
prepares for (2) to apply to main() and other functions.  Profiling
of main() was lost in the conversion from a.out to ELF, so main()'s
call count has always been zero for many years; then in the common
case where main() is a tiny function, it gets no profiling ticks, so
main() was completely lost in the flat profile.

(2) improves mainly cases like kernel threads.  Most kernel threads
appear to be never called because they are always started before
userland can run to turn on profiling.  As for main(), the fact that
they are called is not very interesting and their callers are
uninteresting, but their relative self time is interesting since they
are long-running.

Almost always printing percentages in the per-call columns would be
more useful than almost always printing 0.0ms.  0.1ms is now a long
time, so only very large functions take that long per call.  The accuracy
per call can approach 1-10 nsec provided programs are run for about
100000 times as long as is necessary to get this accuracy with high
resolution kernel profiling.
2005-10-07 10:59:41 +00:00
Yaroslav Tykhiy
e53e5e56d9 Sync usage screen with manpage.
MFC after:	5 days
2005-10-07 10:18:44 +00:00
Yaroslav Tykhiy
6fcf85bc95 Document the -d flag to mail(1) better, which comes handy when
you want to see, e.g., sendmail arguments mail(1) will use.

-H is not an independent flag, it's a modifier.  Also explicitly
say that -H will cause mail(1) to exit as soon as it prints the headers.

MFC after:	5 days
2005-10-07 10:16:41 +00:00
Emanuel Haupt
b8b9c6fe06 Adding myself to calendar.freebsd
Approved by:	novel (mentor)
2005-10-06 19:16:55 +00:00
Christian S.J. Peron
4ccbe0c50d Un-break handling of -t 0 which was broken in my previous commit.
Add a flags argument to wait_for_lock so that O_NONBLOCK can be
passed to open if a user doesn't want the open to sleep until the
lock becomes available.

Submitted by:	Amir Shalem (partially modified)
2005-10-05 22:02:07 +00:00
Christian S.J. Peron
031469eb27 Fix long standing race condition associated with how lockf uses open(2)
for mutual exclusion:

A brief description of the problem:

	1) Proc A picks up non-blocking lock on file X
	2) Proc B attempts to pickup lock, fails then waits
	3) Proc C attempts to pickup lock, fails then waits
	4) Proc A releases lock
	5) Proc B acquires lock, release it to pickup a non-blocking version
	6) Proc C acquires lock, release it to pickup a non-blocking version
	7) Both process B and C race each other to pickup lock again

This occurs mainly because the processes do not keep the lock after they have
been waiting on it. They drop it, attempt to re-acquire it. (They use the wait
to notify when the lock has become available then race to pick it up). This
results in additional CPU utilization during the race, and can also result
in processes picking locks up out of order.

This change attempts to correct this problem by eliminating the test/acquire
race and having the operating system handle it.

Reported by:	kris
Tested by:	kris
MFC after:	1 week
2005-10-05 17:39:15 +00:00
Gary W. Swearingen
f0ab9f7b39 A minor overhaul: added comments, split cmds in 2, changed synopsis.
Split commands into two groups: one with optional count and one with
required argument.  Changed synopsis line accordingly.

Added some hopefully-helpful comments based on experiments, knowing
that not all hardware works the same.

PR:             docs/84101
Approved by:    keramida
MFC after:      3 days
2005-09-30 17:31:39 +00:00
Ruslan Ermilov
7fc550064a Oops, revert last commit (the manpage is still built in objdir). 2005-09-28 07:54:18 +00:00
Ruslan Ermilov
ec2cc32689 Add NO_OBJ. 2005-09-28 07:49:30 +00:00
Max Laier
b6de9e91bd Remove bridge(4) from the tree. if_bridge(4) is a full functional
replacement and has additional features which make it superior.

Discussed on:	-arch
Reviewed by:	thompsa
X-MFC-after:	never (RELENG_6 as transition period)
2005-09-27 18:10:43 +00:00
Gleb Smirnoff
7c23a867f7 - Print space character in show_stat(). Remove a lot of priuntf(" ").
- Utilize show_stat() in sidewaysintpr() loop. This makes periodic
  statistics to honor -h flag.
2005-09-27 10:42:02 +00:00
Ruslan Ermilov
762fcdcf7d Remove redundant `\&' escapes. 2005-09-27 08:06:21 +00:00
Ruslan Ermilov
0b13db0306 Fixup previous commit. 2005-09-27 08:02:03 +00:00
Poul-Henning Kamp
1b56a319fe Please ship the pointy hat to its home position. 2005-09-26 22:07:59 +00:00
Poul-Henning Kamp
c711b5fe88 Update coordinates for "mph" hash generator now that it lives in ports. 2005-09-26 20:34:21 +00:00
Poul-Henning Kamp
2e5ee2bfac Add a .sinclude directive which does the exact same as .include, except
whine when the file cannot be found and opened.
2005-09-26 20:31:00 +00:00
Tim Kientzle
512c45ef6c Fix -u with absolute paths (e.g., "tar -uf foo.tar /bar") by handling
pathname edits before comparing pathnames on disk to those in the archive.

Thanks to: Gareth Bailey, Lowell Gilbert
2005-09-24 21:19:57 +00:00
Tim Kientzle
2f3b67647f Detect Mac OS X's broken ACL library.
Thanks to: Diego "Flameeyes" Petten?
2005-09-24 21:17:47 +00:00
Stefan Farfeleder
7c4847b792 The function inplace_edit() doesn't exist anymore, remove the prototype.
Submitted by:	Leonardo Chiquitto Filho
2005-09-24 13:18:30 +00:00
Marcus Alves Grando
8008bfe18b Add myself to FreeBSD calendar
Approved by:	pav (mentor)
2005-09-23 13:06:23 +00:00
Ruslan Ermilov
05248e759b Fix vgrind(1) indexing I broke in previous revision.
PR:		bin/86343
Submitted by:	Matej Vela <vela@debian.org>
2005-09-23 12:55:22 +00:00
Kirill Ponomarev
4e099ef9d9 Frank Lloyd Wright birth year is 1867, not 1869.
PR:		conf/82051
Submitted by:	Derek Jones <derek at wahila dot com>
2005-09-23 12:02:27 +00:00
Kirill Ponomarev
bb569d6301 Fix typo, FRG and GDR became UNO members in 1973, not in 1993.
PR:		conf/86193
Submitted by:	Matthias Buelow <mkb at incubus dot de>
2005-09-23 11:58:16 +00:00
Tim Kientzle
c114cc6c3f Style fix: Correct a compiler warning from GCC 4
Thanks to: Divacky Roman
PR: bin/84993
2005-09-21 03:21:35 +00:00
Diomidis Spinellis
d2e4ea2a51 Setting .nofinger will not hide you from root. 2005-09-19 10:11:47 +00:00
R. Imura
59fa708298 Connect smbfs build on powerpc. 2005-09-19 08:13:43 +00:00
Christian S.J. Peron
8729849a45 Use is '-' to imply that the flag is not set, rather than '.'. 2005-09-15 16:09:24 +00:00
Christian S.J. Peron
6f798df578 Print a warning if we fail to retrieve the process name for any reason. 2005-09-13 23:11:16 +00:00
Christian S.J. Peron
15f3d81f9c If there are'nt any bpf descriptors to process than dont bother attempting to
retrieve statistic information for them.

Pointed out by:	Pawel Worach < pawel.worach at gmail.com >
2005-09-13 22:13:01 +00:00
Christian S.J. Peron
48d91509de Free the bpf descriptor array after we are done with it. This probably isnt
that critical as the program exits after this point anyway, but this may
not always be the case.
2005-09-07 19:28:01 +00:00
Christian S.J. Peron
5dbd2da153 Update usage to reflect the new option.
Pointed out by:	ru
2005-09-07 19:15:43 +00:00
Gary W. Swearingen
25b20fc0b2 Several changes: Added a BUGS section with several bugs. And
--  Made the synopses more precise.
--  Added argument to flag in option description.
--  Moved -b default and limits to option description (to un-hide).
--  Noted several behaviors that were not mentioned.
--  A few more trivial changes.

PR:             docs/46787
Approved by:    keramida
MFC after:      3 days
2005-09-07 18:40:09 +00:00
Christian S.J. Peron
6b463eed3a Merge bpfstat's functionality into the netstat(1) utility. This adds
a -B option which causes bpf peers to be printed. This option can be
used in conjunction with -I if information about specific interfaces
is desired. This is similar to what NetBSD added to their version of
netstat.

$ netstat -B
  Pid  Netif  Flags      Recv      Drop     Match Sblen Hblen Command
 1137    lo0 p--s--         0         0         0     0     0 tcpdump
  205   sis0 -ifs-l     37331         0         1     0     0 dhclient
$

$ netstat -I lo0 -B
  Pid  Netif  Flags      Recv      Drop     Match Sblen Hblen Command
 1174    lo0 p--s--         0         0         0     0     0 tcpdump
$

-Add bpf.c which stores all the code for retrieving and parsing bpf
 related statistics.
-Modify main.c to add support for the -B option and hook it into the
 program logic.
-Add bpf.c to the build.
-Document this new functionality in the man page and bump the revision
 date.
-Add prototype for bpf_stats function.
2005-09-07 17:35:16 +00:00
Ralf S. Engelschall
60fc1eb79c Mention that uuidgen(1) generates DCE version 1 UUIDs only 2005-09-07 07:49:21 +00:00
Hartmut Brandt
724b6284e3 Fix the type of the variable 'debug'. It is used as a bitmap, so the
type should be int rather than Boolean.

PR:		bin/84528
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
MFC after:	3 weeks
2005-09-07 07:34:24 +00:00
Stefan Farfeleder
848b3d0fd7 In version 1.8 I botched findval()'s type, fix. 2005-09-02 21:51:18 +00:00
Stefan Farfeleder
1e72f11f56 Use socklen_t variables when passing sizes to getsockname() and
getsockopt().
2005-09-02 19:33:50 +00:00
Stefan Farfeleder
b702f91df9 The appropriate argument is -K -1, not -k -1. 2005-09-02 18:37:34 +00:00
Stefan Farfeleder
adcd73865c Fix a syntax error in the generated code when invoked with -P. Note that
the generated code still doesn't compile as we lack tinfo, t_getinfo and
friends.
2005-09-02 18:20:47 +00:00
Suleiman Souhlal
02dfd2b299 - Do not allocate memory to entries in /var/rwho which have been down for
more than 4 days - waste of memory.

Obtained from:	DragonFlyBSD (liamfoy)
MFC after:	3 days
2005-09-02 14:58:26 +00:00
Stefan Farfeleder
896cdc310c Stop generating the `register' keyword. 2005-09-02 10:32:05 +00:00
Stefan Farfeleder
15df5e2d43 Don't generate K&R C code. The -C flag is kept for backwards compatibility.
Also remove the SIG_PF macro, there is no need to cast closedown.
2005-09-02 10:23:26 +00:00
Stefan Farfeleder
ec06b5e868 Only write the dispatch table function prototypes to the header if the -h
flag was specified.  If all files are generated at once, those functions are
static and shouldn't appear in the header.

PR:		84450
Reviewed by:	alfred
2005-09-01 19:16:25 +00:00
Stefan Farfeleder
d0cc804bba - Use prototypes in headers.
- Include rpc_scan.h before rpc_util.h for the tok_kind enum.
- Nuke unused declarations.
2005-08-31 20:45:15 +00:00
Stefan Farfeleder
122562cd2b Rename the variable inline' to inline_size'. 2005-08-31 19:44:40 +00:00
Tim J. Robbins
33eafb83b7 Include option-argument names in the list in the DESCRIPTION section.
Remove a non-bug from the BUGS section.
2005-08-30 12:48:28 +00:00
Tim J. Robbins
bb78dba49b Remove undocumented historic support for treating "-" as an option
instead of a file operand; this is not compatible with POSIX.
2005-08-30 12:32:18 +00:00
Paul Saab
13829828e7 Unbreak tail -f on non-local filesystems. 2005-08-26 08:15:57 +00:00
Pawel Jakub Dawidek
70ffddc463 Revert previous behaviour of '-F' option and add '-L' option, which will
tell pkill(1)/pgrep(1) to try to flock(2) pidfile before reading PID from
there.

Discussed with:	jhb, gad
2005-08-25 20:10:47 +00:00
Ollivier Robert
2fa9dad0ef Fixes for gcc 4.x.
PR:             bin/84995
Submitted by:   Divacky Roman <xdivac02@stud.fit.vutbr.cz>
2005-08-25 14:09:35 +00:00
Ollivier Robert
8a0a76b862 Fixes for gcc4.x.
Submitted by:   Divacky Roman <xdivac02@stud.fit.vutbr.cz>
PR:             bin/84991
2005-08-25 13:44:02 +00:00
Pawel Jakub Dawidek
712bf6af16 Modify '-F' option to work nicely with pidfile(3) - a pidfile given as
an argument has to be locked.
2005-08-24 19:38:28 +00:00
Yaroslav Tykhiy
b7cc036298 List -W as one of the meaningful options to the -i (interfaces)
display of netstat(1).

MFC after:	3 days
2005-08-24 12:21:34 +00:00
Brian Somers
e1bfde1b04 Add a -h option to tell cmp not to follow symbolic links.
MFC after:	3 weeks
Sponsored by:	Sophos/ActiveState
2005-08-23 13:13:13 +00:00
Colin Percival
f46417c577 Most users probably aren't interested in locating 13000+ files named
[0-9a-f]{64}, so exclude portsnap's compressed snapshots from locate's
indexing.

Suggested by:	silby
MFC after:	3 days
2005-08-22 08:22:48 +00:00
Tim J. Robbins
e93586df9d Remove the hack that varied the first character of the output file name
if none was specified on the command line. This is not permitted by
POSIX, and no longer needed now that we have the -a option.

PR:		85099
Submitted by:	Toby Peterson (Apple Computer)
2005-08-21 06:35:02 +00:00
Ruslan Ermilov
c6358a5e6f Bail if interface is misspelled instead of falling out into the
"all interfaces" mode.  (Only works with -w, but still better
than nothing.)
2005-08-20 08:34:21 +00:00
Murray Stokely
053018f6ea Correct typos found by ispell. 2005-08-19 00:05:58 +00:00
Gleb Smirnoff
c2dfd19ff0 Add a new switch -h for interface stats mode, which prints all interface
statistics in human readable form.

In collaboration with:	vsevolod
Reviewed by:		cperciva
2005-08-18 21:04:12 +00:00
Stefan Farfeleder
4ed7018006 While revision 1.26 fixed the code to really subtract 3600 due to
daylight-saving, this was actually wrong because mktime() already does that for
us.
2005-08-18 08:18:02 +00:00
Colin Percival
816e551836 Remove the dates from these files. They serve no purpose and result in
these files spuriously changing each time they are built.

Also, add $FreeBSD$ tags, because cvs is unhappy otherwise.
2005-08-17 15:56:04 +00:00
Murray Stokely
103d2a4254 Correct birthdate for Meriwether Lewis. He was born before the
declaration of independence, not after the first world war.
2005-08-17 13:32:18 +00:00
Suleiman Souhlal
639d7cbad1 It's actually 11 minutes when the machine is assumed to be down and removed
from the output.

Obtained from:	DragonFlyBSD
2005-08-07 11:48:44 +00:00
Robert Watson
768528adf6 Use libmemstat(3)'s kvm support for malloc(9) rather than hand-extracting
this information from the core dump.
2005-08-06 13:56:21 +00:00
Poul-Henning Kamp
e73643becb Old habits die hard: Make that .if defined(YES_HESIOD) not .if !defined 2005-08-06 07:41:36 +00:00
Christian S.J. Peron
9baea4b4b4 Change the data type of the upper shared memory limits from a signed
integer to an unsigned long. This lifts variables like the maximum
number of pages available for shared memory from 2^31 to 2^32 on 32
bit architectures, and from 2^31 to 2^64 on 64 bit architectures.

It should be noted that this changes breaks ABI on 64 bit architectures
because the size of the shmmax, shmmin, shmmni, shmseg and shmall members
of the shminfo structure has changed.

Silence on:	current@
2005-08-06 07:20:18 +00:00
Poul-Henning Kamp
f7ab1209d3 Put hesinfo(1) under buildoption "YES_HESIOD" 2005-08-06 06:56:39 +00:00
Colin Percival
9857d3addb Include ../Makefile.inc, since without it programs get installed in the
wrong place.

Pointy hat to:	cperciva
2005-08-06 02:37:21 +00:00
Colin Percival
ba10db9984 Add bsdiff and bspatch to the base system. These are tools for
constructing and applying binary patches; in particular, they perform
well (in the sense of constructing small patches) for executable code.
Both portsnap (coming to the base system Real Soon Now) and FreeBSD
Update (coming to the base system a bit later) use bspatch.

This is the same code as the bsdiff-4.2 which has been in the ports
tree (misc/bsdiff) for the past year, with the following exceptions:
1. The license is now the traditional 2-clause BSD;
2. Instead of forking and execing bzip2, the code now uses libbz2; and
3. Some minor changes have been made to fit this code into the base
system (adding $FreeBSD$ tags, putting bsdiff and bspatch into separate
directories, etc.)

This code is rather ugly and has lots of style bugs (mostly because I
wrote it before I had ever heard of style(9)).  Some day I'll come
back and clean it up.

Discussed on:	freebsd-arch
MFC before:	5.5-RELEASE
Tested by:	Several million users (earlier version).
2005-08-06 01:59:06 +00:00
Poul-Henning Kamp
a00553b3d3 Don't include -lipx twice. 2005-08-05 20:13:09 +00:00
Poul-Henning Kamp
9cc22e5c89 Make IPX support depend on NO_IPX 2005-08-05 18:45:49 +00:00
Poul-Henning Kamp
5a4d78a1f6 Let NO_MAN control catman 2005-08-05 16:09:34 +00:00
Stefan Farfeleder
a3ae5e4ede Use socklen_t where appropriate. 2005-08-05 09:58:49 +00:00
Stefan Farfeleder
4ac45ec4cc Include <err.h> where needed. Add $FreeBSD$ where missing. 2005-08-05 09:07:42 +00:00
Stefan Farfeleder
d41d23e1cd Prefer {u,}intmax_t over the deprecated {u_,}quad_t. 2005-08-05 08:18:00 +00:00
Stefan Farfeleder
3dc44a8992 Don't throw away the adjusted `runtimer' value. 2005-08-05 08:07:02 +00:00
Juli Mallett
dfaacec6ff Call usage() instead of being insolent. 2005-08-05 01:04:36 +00:00
Diomidis Spinellis
d432588e78 Bug fix: a numeric flag specification in the substitute command would
cause the next substitute flag to be ignored.
While working at it, detect and report overflows.

Reported by:	Jingsong Liu
MFC after:	1 week
2005-08-04 10:05:12 +00:00
Poul-Henning Kamp
642268f44a Add NO_CALENDAR 2005-08-03 09:27:01 +00:00
Sean Chittenden
71997d4be4 Cross-reference pw(8) into chpass(1), passwd(1), and vipw(8). 2005-08-02 21:38:03 +00:00
Tim Kientzle
5d596ecb25 The bsdtar_warnc() reporting function requires the program name to be
set up before it is called, so move the progname initialization before
the first possible call to bsdtar_warnc().

Thanks to: Stanislav Sedov
PR: bin/83366
MFC after: 7 days
2005-08-02 03:02:55 +00:00
Robert Watson
c753d56b39 Teach vmstat's domemstat_zone() to use memstat_kvm_uma() when the kvm
descriptor is non-NULL, restoring vmstat -z support for core dumps and
kmem access.  These were broken with the introduction of UMA.
2005-08-01 21:33:17 +00:00
Giorgos Keramidas
6fb9b618f5 Fix all the spelling mistakes I could find in the man pages for words
that have at least 3 characters.

MFC after:	1 week
Thanks to:	Music band ``Chingon''
		for keeping me company while searching for these.
2005-07-31 03:30:48 +00:00
Christian S.J. Peron
a4cdc0452a Introduce kdevtoname, which when given the kernel address of a
cdev structure, returns the device name associated with it through
the __si_namebuf member. This un-breaks the processing of devices.

This is a RELENG_6 candidate.

Reviewed by:	phk
2005-07-30 20:00:13 +00:00
Robert Watson
b9dc1340d2 Minor syntax tweaks:
- Remove some extra blank lines.
- Remove comments that don't contribute to understanding.
- Remove additional blank lines in output added to maximize compatibility
  with older vmstat output, but that is actually somewhat gratuitous.

Submitted by:	bde
MFC with:	other vmstat libmemstat(3) changes
2005-07-28 09:45:08 +00:00
Robert Watson
8e73022dda Teach vmstat -m and vmstat -z to use libmemstat(3). Certain
statistics from -z are now a bit different due to changes in the
way statistics are now measured.  Reproduce with some amount of
accuracy the slightly obscure layouts adopted by the two kernel
sysctls.  In the future, we might want to normalize them.

GC dosysctl(), which is now no longer used.

MFC after:	1 week
2005-07-25 22:35:10 +00:00
Dag-Erling Smørgrav
c9275efacc Disable thread support in BIND. It appears to reduce performance rather
than increase it, and seems to be the cause of the memory leaks which some
users have reported.

Requested by:	dougb
MFC after:	5 days
2005-07-25 14:44:11 +00:00
Robert Watson
4f7ac59b50 Since libmemstat(3) now supports its own error management mechanism,
use that instead of trying to use errno, in order to produce a
sensible error message.

MFC after:	1 day
2005-07-24 01:42:42 +00:00
Poul-Henning Kamp
4a7f3dcea5 In 2003, a -s flag was added to ministat to separate the
avg/median/stddev bars onto separate lines for readability if the
ranges overlapped.  In 2005, ministat was extended to support more than
2 datasets, but the -s code was not updated.  It will coredump if run
with -s and >2 sets.

PR:	82909
Submitted by:	Dan Nelson <dnelson@allantgroup.com>
2005-07-21 08:32:56 +00:00
Hartmut Brandt
bc7ab08ab3 Fix the "..." special command. If this command is found all further
commands for this target are appended to the .END target instead
of beeing executed now. They are executed when the graph is finished.
There was a bug with executing the .END target which came in when
doing conversion to LST_FOREACH() which caused make to dump core.

PR:		bin/83698
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
MFC after:	3 days
2005-07-19 07:03:26 +00:00
Garance A Drosehn
9afe6a5bf9 Fix minor memory leak when expanding ${variable}s
Noticed by:	Dave Hart
MFC plans:	after checking with re@
2005-07-18 22:18:16 +00:00
Robert Watson
c8e6b6899a Modify "netstat -mb" to use libmemstat(3) when acting on a live system,
with a number of positive benefits:

- Start using UMA(9) statistics for mbufs and clusters, which avoids
  using the mbuf allocator statistics which suffer from races under
  load on SMP.  This should eliminate "negative" mbuf counts in
  netstat -mb.

- We are now able to track cached (free) mbufs and clusters and count
  it towards memory allocated by the network stack.

- We are now also able to track memory allocated to mbuf tags since
  libmemstat(3) can also query malloc(9).  We don't print this except
  as part of the total (for now - #if 0).

- We are now able to track mbuf/cluster/packet allocation failures,
  although they are not currently printed (#if 0).

- Don't print out sfbuf statistics when running on a kernel core, as
  currently that code is able only to query sysctl for statistics.

MFC after:	1 week
2005-07-18 08:34:15 +00:00
Wolfram Schneider
f7070a400c remove myself as maintainer 2005-07-17 21:19:28 +00:00
Ceri Davies
dd0433a9b7 Note the events of 0707, lest we forget. 2005-07-15 20:11:39 +00:00
Ruslan Ermilov
e46be7ffad Fix loder(1) to work with libraries. This can be useful to
sort long DPADD lists automatically.  While here, recognize
`W' as the global symbol.  This has been tested since 2004.
2005-07-15 15:21:12 +00:00
Renato Botelho
93ed10e7f9 Add myself to FreeBSD calendar
Approved by:	flz (mentor), Ken Smith (re)
2005-07-15 14:38:01 +00:00
Max Laier
2e37c5a333 Print newly exported pfsync statistics with netstat(8).
Requested by:	glebius
MFC after:	1 week
2005-07-14 22:42:35 +00:00
Christian Brueffer
f0ea72a038 - Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them

MFC after:	3 days
2005-07-14 20:29:08 +00:00
Garance A Drosehn
b5418f5134 Fix two minor parsing bugs in -S processing:
1) An unquoted space is always a separator, even when not "in_arg".
 2) When a new destination buffer must be allocated during variable
    substitution, only copy data from the active buffer to the new
    one when we *are* "in_arg".
These were noticed when testing variable-substitution of variables
which have null values, and are not inside quoted strings...

MFC plans:	after a few days, and re@ approval...
2005-07-13 15:56:30 +00:00
Jung-uk Kim
f8b12dd293 add myself as a new committer
Reviewed by:	anholt (mentor)
Approved by:	re (scottl)
2005-07-07 05:48:37 +00:00
Johan Karlsson
5ceb03e494 Our bsd.*.mk only supports 6 WARNS levels and we should not use higher values
until it does.

Approved by:	re (dwhite)
2005-06-30 11:56:31 +00:00
Ruslan Ermilov
ceeb3b43de Fixed troff warnings.
Approved by:	re (blanket manpages)
2005-06-27 07:37:01 +00:00
Ruslan Ermilov
5dea8a444f Tidy up the markup.
Approved by:	re (blanket)
OK'ed by:	gad
2005-06-22 19:04:07 +00:00
Garance A Drosehn
530aafd4d0 Fix a bug where the value of ${SOMEVAR} would simply disappear if there
was a separator character immediately before it.  This wasn't likely to
happen in #-lines, but we might as well get it right.  Also fix it so
that "" and "" will create a zero-length argument.

Approved by:	re (blanket `env')
2005-06-21 21:37:53 +00:00
Garance A Drosehn
68ef20722d Put in a more descriptive heading for the `env' command.
Noticed by:	Matthew D Fuller
Approved by:	re (blanket `env')
2005-06-21 19:45:02 +00:00
Garance A Drosehn
2f739d3c1a Undo r1.14 to env.c. While it is unusual for environment variables to
start with a '/', they are more supported (by POSIX and SUSv3) than
filenames which have an '=' in them.

Noticed by:	tjr
Approved by:	re (blanket `env')
2005-06-21 19:38:26 +00:00
Garance A Drosehn
8fbe7ebf7d Add the '-S' and '-P' options. The '-S' option can be used to split
apart a string, and supports some text substitutions.  This can be
used to provide all the flexibility (and more!) that was lost by recent
changes to how the kernel parses #!-lines in shell scripts.

The '-P' option provides a way to specify an alternate set of directories
to use when searching for the 'utility' program to run.  This way you can
be sure what directories are used for that search, without changing the
value of PATH that the user has set.  Note that on FreeBSD 6.0, this
option is worthless unless the '-S' option is also used.

Approved by:	re (blanket `env')
2005-06-20 03:43:25 +00:00
Garance A Drosehn
6dcd6cac03 If the `utility' specified starts with a '/' character, then execute it
without checking it for an equals-sign.  If it starts with a slash, then
it cannot be a request to set the value of a valid environment variable.

Approved by:	re (blanket `env')
2005-06-20 03:14:29 +00:00
Garance A Drosehn
212274c3b6 Move the code that clears the environment when `-i' is specified, so it that
it does not happen until all single-letter options are processed.  This will
be important for the -S option, which will be coming soon.

Approved by:	re (blanket `env')
2005-06-20 03:09:49 +00:00
Garance A Drosehn
f66e378b5e Add a '-v' option to `env', to make it easier to discover exactly what steps
it is doing, and what order it does them.  This will be much more useful as
more options are added.

Approved by:	re (blanket `env')
2005-06-20 03:06:54 +00:00
Alfred Perlstein
3969f0fa13 Decode chroot(2) args.
Approved by: re
2005-06-14 21:51:08 +00:00
Ruslan Ermilov
39c59153e9 Markup and wording fixes.
Approved by:	re (blanket)
2005-06-14 11:50:53 +00:00
Dag-Erling Smørgrav
fd0cba238e Don't free(sock) before it's even allocated.
Submitted by:	Joerg Sonnenberger <joerg@britannica.bec.de>
MFC after:	1 week
2005-06-10 06:36:03 +00:00
Dag-Erling Smørgrav
ee66677a7a Remove kludges intended to support src trees with partial obj trees.
Discussed with:	ru
2005-06-10 06:12:53 +00:00
Christian S.J. Peron
671cff5aec Append a newline character to the usage string.
MFC after:	3 days
2005-06-05 23:49:35 +00:00
Garance A Drosehn
b8eb1eccee Use the ki_udata field that was recently-added to kinfo_proc, instead of
stealing ki_spare[0] to hold a pointer.
2005-06-04 23:40:09 +00:00
Eivind Eklund
e1d27f08f1 Back out revision 1.19 and 1.20 until I find mental clarity to deal with
issues bde pointed out.
2005-06-01 20:34:06 +00:00
Brad Davis
e8a296f5e5 Add myself as a new committer.
Approved by:	ceri (mentor)
2005-06-01 18:29:50 +00:00
Maxim Konovalov
42dc3715bb o Teach login(1) to respect "hushlogin" and "nocheckmail" attributes
defined in user's $HOME/.login_conf.

PR:		bin/75001
Submitted by:	Rostislav Krasny
MFC after:	2 weeks
2005-06-01 12:23:06 +00:00
David E. O'Brien
9703393611 Don't use a patch w/in /usr/src. Programmatically change files when needed. 2005-05-31 22:16:49 +00:00
Stefan Farfeleder
63f1737128 Move #ident into #if 0. 2005-05-31 20:00:29 +00:00
Philippe Charnier
865059c8a8 Reduce compiler warning: variable might be used uninitialized, by giving
an initial value.
2005-05-29 16:04:46 +00:00
Philippe Charnier
8a9d84b4a6 Move variable initialization to reduce compiler warning. 2005-05-29 15:52:48 +00:00
Philippe Charnier
a8cf0aaf75 Reduce compiler warning: variable might be used uninitialized, by giving
an initial value.
2005-05-29 15:49:53 +00:00
Philippe Charnier
0bf92eb85e Move FreeBSD Id outside of copyright. Initialize variable. 2005-05-29 15:47:31 +00:00
Robert Watson
147819cc85 Modify vmstat(8)'s domem() routine, which is responsible for extracting
malloc(9) statistics from kernel memory or a kernel coredump, to catch
up with recent changes to adopt per-CPU malloc(9) statistics.  The new
routines walk the per-CPU statistics pools and coalesce them for
presentation to the user.
2005-05-29 13:40:00 +00:00
Robert Watson
cd05b0f7a1 dd a '-n' option to ministat, which causes it to display only summary
statistics, not graph and statistical test output.  Useful for automated
processing.
2005-05-27 17:52:56 +00:00
Eivind Eklund
ffef99c316 Remove an errno reset that became unnecessary.
Noticed by: juli
2005-05-26 22:49:08 +00:00
Alfred Perlstein
dfafebf72e decode utimes, lutimes, futimes, chflags, lchflags. 2005-05-26 22:49:06 +00:00
Eivind Eklund
f2839e75f6 Document a couple of gotchas. 2005-05-26 22:30:12 +00:00
Eivind Eklund
d21ccc03c0 We are past 4.4BSD - use our new-found stat flags for pipes and fifos. 2005-05-26 22:14:37 +00:00
Alfred Perlstein
42af4f5099 decode mkdir args. 2005-05-26 20:06:57 +00:00
Giorgos Keramidas
26d8ca837e Interlink systat(1), iostat(8) and vmstat(8) through their SEE ALSO
sections, so that users of one can learn about the others easily.
2005-05-26 17:54:16 +00:00
Andrew Thompson
945a92c6be Add myself to the calendar.
Approved by: bms (mentor)
2005-05-26 03:21:16 +00:00
Hartmut Brandt
0eabc7bf8f Under certain conditions the condition parser would go one past end of
the string. Until now this caused no harm, because the buffer code used
to tack two NULs onto buffers. With the new, soon to come, parsing code
this isn't the case anymore in all cases, so fix this.
2005-05-25 16:06:14 +00:00
Hartmut Brandt
691a610b4d Document why there is a dependency of certain object files from the
Makefile.

Requested by:	ru
2005-05-25 08:46:31 +00:00
Christian S.J. Peron
701fabc74b If sysctlbyname fails for kernel related reasons, tag the errno
string to the end of the error message. I think we used errx()
there when we really wanted an err().

MFC after:	1 week
2005-05-24 23:42:09 +00:00
Hartmut Brandt
527505d8cb The caller of Var_Value() should not change the variable value. Make
this clear by constifying the return value.

Obtained from:	DragonFlyBSD
2005-05-24 16:05:51 +00:00
Hartmut Brandt
19446efc06 Get rid of the third argument to Var_Value() the pointer it pointed
to has always been set to NULL for some time now.

Obtained from:	DragonFlyBSD
2005-05-24 15:58:35 +00:00
Hartmut Brandt
cda79e4935 Make shell.o dependend on the Makefile just in case someone changes
the default shell in the Makefile.
2005-05-24 15:48:10 +00:00
Hartmut Brandt
066694bd51 Bump the warning level to 6. 2005-05-24 15:46:50 +00:00
Hartmut Brandt
8ea7e6722b Fix a 64-bit warning by casting an int64_t to intmax_t and printing it
with %jd.
2005-05-24 15:45:11 +00:00
Hartmut Brandt
f3bd158e59 Factor out ProcExec() into its own file and rename it to Proc_Exec() for
consistency with the rest of make.

Obtained from:	DragonFlyBSD (except for the rename)
2005-05-24 15:41:34 +00:00
Hartmut Brandt
5c86e3c106 Factor out all the .SHELL parsing related stuff into its own file and
rename the function to be consistent with the naming scheme in the rest
of make. No functional changes.

Obtained from:	DragonFlyBSD (idea and most of shell.h)
2005-05-24 15:30:03 +00:00
Hartmut Brandt
da2f954c96 Use the name of the default shell instead of a numeric index to select
the default shell.

Idea from:	DragonFlyBSD
2005-05-24 13:19:40 +00:00
Hartmut Brandt
51fb4c0273 Another shell attribute 'unsetenv' that will cause to unsetenv("ENV")
before executing the shell. Until now this was done when the default
shell was the ksh. This failed if the default shell was sh or csh and
the user switched to ksh.
2005-05-24 13:14:24 +00:00
Hartmut Brandt
d92e260a4a Describe the meta and builtins attributes for the .SHELL special
target.
2005-05-24 10:59:08 +00:00
Hartmut Brandt
af22b04427 Describe the -x option and the .WARN pseudo-target. 2005-05-24 10:55:00 +00:00
Hartmut Brandt
940c638f93 Before doing any parsing parse the builtin shell specifications and
set the current shell to DEFSHELL. Put all these specifications into
a list. Add user specified new shells to this list. If the user
just selects one of the already know shells just pick the right one
off the list. This let's one do something like:

# Full specification of the user's shell. This also selects the shell.
.SHELL: name=myshell path=/somewhere/foo echo=loud ...

FOO != bar		# use myshell here

.SHELL: name=sh

BAR != baz		# use /bin/sh here

.SHELL: name=myshell	# no need for full spec here.

# continue to use the user's special shell.
2005-05-24 09:14:46 +00:00
Hartmut Brandt
a22057198a Allow the .SHELL target to specify the list of shell meta characters and
the list of shell builtins. Both of these are needed for the compat
mode where make directly executes commands if the command line contains
neither a shell meta character nor a shell builtin. The list of builtins
is not changed, but csh has '@' added as a meta-character.

Initialize the default shell by parsing a string as one would specify
to the .SHELL target. So we get rid of the CShell clone of struct Shell which
just contained const char * where struct Shell had char *.

Add a debugging function for dumping a parsed shell description to
stdout.
2005-05-24 07:45:49 +00:00
Hartmut Brandt
bb5a85a5d7 Make the ArgArray_Init() function visible to the rest of make.
It will soon be needed for the .SHELL parsing code.
2005-05-23 13:27:52 +00:00
Ruslan Ermilov
9e752adbc2 Sync program's usage() with manpage's SYNOPSIS. 2005-05-21 10:14:11 +00:00
Ruslan Ermilov
f682f10c76 Sync program's usage() with manpage's SYNOPSIS. 2005-05-21 09:55:10 +00:00
Hartmut Brandt
87c7b797f0 Get rid of global variables for argument vectors produced by brk_string()
introduce a struct that holds all the information about an argument
vector and pass that around.

Author:		Max Okumoto <okumoto@ucsd.edu>
Obtained from:	DragonFlyBSD
2005-05-18 14:50:35 +00:00
Giorgos Keramidas
58ea49c98e (1) Revert unnecessary indentation changes I committed as part of the
last version and (2) remove a disabled debugging fprintf() that I
accidentally committed here.

Noticed by:	simon (2)
2005-05-18 13:42:51 +00:00
Giorgos Keramidas
bbf750fbff Merge the CPU and WCPU columns in a single %6.2f column, add a new 'C'
command that toggles between the two and update the ORDER_PCTCPU()
macro to sort correctly by the visible "cpu" value.

This saves 6 more columns in 80-column terminals, making things a lot
better for the COMMAND column.

Tested on:	i386, sparc64 (panther), amd64 (sledge)
Approved by:	davidxu (in principle)
2005-05-18 13:30:08 +00:00
Hartmut Brandt
485aef42c9 Get rid of the ReturnStatus obscuration that was anyway used only
in two places. While here don't bother returning anything from
Lst_Replace - nobody ever checks the return code.

Suggested by:	jmallet
2005-05-18 06:50:39 +00:00
Alexander Kabaev
39be1552ee Unbreak r1.11 by delhij. Blind change from unsigned to signed char
pointer causes problems with sign extension and leads to compress(1)
dumping core on any non-trivial incoming data.
2005-05-18 05:24:08 +00:00
Ruslan Ermilov
f9fe4d605f Add temporary patches to make one-true-awk respect locale's collating order
in [a-z] bracket expressions, until a more complete fix (like handing BREs)
is ready.

Prodded by:	ache
OK'ed by:	tjr
2005-05-17 14:54:33 +00:00
Ruslan Ermilov
7f5103e510 Correct the script name to be "zless.sh". This avoids an extra cp/chmod
(from the sys.mk rule) while still installing it under the "zless" name.
2005-05-17 11:41:01 +00:00
Dag-Erling Smørgrav
2430592ce1 Add a zless script which invokes less using the lesspipe script. This is
similar to the zmore script that comes with gzip (and in fact, in most
Linux distros, zless is a symlink to that very same zmore script) but has
the advantage that you get the correct file name on the less status line,
and can use :n and :p to navigate back and forth between multiple files.

MFC after:	1 week
2005-05-17 11:14:11 +00:00
Dag-Erling Smørgrav
40d28fe140 Handle presumably uncompressed files with cat; exec the handlers.
MFC after:	1 week
2005-05-17 11:08:11 +00:00
David E. O'Brien
c413702af3 Hardcode username to 8 characters. This makes top(1) output sane when
there are users on the system (even if not running a single process)
with a login > 8 chars.
I'm not all that happy limiting the username width like this, but it
restores sanity to top(1) output.

Discussed with:	keramida
2005-05-16 18:17:38 +00:00
Ruslan Ermilov
228f8c4f8b Make <runefile.h> internal to libc.
Suggested by:	phantom
2005-05-16 09:32:41 +00:00
Marcel Moolenaar
77a77c66d1 o Add option -n. The -n option takes a count and breaks the line
after that many values have been printed. The line length is not
   considered anymore.
o  Add option -x. The -x option will cause the byte values to be
   printed in hexadecimal instead of decimal.
o  Bump WARNS to 6.
o  Update the manpage accordingly.
2005-05-15 06:26:59 +00:00
Marcel Moolenaar
ac97b33fc7 Reindent and improve style(9) comformance. 2005-05-15 01:07:36 +00:00
Hajimu UMEMOTO
4f10131848 NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
2005-05-13 16:31:11 +00:00
Hartmut Brandt
80f4b4290c Use the print_flags function to print the OP_ flags of a target.
Give the function one more argument to decide whether it should
print the flags like a C-expression or just space-delimited.
2005-05-13 13:47:41 +00:00
Hartmut Brandt
3814743160 Move the Boolean and ReturnStatus stuff from sprite.h to util.h and
get rid of sprite.h.

Obtained from:	DragonFlyBSD
2005-05-13 08:53:00 +00:00
Hartmut Brandt
5a7a21e591 Make Shell_Init() static - it's only used here.
Make sure we don't end up with shellPath beeing non-zero, but shellName
beeing zero in the error case - back out cleanly from the error.
When executing a command for macro assignment in Cmd_Exec() stuff the
path of the shell into argv[0], not the name. This makes no difference
from the functionality point of view, but allows the regression tests to
determine whether make executes the correct shell.
2005-05-13 06:31:45 +00:00
Juli Mallett
36f45138fb Add a flag (-q) which prints no header for the file and which doesn't indent the
match text; it also doesn't warn() for files which can't be opened.  Remove
global variables.  Use bool.  fopen(3) the files instead of freopen(3)ing stdin.
2005-05-12 18:57:37 +00:00
Juli Mallett
3b7d275a3d Include <err.h>. On my system CVS Make(1) has an implicit declaration of
warnc(3) without it.
2005-05-12 16:40:16 +00:00
Hartmut Brandt
fda7e43bda Still too early to bump WARNS - there are still warnings on 64bit
architectures.
2005-05-12 15:58:25 +00:00
Hartmut Brandt
2c050ec33f Make sure machine is initialize before use. Also make two pointers const
to get rid of the last two const warnings.
2005-05-12 15:54:52 +00:00
Hartmut Brandt
fac1e7a589 Get rid of the warning about vfork() clobbering variables.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.246)
2005-05-12 15:54:17 +00:00
Hartmut Brandt
616b319ded Do mktemp() by hand to get rid of the mktemp() warning and the
possible associated security hole.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.245)
2005-05-12 15:45:14 +00:00
Hartmut Brandt
6bf2b616ac Use a variable initialized to a string instead of the string directly
to get rid of a const warning.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.244)
2005-05-12 15:41:02 +00:00
Hartmut Brandt
375209dd24 Move code in CondToken() and get rid of a goto.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.243)
2005-05-12 15:38:11 +00:00
Hartmut Brandt
8de86ef91d Remove a useless else and un-indent the following code. 2005-05-12 15:35:33 +00:00
Hartmut Brandt
a604bcc55d Revert the previous accidential commit. 2005-05-12 15:20:50 +00:00
Hartmut Brandt
46180c9f74 Cleanup SuffFindArchDeps() to get rid of two const-warnings.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.240)
2005-05-12 15:20:03 +00:00
Hartmut Brandt
7ea02fbf54 The first element of the vector built by brk_string() is never
used so there is no need to stuff the value of .MAKE into it,
which btw isn't set for quite a while already.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.239)
2005-05-12 15:10:45 +00:00
Hartmut Brandt
059649b9ce Cleanup. Move initialisation of file and program global variables
to top of main() and sort them. Make chdir_verify_path() static - it
is used only here.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.238)
2005-05-12 15:04:14 +00:00
Hartmut Brandt
1185781977 Replace a lot of Var_Set(..., VAR_GLOBAL) by Var_SetGlobal().
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.237)
2005-05-12 14:47:22 +00:00
Hartmut Brandt
7007abaf14 Cleanup main(). Move catching SIGCHLD into job.c. Move unsetenv("ENV")
into job.c. Move retrieving of environment nearer to the place where it
is actually used and invert the preprocessor conditionals to use
positive logic.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.236)
2005-05-12 14:43:32 +00:00
Hartmut Brandt
54a923046f Reshuffle functions to get rid of prototypes.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.235)
2005-05-12 14:35:01 +00:00
Hartmut Brandt
3db87a68e0 Compat_RunCommand is used only in job.c so make it static there.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.234)
2005-05-12 14:33:24 +00:00
Hartmut Brandt
7594df85cf Move variable printing from main.c to var.c
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.233)
2005-05-12 14:31:42 +00:00
Hartmut Brandt
8b8eb9e2ab Fix the fix for bin/72510 applied in job.c:1.70. Actually there have
been two maxJobs variables: one static in job.c and one global used in
main.c and parse.c. Makeing one global out of these was the wrong way
to fix the problem. Instead rename the global one to jobLimit and keep
maxJobs static in job.c.

Suggested by:	rwatson
PR:		bin/72510
2005-05-12 14:16:44 +00:00
Hartmut Brandt
0ec9b6feef Move some global variables to the correct files.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.232)
2005-05-12 11:58:39 +00:00
Hartmut Brandt
e30f38a08e Untwist the convoluted if() expressions in JobFinish(). They
could benefit from even more untwisting.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.23[01])
2005-05-12 11:47:17 +00:00
Hartmut Brandt
d8549718a9 Move some comments around to where they belong and remove some unneccessary
gcc magic.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.229)
2005-05-12 11:16:04 +00:00
Hartmut Brandt
f7a01b8dcc Convert Compat_RunCommand() to use ProcWait(). This also gives Cmd_Exec()
the potential to handle interrupts which it doesn't currently.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.228)
2005-05-12 11:09:45 +00:00
Hartmut Brandt
32b5d9451b Make a function ProcWait() that waits for the given process.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.227)
2005-05-12 10:55:37 +00:00
Hartmut Brandt
4eb51779c8 Overhaul the fork(), exec() code. Put all the common handling that
takes place in the child process in a function ProcExec(). Make sure,
that the child does not call malloc() or other potential dangerous
functions (there are still calls to Punt() in the error case that
should go away). Allocate the argv string via malloc to overcome
the non-constness bug of the execvp prototype. Change the handling of
shell meta-characters and move the builtin list near the list of shell
builtins. Both of these lists should actuall be configurable by the .SHELL
target since they depend on the shell used.

Patch:		7.21[2-9], 7.22[0-46]
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-12 10:40:57 +00:00
Max Khon
5cf3bf70f7 - check for geom_uzip module presence using kldstat -m.
kldstat -m finds geom_uzip module even if it is compiled in statically.
- create output file with x bit set.
- build mkuzip on all architectures (verified with "make universe").
- fix typo in info message.
2005-05-11 17:02:38 +00:00
Juli Mallett
e8b92d55b6 Spell 1 as SHUT_WR in argument to shutdown(2). 2005-05-11 02:49:03 +00:00
Hartmut Brandt
4aa6beaf60 Move the definitions of the OP_* constants from make.h into GNode.h
where they actually belong to. Move the definitions of the strings
for special macros like "$*" from make.h to parse.h - they're used
only in the parser.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.211)
2005-05-10 14:27:04 +00:00
Hartmut Brandt
824060d705 Path_Expand() expects its first argument to be writeable so put the
default system directory into a writeable character array before passing
it to Path_Expand().

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.210)
2005-05-10 14:23:31 +00:00
Hartmut Brandt
e8b4c1591a Move declarations of variables belonging to the variable module
from globals.h into var.h.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.209)
2005-05-10 14:16:40 +00:00
Hartmut Brandt
413c6d2540 Style: remove spaces before tabs.
Patch:	7.207
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:13:20 +00:00
Hartmut Brandt
a139b7bac1 Move the remaining two prototypes from nonints.h to make.h and
remove nonints.h.

Patch:	7.204
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:10:44 +00:00
Hartmut Brandt
9a910e11d1 Make shellPath and shellName static - they're used in job.c only.
Move definition of parsing error levels from make.h into parse.h.

Patches:	7.202,7.203
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:06:19 +00:00
Hartmut Brandt
43ad410a92 Make the three versions of fork() more uniform.
Patch:		7.201 (idea taken, but done differently)
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:03:28 +00:00
Hartmut Brandt
d7bc2a41df Move the defines for TMPPAT and KQUEUE from the public job.h into job.c
since they are used only there.

Patch:		7.200
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 13:48:15 +00:00
Hartmut Brandt
626dc02016 Merge compat.c into job.c. There is a lot in common between these
files and we are going to factor this out.

Patch:		7.199 (slightly changed)
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 13:45:29 +00:00
Gleb Smirnoff
1ed86f6c90 Add option -l, to make output line buffered.
PR:		bin/78692
Submitted by:	Eugene Grosbein
MFC after:	2 weeks
2005-05-10 13:40:50 +00:00
Hartmut Brandt
c26295ddea Move Cmd_Exec() from main.c to job.c and fix its prototype. This
results in a warning that will go away soon.

Patch:		7.198
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 13:18:58 +00:00
Hartmut Brandt
671adc85da Var_SubstOnly() is only used to subsitute a variable from the global
context (and only in one place to substitute the .for variable). Therefor
there is no need to pass the context as a parameter.

Patch:	7.197
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 12:02:15 +00:00
Hartmut Brandt
45b3caadf9 Move the declaration of VAR_CMD and VAR_GLOBAL from globals.h to var.h
Patch:		7.196
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 11:58:52 +00:00
Hartmut Brandt
3b5ff5e82d Clean up comments. No code changes.
Patch:		7.195
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 11:55:46 +00:00
Hartmut Brandt
74369e814b Merge var_modify.c into var.c and move types and function declarations
that are now used only in var.c from var.h to var.c

Patches:	7.193,7.194
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 11:53:20 +00:00
Hartmut Brandt
70d7035e1f Move some debugging code from targ.c to var.c where it actually belongs.
Patch:		7.192
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 08:14:26 +00:00
Hartmut Brandt
103823e628 Make make a little bit more POSIXish with regard to option parsing:
take everything after -- as either a macro assignment or a target.
Note that make still reorders arguments before --: anything starting
with a dash is considered an option, anything which contains an equal
sign is considered a macro assignment and everything else a target.
This still is not POSIX with regard to the options, but it will probably
not change because it has been make's behaviour for ages.
Add a new function Var_Match() that correctly skips a macro call by just
doing the same as Var_Subst() but without producing output. This will help
making the parser more robust.

Patches:	7.190,7.191
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 08:06:13 +00:00
Hartmut Brandt
02c3270da1 Split Var_Subst() into two functions: Var_SubstOnly() which substitutes
only one variable and Var_Subst() which substitutes all. Split out the
test whether a variable should not be expanded into match_var().
Make access to the input string consistently using str[]. Remove two
unused functions: Var_GetTail() and Var_GetHead().

Patches:	7.184-7.189
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-09 14:06:04 +00:00
Tim Kientzle
cf220b45a5 Clarify some error messages. 2005-05-08 06:25:15 +00:00
Hartmut Brandt
352a63dee8 Introduce a new pseudo-target .EXPORTVAR which allows to put a
make macro into the environment of programs executed by make. This
has approximately the same function as gmake's export directive.
The form of a pseudo target was deliberately choosen to minimize work
for POSIX compatibility (Makefiles are not allowed to use any targets
starting with a dot and consisting only of uppercase letters except those
specified in the standard when they want POSIX compatible behaviour, so
such a Makefile can never contain .EXPORTVAR.)
Change the handling of macros coming from the environment: instead
of asking the environment for each variable we could not find otherwise
put all the environment variables in a special variable environment just
at start up.

This has been tested on the ports cluster by kris.

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-06 18:30:06 +00:00
Takanori Watanabe
4ebd3ea1f6 Make smbfs capable to use 16bit char set in filenames.
PR:78110
2005-05-04 15:05:46 +00:00
Maxim Sobolev
683cd8e85a Enabke mkuzip(1) on amd64.
Submitted by:	Matteo Riondato <rionda@gufi.org>
2005-05-02 17:40:40 +00:00
Maxim Sobolev
ed9302fdd6 Make WARNS=6 clean, which should make it compiling on amd64.
Submitted by:	Matteo Riondato <rionda@gufi.org>
2005-05-02 17:38:49 +00:00
Brian Feldman
816e8c037d Make brandelf(1)'s -t "ABI format" case insensitive, as the ABI value
given is looked up in a table and no longer stored literally in the
header.

Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz
PR: 80499
MFC After: 1 month
2005-05-02 17:19:33 +00:00
Xin LI
add62273c9 Include systat.h for cmdtab, to make gcc4 happy. 2005-05-02 10:50:10 +00:00
Xin LI
05195f8d61 Consistently use signed char so gcc4 won't complain 2005-05-02 10:23:03 +00:00
Hartmut Brandt
be7a5506e8 Rename the directive_hash.[ch] files to hash_tables.[ch] now
that there are more than one hash table in them. There is no
history to preserve here, so go without a repo-copy.

Asked for by:	Max Okumoto <okumoto@ucsd.edu>
2005-04-29 15:15:28 +00:00
Hartmut Brandt
3dece030a5 Implement a pseudo-target .WARN that allows toggeling the warning flags
for the current make. This does not override flags specified on the
command line and these settings are not passed to sub-makes.
2005-04-29 14:37:44 +00:00
Robert Drehmel
7f31354152 Add flag to choose whether to use getgrouplist(3) or getgroups(2)
to the id_print() function.

Use getgrouplist(3) for the case when an user was specified,
and getgroups(2) when no user was given.
That reverts to the expected behaviour and makes it easy to
implement an option later to force using getgrouplist(3).
2005-04-29 10:11:18 +00:00
Robert Drehmel
5b8e7b6b29 Fix spelling error. 2005-04-29 08:37:52 +00:00
Robert Drehmel
58b6761db3 We need to pass NGROUPS + 1 to getgrouplist(3) to display
NGROUPS groups.  getgrouplist(3) may put a duplicate group
id into the passed array (it sets [0] and [1] to the value
of the gid argument), but id_print() sorts them out.
2005-04-28 16:11:37 +00:00
Robert Drehmel
68b9b81e79 - Merge two functions for printing `id' output.
Showing the ids of both an user given by an argument to `id',
   and the current user, is now handled in a single function.
   Displaying the current user's ids was inaccurate because
   getgroups(2) had been used.  getgroups(2) returns the current
   kernel state of a user's groups, which may not always be
   correct if /etc/group was recently changed.
 - Fix a few style bugs.

PR:		bin/78085
2005-04-28 15:55:54 +00:00
Hartmut Brandt
48c49ace00 Introduce a flag to enable extended warnings (-x) and make them off
by default. This should fix the problem of getting lots of errors
when building with an up-to-date make and old *.mk files.
2005-04-28 15:37:25 +00:00
Robert Drehmel
92bc8d4e8e - Set negative row or column argument values to zero.
Negative values would produce undefined behaviour including
   a possible segmentation fault.
 - Explicitly initialize the global row and column variables
   to zero.

PR:		bin/80348
2005-04-28 12:37:15 +00:00
Hartmut Brandt
b1880272f1 Use a minimal perfect hash for the special sources/targets too. Add
the corresponding magic to create the hash function to the Makefile.
2005-04-28 12:05:43 +00:00
Hartmut Brandt
47cc56ab55 Fix the $$FreeBSD$$ that should be written verbatim to directive_hash.c
so that it doesn't get replaced with the Makefile's revision.
2005-04-28 08:04:46 +00:00
Hartmut Brandt
2274441da6 Move the hash function for directives into its own file and add
a Makefile target to re-created this file. Note, that there is no
explicite dependency to automatically re-create the file, because this
is needed only when the directive table changes and it requires the
(yet to come) devel/mph port.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (first version)
2005-04-28 07:55:55 +00:00