Commit Graph

9140 Commits

Author SHA1 Message Date
Ulf Lilleengen
174eb94d2b Merge support for CVSMode (aka. mirror mode) into csup. This means csup can now
fetch a complete CVS repository. Support for rsync update of regular files are
also included, but are not yet enabled. The change should not have an impact on
existing csup usage, as little of the existing code has changed.
2009-01-05 15:18:16 +00:00
David E. O'Brien
eee3404481 + Add the -Q be-quiet flag for parallel jobs.
- Enable -Q by default for the moment - there is something weird
  going on in the rescue build.
2009-01-03 10:14:01 +00:00
Maxim Konovalov
f1c0a78d99 o With -L flag show unix sockets listen queues stats. It is useful
to know number of not accepted connections for monitoring purposes.

PR:		bin/128871
Submitted by:	Anton Yuzhaninov
MFC after:	1 month
2008-12-31 08:56:49 +00:00
Robert Watson
4fbcc986d9 Include param.h instead of types.h before mount.h so that the nested
include of param.h can be removed from audit.h.

MFC after:	3 weeks
2008-12-29 19:00:28 +00:00
Robert Watson
e1f323f350 Include param.h instead of types.h before user.h so that the nested
include of param.h can be removed from audit.h.

MFC after:	3 weeks
2008-12-29 18:58:22 +00:00
David E. O'Brien
78885448f1 1. Add the ability to tweak the token output before targets in job mode.
E.g.,  .MAKE.JOB.PREFIX=${.newline}---[${.MAKE.PID}]
   would produce

   ---[1234] target ---

2. Added ${.newline} as a simple means of being able to include '\n' in the
   assignment of .MAKE.JOB.PREFIX

Obtained from:	NetBSD
2008-12-29 10:26:02 +00:00
David E. O'Brien
cfd6aac638 Consistently use Var_SetGlobal(). 2008-12-29 08:05:49 +00:00
Tom Rhodes
610c7c3155 Fix up after last commit:
Bump doc date;
Kill hard sentence breaks;
Fix commas by moving them off their own line.
2008-12-27 00:17:41 +00:00
Luigi Rizzo
5e7fbb7b5e Clarify the behaviour of conditionals when dealing with comparisons.
In particular, point out that string comparison can only use != and ==
(how weird, given that the underlying call to strcmp returns more
information), that floating point values are correctly interpreted
as numbers, and that the left-hand side must be a variable expansion.

MFC after:	3 weeks
2008-12-26 22:31:45 +00:00
Rui Paulo
491c34ec7e Right align the CPU column header. 2008-12-26 11:11:30 +00:00
Maxim Konovalov
c0c6601311 o Fix grammar.
PR:		bin/129938
Submitted by:	Bruce Cran
2008-12-26 07:16:20 +00:00
Tom Rhodes
0d186272b4 Remove reference to unimplemented "-c" option.
PR:		119338
2008-12-25 08:48:08 +00:00
Tom Rhodes
c92f699693 Update the description of -k, output files appear to
be left regardless of an error, signal, or complete
run.

PR:		69861
Submitted by:	vlad902@gmail.com
2008-12-24 10:08:39 +00:00
Doug Barton
125f2ee5e9 Update bmake glue for changes in 9.4.3 2008-12-23 22:51:10 +00:00
Tom Rhodes
d31572b0b8 Add a basic manual page for elf2aout.
Alter Makefile and remove NO_MAN.

PR:	109975
2008-12-23 01:22:57 +00:00
Garrett Wollman
ba29aec0d3 Implement a new feature for the "-m" option: if the month number is
followed by 'f' or 'p', use the following or preceding month of that
number, respectively.  Document this.  Also includes other minor
grammatical and punctuation fixes to the manual page (capitalize
Easter, etc.).

MFC after:	1 month
2008-12-22 21:22:42 +00:00
Wesley Shields
d5db4444c3 Fix a typo.
Approved by:	rwatson
2008-12-19 16:56:49 +00:00
Joe Marcus Clarke
08afefa814 Do not segfault when procstat -f or procstat -v is called on a process not
owned by the current user.  If kinfo_getfile() or kinfo_getvmmap() return
NULL, simply exit, and do not try and derefernce the memory.

Reviewed by:	peter
Approved by:	peter
2008-12-19 06:50:15 +00:00
Max Khon
a8e17a098e Exit with error code 2 when run with -k (continue if errors) and build failed. 2008-12-18 12:16:51 +00:00
Murray Stokely
e8f612b687 1. Update fetch to consistently return 1 on error, as the man page states,
rather than usually returning 1 but in a few instances using a sysexits(3)
   return value.

2. Remove a few unused variables from libfetch.

PR:		docs/122470  (1, only)
Reviewed by:	des
2008-12-17 18:00:18 +00:00
Ruslan Ermilov
49f8bb9a95 Fix printing of shared memory limits.
MFC after:	3 days
2008-12-16 09:17:05 +00:00
Murray Stokely
7f92799f67 Add support for HTTP 1.1 If-Modified-Since behavior.
fetch(1) accepts a new argument -i <file> that if specified will cause
the file to be downloaded only if it is more recent than the mtime of
<file>.

libfetch(3) accepts the mtime in the url structure and a flag to
indicate when this behavior is desired.

PR:		bin/87841
Submitted by:	Jukka A. Ukkonen <jau@iki.fi> (partially)
Reviewed by:	des, ru
MFC after:	3 weeks
2008-12-15 08:27:44 +00:00
Qing Li
6e6b3f7cbc This main goals of this project are:
1. separating L2 tables (ARP, NDP) from the L3 routing tables
2. removing as much locking dependencies among these layers as
   possible to allow for some parallelism in the search operations
3. simplify the logic in the routing code,

The most notable end result is the obsolescent of the route
cloning (RTF_CLONING) concept, which translated into code reduction
in both IPv4 ARP and IPv6 NDP related modules, and size reduction in
struct rtentry{}. The change in design obsoletes the semantics of
RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland
applications such as "arp" and "ndp" have been modified to reflect
those changes. The output from "netstat -r" shows only the routing
entries.

Quite a few developers have contributed to this project in the
past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and
Andre Oppermann. And most recently:

- Kip Macy revised the locking code completely, thus completing
  the last piece of the puzzle, Kip has also been conducting
  active functional testing
- Sam Leffler has helped me improving/refactoring the code, and
  provided valuable reviews
- Julian Elischer setup the perforce tree for me and has helped
  me maintaining that branch before the svn conversion
2008-12-15 06:10:57 +00:00
Tim Kientzle
5d42c42369 Spell "substitution" correctly.
PR:		bin/128616
Submitted by:	Jaakko Heinonen
Pointy hat:	Tim Kientzle
MFC after:	30 days
2008-12-15 06:00:25 +00:00
Ruslan Ermilov
e801aa4856 Improve usage and sync SYNOPSIS with usage. 2008-12-13 17:48:06 +00:00
Ruslan Ermilov
13546eccd5 Sync manpage's synopsis with program's usage().
Trim whitespace at EOL.
2008-12-13 15:44:29 +00:00
Dag-Erling Smørgrav
2b8907e7e2 Apply the same defaults to https as to http.
Submitted by:	Mike Tancsa <mike@sentex.net>
MFC after:	1 week
2008-12-11 06:54:36 +00:00
Konstantin Belousov
20e76cb365 Add strndup(3) prototype to string.h.
This change was erronously ommitted from the r185690, and attempt
to simply add the prototype to string.h has revealed that several
contributed programs defined local prototypes for strndup(), controlled
by autoconfed config.h. So, manually change #undef HAVE_STRNDUP to
#define HAVE_STRNDUP 1. Next import of the corresponding program would
regenerate config.h, overriding the changes in this commit.

No objections from: kan
2008-12-08 21:04:24 +00:00
Giorgos Keramidas
f45dd01002 Add a -L option to wc(1), for finger compatibility with the GNU
wc utility.  The -L option can be used to report the length of
the longest line wc has seen in one or more files.  It is
disabled by default, and wc uses the standard `-lwc'.

Submitted by:	Sheldon Givens, sheldon at sigsegv.ca
Reviewed by:	kib
MFC after:	1 week
2008-12-06 19:21:56 +00:00
Tim Kientzle
2c2029ada9 bsdtar is synced up with 2.5.903a 2008-12-06 07:38:14 +00:00
Tim Kientzle
286e81aeb0 bsdtar always supports long options now, so we can remove
a documentation disclaimer.
2008-12-06 07:37:55 +00:00
Tim Kientzle
d47cf339f4 Only use GCC-specific __dead2 marker when building with GCC. 2008-12-06 07:37:14 +00:00
Tim Kientzle
4b058a88d8 Custom command line parser for cpio; this is a little more
code but should be a lot fewer cross-platform compatibility
headaches.
2008-12-06 07:30:40 +00:00
Tim Kientzle
5eca8160b5 Make the GCC-specific __dead2 markers conditional on whether
we're compiling under GCC.
2008-12-06 07:15:42 +00:00
Peter Wemm
41fbf4374b Update format string for kve_start/end. 2008-12-02 15:08:33 +00:00
Peter Wemm
43151ee6cf Merge user/peter/kinfo branch as of r185547 into head.
This changes struct kinfo_filedesc and kinfo_vmentry such that they are
same on both 32 and 64 bit platforms like i386/amd64 and won't require
sysctl wrapping.

Two new OIDs are assigned.  The old ones are available under
COMPAT_FREEBSD7 - but it isn't that simple.  The superceded interface
was never actually released on 7.x.

The other main change is to pack the data passed to userland via the
sysctl.  kf_structsize and kve_structsize are reduced for the copyout.
If you have a process with 100,000+ sockets open, the unpacked records
require a 132MB+ copyout.  With packing, it is "only" ~35MB.  (Still
seriously unpleasant, but not quite as devastating).  A similar problem
exists for the vmentry structure - have lots and lots of shared libraries
and small mmaps and its copyout gets expensive too.

My immediate problem is valgrind.  It traditionally achieves this
functionality by parsing procfs output, in a packed format.  Secondly, when
tracing 32 bit binaries on amd64 under valgrind, it uses a cross compiled
32 bit binary which ran directly into the differing data structures in 32
vs 64 bit mode.  (valgrind uses this to track file descriptor operations
and this therefore affected every single 32 bit binary)

I've added two utility functions to libutil to unpack the structures into
a fixed record length and to make it a little more convenient to use.
2008-12-02 06:50:26 +00:00
Tim Kientzle
5157f46024 Format the output of -itv for real. In particular:
* Lookup uname/gname if not provided by the archive (I copied the
   uname/gname lookup cache from bsdtar)
 * Format device number instead of size for device nodes
 * Format date.

There's still a few improvements that I could copy from
bsdtar, especially the locale-aware safe_fprintf() code
and the locale-aware setup for day_first date formatting.
(And, of course, I need to think through a clean way to
push this stuff down into libarchive.)

Thanks to Peter Wemm for reminding me of this overlooked TODO item.
2008-11-29 20:22:02 +00:00
Tim Kientzle
5af3583731 When deciding which characters (of a filename, for instance)
are safe to print, try to take into account the current locale.
This iterates over output strings using mbtowc() to identify
multi-byte sequences.  If iswprint() claims the corresponding
wide character is printable, the original bytes are passed
through.  Otherwise, we expand characters into C-style
\-escape sequences.

Submitted by:	Michihiro NAKAJIMA
MFC after:	30 days
2008-11-29 20:06:53 +00:00
Bjoern A. Zeeb
413628a7e3 MFp4:
Bring in updated jail support from bz_jail branch.

This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..

SCTP support was updated and supports IPv6 in jails as well.

Cpuset support permits jails to be bound to specific processor
sets after creation.

Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.

DDB 'show jails' command was added to aid debugging.

Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.

Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.

Bump __FreeBSD_version for the afore mentioned and in kernel changes.

Special thanks to:
- Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches
  and Olivier Houchard (cognet) for initial single-IPv6 patches.
- Jeff Roberson (jeff) and Randall Stewart (rrs) for their
  help, ideas and review on cpuset and SCTP support.
- Robert Watson (rwatson) for lots and lots of help, discussions,
  suggestions and review of most of the patch at various stages.
- John Baldwin (jhb) for his help.
- Simon L. Nielsen (simon) as early adopter testing changes
  on cluster machines as well as all the testers and people
  who provided feedback the last months on freebsd-jail and
  other channels.
- My employer, CK Software GmbH, for the support so I could work on this.

Reviewed by:	(see above)
MFC after:	3 months (this is just so that I get the mail)
X-MFC Before:   7.2-RELEASE if possible
2008-11-29 14:32:14 +00:00
George V. Neville-Neil
94f138fe60 Fix a printing problem when using the -L flag to netstat caused
by adding the -x flag earlier.

Submitted by:	Anton Yuzhaninov
MFC after:	3 days
2008-11-28 18:35:14 +00:00
Tim Kientzle
2f01c75815 After visiting a subdirectory, we use chdir("..") or
fchdir() to return back to the parent.  If those fail,
we're just dead in the water.  Add a new error value
TREE_ERROR_FATAL to indicate that directory traversal
cannot continue.  Have write.c honor that by exiting
immediately.

MFC after:	30 days
2008-11-27 05:49:52 +00:00
Tim Kientzle
e4504a7d06 If we're unable to chdir() to a directory that we know exists,
that should result in a non-zero return value.

In particular, this should address the issue that David Wolfskill
ran into with a somewhat flaky NFS mount resulting in a damaged
archive even though tar returned success.

MFC after:	4 days
2008-11-27 05:14:36 +00:00
Ulf Lilleengen
8658b90899 - Add missing rsyncfile from Makefile 2008-11-23 19:43:45 +00:00
Xin LI
5c13cfe080 Use strlcpy() where appropriate. 2008-11-19 00:14:15 +00:00
Roman Divacky
257072a6dd ANSIfy the wwend function.
Approved by:	kib (mentor)
2008-11-18 21:06:49 +00:00
Peter Holm
21543d8055 Add myself
Approved by:	kib (mentor)
2008-11-18 14:05:11 +00:00
Pawel Jakub Dawidek
1ba4a712dd Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.
This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

	Allows regular users to perform ZFS operations, like file system
	creation, snapshot creation, etc.

- L2ARC

	Level 2 cache for ZFS - allows to use additional disks for cache.
	Huge performance improvements mostly for random read of mostly
	static content.

- slog

	Allow to use additional disks for ZFS Intent Log to speed up
	operations like fsync(2).

- vfs.zfs.super_owner

	Allows regular users to perform privileged operations on files stored
	on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

	Not all the flags are supported. This still needs work.

- ZFSBoot

	Support to boot off of ZFS pool. Not finished, AFAIK.

	Submitted by:	dfr

- Snapshot properties

- New failure modes

	Before if write requested failed, system paniced. Now one
	can select from one of three failure modes:
	- panic - panic on write error
	- wait - wait for disk to reappear
	- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

	Just quota and reservation properties, but don't count space consumed
	by children file systems, clones and snapshots.

- Sparse volumes

	ZVOLs that don't reserve space in the pool.

- External attributes

	Compatible with extattr(2).

- NFSv4-ACLs

	Not sure about the status, might not be complete yet.

	Submitted by:	trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from:	OpenSolaris
2008-11-17 20:49:29 +00:00
Diomidis Spinellis
46da6c4869 Fix the code to conform to the "or more" part of the following POSIX
specification and regression test regress:25.

  "A function can be preceded by one or more '!' characters, in which
  case the function shall be applied if the addresses do not select
  the pattern space."

MFC after:	2 weeks
2008-11-11 17:15:57 +00:00
Tim Kientzle
8666079cdb Include more detailed explanation of this case, since it's pretty
subtle why it comes out the way it does.  Once you realize that it
depends on the archiving order, it's also important to realize that
filesystem differences aren't going to break this case.  (Some of the
other tests have had to be extensively rewritten to make them
independent of the order in which a particular filesystem returns file
entries.)

(This commit also serves to note the PR number that I accidentally
omitted from the previous commit.)

PR:		bin/128562
MFC after:	30 days
2008-11-10 05:24:13 +00:00
Tim Kientzle
c4a52c7226 Test --strip-components and fix it to actually work. Jaakko did a
good job writing this test; it exercises a lot of subtle cases.  The
trickiest one is that a hardlink to something that didn't get
extracted should not itself be extracted.  In some sense, this is not
the desired behavior (we'd rather restore the file), but it's the best
you can do in a single-pass restore of a tar archive.

The test here should be extended to exercise cpio and newc formats as
well, since their hardlink models are different, which will lead to
different handling of some of these edge cases.

Submitted by:	Jaakko Heinonen
MFC after:	30 days
2008-11-10 05:04:55 +00:00
Hiroki Sato
d3d0d3a3b5 Add workaround for a back reference when no corresponding
parenthesized subexpression is defined.  For example, the
following command line caused unexpected behavior like
segmentation fault:

 % echo test | sed -e 's/test/\1/'

PR:		bin/126682
MFC after:	1 week
2008-11-09 01:10:21 +00:00
Tim Kientzle
85ae3122e9 New command-line parser for bsdtar.
This replaces the getopt()/getopt_long() wrapper, the old-style
argument rewriter and the associated configuration glue with a more
straightforward custom command parser.  In particular, this ensures
that bsdtar will have consistent option parsing on every platform,
regardless of whether the platform supports getopt_long().

MFC after:	30 days
2008-11-08 04:43:24 +00:00
Max Laier
246b6a6d70 Restore (intmax_t) casts I lost during the last change & unbreak the build. 2008-11-06 23:55:28 +00:00
Max Laier
fd543f2759 Add two new options to du(1):
-A      Display the apparent size instead of the disk usage.  This can be
             helpful when operating on compressed volumes or sparse files.

     -B blocksize
             Calculate block counts in blocksize byte blocks.  This is differ-
             ent from the -k, -m options or setting BLOCKSIZE and gives an
             estimate of how much space the examined file hierachy would
             require on a filesystem with the given blocksize.  Unless in -A
             mode, blocksize is rounded up to the next multiple of 512.

The former is similar to GNU's du(1) --apparent-size.  The latter is
different from what GNU's du(1) -B does, which is equivalent to setting
BLOCKSIZE in our implementation and is rather pointless as it doesn't add
any real value (i.e. you can achieve the same with a simple awk-script).

No change in the normal output or processing.

Reviewed by:			keramida@, Peter French
Otherwise silience from:	freebsd-hackers@
2008-11-06 16:30:38 +00:00
Craig Rodrigues
c65e3b1854 Merge latest DTrace changes from Perforce.
Approved by:	jb
2008-11-05 19:39:37 +00:00
Tim Kientzle
025b20f6e5 When comparing, cast to the larger size, off_t in this case.
Once we know which one is smaller, then we cast to the smaller size.

Thanks to Xin Li (delphij@)
Pointy hat: /me
2008-11-05 06:40:53 +00:00
Tim Kientzle
f4e24c4e7a Fix compile warnings building on amd64. This is modified slightly
from Jaakko's original patch: I have misgivings about the portability
of the 'z' printf modifier so opted to cast the arguments to (int)
instead.

PR:		bin/128561
Submitted by:	Jaakko Heinonen
MFC after:	30 days
2008-11-05 05:26:11 +00:00
Max Laier
0551897af2 Declare functions and variables static and save a few byte. This is a
style(9)-change, too.  Separate commit as it changes the object.
2008-11-04 19:23:48 +00:00
Max Laier
40850176c9 style(9): mostly avoiding line wrap by not indenting cases. No obj change. 2008-11-04 19:17:32 +00:00
Giorgos Keramidas
e9d8f84b73 Fix comment typo that managed to sneak in when I copy pasted some
comments & code from iostat.
2008-11-04 18:20:54 +00:00
Giorgos Keramidas
4fb6032f19 Repeat vmstat header after window.rows instead of a hardcoded 20.
Use ioctl() to get the window size in vmstat(8), and force a new
header to be prepended to the output every time the current window
size changes.  Change the number of lines before each header to the
current lines of the terminal when the terminal is resized, so that
the full terminal length can be used for output lines.

Inspired by:	svn change 175562 (same feature for iostat)
Reviewed by:	ru (who fixed some of my bugs too)
MFC after:	1 week
2008-11-04 18:02:35 +00:00
Ulf Lilleengen
3d4e599494 - Import csup work from p4. 2008-10-19 09:08:59 +00:00
Ulf Lilleengen
fc84e5f31b - Import the Makefile from HEAD for building csup. 2008-10-19 08:43:16 +00:00
Ulf Lilleengen
d7f03759d5 - Import the HEAD csup code which is the basis for the cvsmode work. 2008-10-19 08:41:10 +00:00
Xin LI
1c10962832 Use strlcpy() when we mean it. 2008-10-17 21:14:50 +00:00
Poul-Henning Kamp
65a9b18218 Free old arrays if we increase them.
Pointed out by:	mlaier
2008-10-16 20:56:09 +00:00
Poul-Henning Kamp
c4f431a628 Make ministat(1) vastly faster on huge datasets. 2008-10-16 20:39:02 +00:00
Xin LI
1b0fa6fa40 ANSIfy, plus constify interfaces where possible. 2008-10-13 23:10:19 +00:00
Xin LI
3a4e1f4703 Use strlcpy() instead of strncpy() when we want the string to be
NUL-terminated.
2008-10-13 22:50:38 +00:00
John Baldwin
b2ce972537 Make the CPU column in top always be 2 characters and print in decimal
rather than hex.

Requested by:	rwatson
2008-10-01 22:01:07 +00:00
Andrey A. Chernov
a3d1e4d95a Since in some cases (when found obsolete) 'make' can be builded earlier
at 'upgrade_checks' target, put arc4random_uniform() into
__FreeBSD_version ifdef.
2008-09-29 16:13:28 +00:00
John Baldwin
338b0cb957 Support for CPU sets is going to appear in 7.1 before 8.0.
MFC after:	3 days
2008-09-29 15:44:48 +00:00
Marius Strobl
69e01db9cb Add back ar(1) which was accidentally decoupled in r183242.
Approved by:	sam
2008-09-24 20:41:35 +00:00
Sam Leffler
690f477d75 add new build knobs and jigger some existing controls to improve
control over the result of buildworld and installworld; this especially
helps packaging systems such as nanobsd

Reviewed by:	various (posted to arch)
MFC after:	1 month
2008-09-21 22:02:26 +00:00
Kai Wang
2529884112 Fix build. 2008-09-21 00:27:16 +00:00
Kai Wang
0c099281a3 Add support for option "-M", which is used to operate ar(1) in a
script mode like the MRI(Microtec Research Inc.) "librarian" program.

Originally this option is provided by Binutils ar(1) to ease the
transition for developers who are used to writing "librarian" scripts.

We added this option to BSD ar(1) because:

1. Further improve the compatibility with Binutils ar(1).
2. There are still a few software using this -M option. (at least one
in our ports collection)

Suggested by:	rink & erwin
2008-09-20 22:10:10 +00:00
Tim Kientzle
8cd2f9bcd0 Clean up flags support just a tad: FreeBSD support depends on
HAVE_STRUCT_STAT_ST_FLAGS, Linux support depends on the
existence of the appropriate ioctl() options.  In particular,
this should fix some nagging compile errors on Linux platforms
that don't have e2fsprogs-devel installed.
2008-09-14 03:49:00 +00:00
Tim Kientzle
1756b590c9 Test handling of restores relative to symlinks.
In particular:
  * tar -x -P follows symlinks to existing dirs, but not without -P
  * symlinks to files are always replaced
  * broken symlinks are always replaced
2008-09-14 02:16:04 +00:00
Stephane E. Potvin
c975a48dee Display the sum of the runtime of all the threads in a process when it's
multithreaded instead of picking the time of the first thread found.

Reviewed by:	jhb
Approved by:	kan (mentor)
MFC after:	1 month
2008-09-12 17:54:50 +00:00
Tim Kientzle
33cbc37d91 Don't destroy the archive until after you finish pulling useful
information out of it.  As reported by Giorgos Keramidas.
2008-09-04 05:20:46 +00:00
Ed Schouten
a583eb0809 Add support for RLIMIT_NPTS to limits(1).
After the MPSAFE TTY import we support an additional rlimit, called
RLIMIT_NPTS. This limit allows you to cap the amount of pseudo-terminals
allocated by one user.

We forgot to add support for this limit to limits(1), which means it
crashed. Add the proper bits to make it work like it should.
Unfortunately not all shells actually implement the RLIMIT, so
unfortunately I suspect it to be broken with certain shells.

Submitted by:	Yuriy Tsibizov <yuriy tsibizov gfk ru>
2008-09-02 19:13:24 +00:00
David E. O'Brien
47490ee583 Add gprof MIPS MD header and enable building gprof.
Obtained from:	Juniper Networks
2008-09-02 15:35:47 +00:00
Kevin Lo
4c6ea66f44 Use RUSAGE_SELF for the current process instead of hardcoded value 2008-09-02 02:59:38 +00:00
David E. O'Brien
668dbd57c1 Truss and gprof doesn't build for MIPS. 2008-09-01 18:03:09 +00:00
Yaroslav Tykhiy
db6fc08364 Correct a silly typo I introduced: withing -> within.
Noticed by:	das
2008-09-01 17:48:40 +00:00
David E. O'Brien
dd335a1577 Minimize changes CURRENT<->releng7. 2008-09-01 15:04:38 +00:00
Yaroslav Tykhiy
21be3b3183 pkill(1) first appeared in /usr/bin, but later it was moved to /bin
for the convenience of rc.d.  Now it has happily lived there for quite
a while.  So move the pkill(1) source files from usr.bin to bin, too.

Approved by:	gad
2008-08-31 14:27:59 +00:00
Rui Paulo
4816ba93ac Add ECN stats. 2008-08-26 15:12:29 +00:00
Tim Kientzle
0f5e12d1d9 MfP4: Verify correct interaction with umask: Add another
file with different permissions and set a non-zero umask
during the actual copy tests.  The extra entry increases
the size of the test archives of course, so adjust the
expected sizes.
2008-08-25 06:39:29 +00:00
Yaroslav Tykhiy
625451f9f4 Explicitly tell that one needs to start a context address with a
backslash if he/she wants to use a non-traditional delimiter, i.e.,
anything other than a slash.  That is, /abc/ works as is, but xabcx
needs to be spelled as \xabcx.

Add appropriate markup.

Bump Dd.

Checked with:	IEEE Std 1003.1, 2004 Edition
MFC after:	3 days
2008-08-24 13:47:53 +00:00
Tim Kientzle
3269dc16fd Update the total archive byte counters when writing entries to disk using
archive_write_disk.
Update cpio to use this to emit block counts in -p mode.
Update cpio tests to verify these block counts.
2008-08-24 06:21:00 +00:00
Tim Kientzle
21353e7f83 straighten out the "clean" target 2008-08-24 05:49:36 +00:00
Tim Kientzle
47317d6e6d cpio -v emits a line for every item copied. 2008-08-24 05:40:42 +00:00
Tim Kientzle
631631e45b Update the passthrough_dotdot test to reproduce a
problem reported by Kris Kennaway.

PR:		bin/124924
2008-08-24 05:24:52 +00:00
Tim Kientzle
ea66e24484 Test for proper handling of "cpio -p .."
PR:		bin/124924
2008-08-24 05:14:03 +00:00
Tim Kientzle
c9c5c49045 Test for a bug reported by Bernd Walter: In passthrough mode,
copying "dir/file" and then copying "dir" results in
"File on disk is not older; skipping" for the "dir" because
it was implicitly created by "dir/file."  Among other sins,
this means that "dir" ends up with the wrong permissions
and ownership.

This is actually a libarchive bug; fix is forthcoming.
2008-08-24 04:58:22 +00:00
Tim Kientzle
5d5624c080 Comment a couple of places where bsdcpio and gcpio 2.9 disagree.
The number of blocks read from ustar archives is just an implementation
difference.  The failure of bsdcpio to emit a block count to stderr
in -p mode is a real bug in bsdcpio.
2008-08-22 02:27:06 +00:00
Tim Kientzle
643cd4ffe7 The newc-format verification is now a little smarter about
following the archive structure.  In particular, it no longer
crashes if you run it against GNU cpio 2.9 (although it does
still complain a lot more than it should).
2008-08-22 02:09:10 +00:00
Tim Kientzle
83cb61fa3a Minor cleanup of the -q test: Assert that stdout/stderr are empty for each
extraction.
2008-08-22 01:35:08 +00:00
Tim Kientzle
ca926f6fbd Don't clean before running tests. 2008-08-22 01:31:13 +00:00
Tim Kientzle
ba1a633912 Explain how the test_option_q test works. 2008-08-22 01:26:55 +00:00
Tim Kientzle
3873424684 Test for -q (aka --fast-read).
Fix the error uncovered by this test.
2008-08-22 01:22:55 +00:00
Tim Kientzle
b1feec2392 The results for test 2 here are short enough to just be included inline.
There's no need to go through the hassle of having a checked-in uuencoded
reference file for comparison.
2008-08-21 22:28:00 +00:00
David E. O'Brien
8acee1c0ca Use the SCHEME_ knobs rather than knowing what they expand to.
Reviewed by:	des
2008-08-21 14:12:34 +00:00
David Malone
7f15c32d76 Lockf was exiting with status 1 if the command did not exit normally.
This is easy to confuse with the actual exit status of the program.
Instead exit with EX_SOFTWARE if the command doesn't exit normally.

MFC after:	1 month
2008-08-21 07:36:17 +00:00
Tim Kientzle
503b743566 Add some more tests to verify that "./foo" matches "foo" but "/foo" does not. 2008-08-21 07:04:57 +00:00
Tim Kientzle
e0e53b4111 Always display the unedited pathname in -t output.
I would like to provide a way to preview the effects of pathname edits,
but pattern selection has to happen against the unedited path, so it
seems that we have to show people the unedited path to help in
designing selection patterns.
2008-08-21 06:41:14 +00:00
Tim Kientzle
630d7662c3 cpio should restore file flags and ACLs when they're available 2008-08-20 16:39:18 +00:00
Andrey A. Chernov
e39ee4216c w(1) uses strftime %b with to print the abbreviated month name
if a user logged in more than a week ago.
This may contain multibyte characters (e.g. when using UTF-8).
This string is then aligned on byte-length rathern than char-length,
resulting in misalignment and unfinished multibyte characters.

PR:             126657
Submitted by:   Johan van Selst <johans@stack.nl>
2008-08-20 12:32:19 +00:00
Ed Schouten
bc093719ca Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

  The old TTY layer has a driver model that is not abstract enough to
  make it friendly to use. A good example is the output path, where the
  device drivers directly access the output buffers. This means that an
  in-kernel PPP implementation must always convert network buffers into
  TTY buffers.

  If a PPP implementation would be built on top of the new TTY layer
  (still needs a hooks layer, though), it would allow the PPP
  implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

  With the old TTY layer, it isn't entirely safe to destroy TTY's from
  the system. This implementation has a two-step destructing design,
  where the driver first abandons the TTY. After all threads have left
  the TTY, the TTY layer calls a routine in the driver, which can be
  used to free resources (unit numbers, etc).

  The pts(4) driver also implements this feature, which means
  posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

  One of the major improvements is the per-TTY mutex, which is expected
  to improve scalability when compared to the old Giant locking.
  Another change is the unbuffered copying to userspace, which is both
  used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from:		//depot/projects/mpsafetty/...
Approved by:		philip (ex-mentor)
Discussed:		on the lists, at BSDCan, at the DevSummit
Sponsored by:		Snow B.V., the Netherlands
dcons(4) fixed by:	kan
2008-08-20 08:31:58 +00:00
Tim Kientzle
b14f19cf97 Better comment the pattern tests; adjust the filenames for the
reference files to match the corresponding source.

MFC after:	3 days
2008-08-20 06:01:53 +00:00
John Baldwin
32c9e3bd01 Use kvm_getcptime(3) to fetch the global CPU time stats from a crashdump
since the 'cp_time' symbol doesn't exist in recent kernels.  This fixes
iostat and vmstat on crash dumps.

MFC after:	1 week
2008-08-19 21:33:09 +00:00
Tim Kientzle
651eea9aa8 Fix SVN r181821 by not using FNM_LEADING_DIR where
it shouldn't be used.
2008-08-18 18:13:40 +00:00
Tim Kientzle
0f4b98311a Strip leading "./" or ".//" from patterns and filenames
so that "./foo" matches "foo" (and vice versa).

This is related to PR bin/119141.

PR:		bin/119141
MFC after:	4 days
2008-08-18 04:58:54 +00:00
Tim Kientzle
ac2dcb729f Don't strip a leading '/' from a pattern to be matched.
This aligns the pattern-matching behavior with GNU tar
and restores the behavior of bsdtar prior to FreeBSD 6.3.

PR:		bin/117909
MFC after:	3 days
2008-08-17 19:43:45 +00:00
David Malone
9c95bc1c1c Add limited support for units that are related by affine rather
than linear relations. We can now convert degC to degF.

586 units, 56 prefixes
You have: 24 degC
You want: degF
	75.2
You have: degC
You want: K
	 (-> x*1 +273.15)
	 (<- y*1 -273.15)
2008-08-16 16:27:41 +00:00
Tim Kientzle
8eccad56d9 Test updates: Handling of patterns on command line, error messages. 2008-08-15 06:12:02 +00:00
Doug Rabson
d458f4629b When generating thread-safe server code, handle procedures with void return
types correctly.
2008-08-12 13:38:06 +00:00
Ed Schouten
1b59478ca5 Delete unused files in the window(1) directory that contain a colon.
During the import of the 4.4BSD Lite sources, four files got added to
the repository called :tt, :tty, :var and :ww. They seem to contain some
kind of debug information. These files aren't used/installed anywhere.

Unfortunately the colons in the filenames prevents us from checking out
the source tree on file systems that don't support colons (such as FAT).
Just remove these unneeded files to keep SVN happy.

Reported by:	Rohit Tripathi <rohit trip gmail com>
MFC after:	3 days
2008-08-09 14:44:04 +00:00
Andrey A. Chernov
68910e7a67 Use arc4random_uniform(3) 2008-08-07 22:22:41 +00:00
Edwin Groothuis
8ad0fbc8a1 - acificfrancexchange -> pacificfrancexchange
- Add comments about the pegged currencies.

Submitted by:	GeJ on #bsdports
2008-08-07 05:35:01 +00:00
Edwin Groothuis
5a97b29aa5 Update the units library file.
- Merge changes from NetBSD and OpenBSD.
- Add the Euro as a primitive unit, add old converted currency and
  pegged currency (Obtained from Wikipedia)
- Rename "dollar" to "usdollar" as primitive unit, remove non-pegged
  currency and add pegged currency (Obtained from Wikipedia)
- Updated the accuracy of a lot of constants (Obtained from Wikipedia)

PR:		bin/106545 bin/88252
Submitted by:	trasz<trasz@pin.if.uz.zgora.pl>, J Vinopal <banshee@abattoir.com>
Approved by:	bde@ (mentor)
MFC after:	1 week
2008-08-07 00:14:56 +00:00
Edwin Groothuis
0d724b8765 Move functions which are only locally used into their C files and
make them static.

usage() in calendar.c
event_*() in io.c

PR:		bin/118644
Approved by:	bde@ (mentor)
2008-08-05 08:16:37 +00:00
Edwin Groothuis
35304a1641 style(9)ify usr.bin/calendar
PR:		bin/118644
Approved by:	bde@ (mentor)
MFC after:	1 week
2008-08-05 08:11:54 +00:00
Colin Percival
80d61a6a48 Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

Reported by:	edwin
2008-08-04 07:36:53 +00:00
Colin Percival
d59e8ae886 Don't close file descriptor number <whatever random garbage was on the
stack>.

Found by:	LLVM/Clang Static Checker
MFC after:	1 week
2008-08-04 06:48:54 +00:00
Colin Percival
5fe69bb518 Setting a variable to the same value twice doesn't actually make it
more likely to have the right value.  Remove superfluous assignments.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:39:52 +00:00
Colin Percival
f9bcf9cabf Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

This commit eliminates 117 false positive bug reports of the form
"allocate memory; error out if pointer is NULL; use pointer".
2008-08-04 01:25:48 +00:00
Xin LI
61328d7a97 Make quota(1) to compile with WARNS=6:
- ANSI'fy showrawquotas().
 - Shut up GCC by initializing bgrace and igrace.  The situation
   that caused the GCC warning can never happen though.
2008-08-04 00:43:49 +00:00
Olivier Houchard
049aa2e813 ctime() expects a time_t, but qup->dqblk.dqb_btime is an int32_t, so for
big endian platforms where time_t is 64bits (ie armeb and sparc64), it will
be a problem.
Use a temporary time_t to work around this.

Submitted by:	Matthew Luckie <mjl AT luckie DOT org dot nz>
MFC after:	3 days
2008-08-03 20:36:40 +00:00
Edwin Groothuis
5f5be9e857 calendar.holiday: Buinea-bissau should be Guinea-Bissau
PR:		conf/126199
Submitted by:	comet--berkeley (aka Pablo Picasso) <comet@transbay.net>
Approved by:	bde@
2008-08-03 09:21:47 +00:00
John Baldwin
52122f3139 A few style and whitespace fixes.
Submitted by:	bde
2008-08-02 12:04:59 +00:00
David Schultz
9d65050e7b POSIX says that octal escapes have the format \ddd in the format string,
but \0ddd in a %b argument, with a length restriction of 3 octal digits
in either case. This seems silly, but it needs to be right so it's possible
to write an octal escape followed by an ordinary digit. Solaris printf(1)
and GNU printf(1) also behave this way.

Example: "printf '\0752'" now produces "=2" instead of garbage.
2008-08-02 06:02:02 +00:00
John Baldwin
e68ed79390 Tweak the support for using ldd on 32-bit objects a bit further.
Specifically, build a 32-bit /usr/bin/ldd32 on amd64 which handles 32-bit
objects.  Since it is a 32-bit binary, it can fork a child process which
can dlopen() a 32-bit shared library.  The current 32-bit support in ldd
can't do this because it does the dlopen() from a 64-bit process.  In order
to preserve an intuitive interface for users, the ldd binary automatically
execs /usr/bin/ldd32 for 32-bit objects.  The end result is that ldd on
amd64 now transparently handles 32-bit shared libraries in addition to
32-bit binaries.

Submitted by:	ps (indirectly)
2008-08-01 21:52:41 +00:00
Dag-Erling Smørgrav
d8984f48cb Try to make this code slightly less painful to read. 2008-07-31 17:15:21 +00:00
Ed Schouten
40e761838e Add POSIX -p flag to make(1).
This article [1] describes the -p flag for make(1):

	Write to standard output the complete set of macro definitions and
	target descriptions. The output format is unspecified.

We already support a similar flag (-d g1), but unlike -p, it still
executes commands. Our implementation just turns it into -d g1, but also
sets flag `printGraphOnly', which will cause make(1) to skip execution.

[1] http://www.opengroup.org/onlinepubs/009695399/utilities/make.html

Reviewed by:	imp
PR:		standards/99960
2008-07-30 21:18:38 +00:00
Tim Kientzle
979b646f30 MfP4: Preserve permissions by default.
In particular, this fixes the oddity that -dumpl would apply
umask to copied dirs (which are created in the target tree)
but not to "copied" files (which are only linked).  After
this change:

$ ls -ld a a/b a/b/c
d--x-w-r--  3 tim  tim  512 Jul 29 20:08 a
drwxr----x  3 tim  tim  512 Jul 29 20:09 a/b
dr----x-w-  2 tim  tim  512 Jul 29 20:09 a/b/c
$ (echo a; echo a/b; echo a/b/c) | cpio -dumpl o
$ cd o
$ ls -ld a a/b a/b/c
d--x-w-r--  3 tim  tim  512 Jul 29 20:08 a
drwxr----x  3 tim  tim  512 Jul 29 20:09 a/b
dr----x-w-  2 tim  tim  512 Jul 29 20:09 a/b/c
2008-07-30 03:35:45 +00:00
Maksim Yevmenkin
f35a20921e Fix build 2008-07-29 21:20:03 +00:00
Maksim Yevmenkin
9b501d5ab1 Fix build 2008-07-29 17:02:00 +00:00
Tim Kientzle
b423c28f74 Add --no-preserve-owner, which seems to be required by some ports.
Thanks to: Erwin Lansing
2008-07-29 15:23:31 +00:00
Edwin Groothuis
bff7135050 Fix text in the comment why we check for ELF32_R_TYPE
Approved by:	bde@
MFC after:	2 days2 days
2008-07-28 12:49:16 +00:00
Ed Schouten
d693ac206e Fix a small typo in the procstat(1) manpage: messsage queue.
Approved by:	philip (mentor)
MFC after:	3 days
2008-07-28 08:01:24 +00:00
Simon L. B. Nielsen
1640935f0b - Fix mtree example so it works.
- Document --version.

Reviewed by:	kientzle
MFC after:	1 week
2008-07-26 17:22:40 +00:00
Philip M. Gollucci
fc2b30de6c Adding myself as a new ports committer
Reviewed by:    gabor (mentor)
Approved by:	araujo (mentor)
2008-07-23 01:37:04 +00:00
Xin LI
bf15662677 Sync with NetBSD's license changes. 2008-07-23 00:03:36 +00:00
Edwin Groothuis
8bd833fff8 After the commit of SVN rev 180236, wilko@ noticed that the approach
doesn't work on the Alpha platform: machine/elf.h doesn't include
sys/elf32.h there.

PR:		related to bin/124906
Approved by:	bde@
MFC after:	1 week
2008-07-21 02:13:14 +00:00
Xin LI
fffc0a1e59 Use %zd for size_t. With this gcore(1) is WARNS=6 clean. 2008-07-18 23:37:05 +00:00
Xin LI
c1613cd50a Indent the else path, reduce diff against OpenBSD. 2008-07-18 23:35:31 +00:00
Kevin Lo
068d36032a Fix a longstanding bug, from Otto Moerbeck:
if we're reducing a rule that has an empty
right hand side and the yacc stackpointer is pointing at the very
end of the allocated stack, we end up accessing the stack out of
bounds by the implicit $$ = $1 action

Obtained from:	OpenBSD
2008-07-18 15:05:14 +00:00
Philippe Charnier
dd99983988 add __unused to succeed at WARNS=6 2008-07-10 13:26:46 +00:00