Commit Graph

9234 Commits

Author SHA1 Message Date
thompsa
67f51fe4b6 Build fixups for the new USB stack. 2009-02-23 18:36:54 +00:00
delphij
aabdbf37d0 Remove unnecessary opt* definations. 2009-02-21 03:53:06 +00:00
delphij
03f1dea526 Define extern **environ in global scope instead of in function. 2009-02-21 03:50:25 +00:00
delphij
c36f13a958 Utilize calloc() instead of bzero'ing manually. 2009-02-21 03:43:20 +00:00
delphij
a9845d8d05 Initialize 'sz' as 0. 2009-02-21 03:42:31 +00:00
delphij
e4bc0b9b5b Utilize strlcpy(). 2009-02-21 03:38:46 +00:00
imp
a95a0aafc4 Include proper header files for system functions that are used and
that gcc complains about this code changing from the built-in
versions.
2009-02-19 20:07:59 +00:00
makc
6d22c34c99 Add myself. 2009-02-19 16:16:44 +00:00
bms
2b08fb6e8b Now that ifmcstat(8) does not suck, retire host-mode netstat -g.
This change will not be back-ported.
2009-02-15 16:16:38 +00:00
imp
ccc13c656b Truss builds on mips, so don't filter it building there anymore. 2009-02-15 01:32:50 +00:00
imp
442a51fa71 Add preliminary support for truss on MIPS. It compiles, but has not
been extensively tested.  And the ELF64 stuff likely is not quite
right...

# There's a lot of cut-n-paste code here that could easily be
# refactored, at least for FreeBSD syscalls.
2009-02-15 01:26:49 +00:00
ed
017f8027a1 Let stat(1) use fdevname(3).
Because we now have a reliable library function that converts file
descriptors to character device names, let stat(1) use this. This means
it can now do the following:

	$ stat -f %N
	/dev/pts/0

I've changed main() to set file properly, so output() is never called
with file set to NULL.

Approved by:	dougb (older version, still used devname)
2009-02-11 20:36:17 +00:00
maxim
2638667ddd o Print an octal representation of suid, sgid and sticky bits with -x flag.
PR:		bin/131569
Submitted by:	Jaakko Heinonen
Reported by:	Yannick Cadin
MFC after:	1 week
2009-02-11 10:50:26 +00:00
kientzle
1885a77c0e Fix multiple -s options.
MFC after:	7 days
2009-02-08 22:04:17 +00:00
kientzle
3bdbf535c0 When copying file data to the archive, don't write more
than was read.  This seems to have only affected the shar
writer, since other formats proactively truncate output
to the originally-advertised size.

PR:		bin/131244
MFC after:	7 days
2009-02-08 22:02:46 +00:00
emax
ebea9bff1d Clenup code a bit and do not call fork(2) before dameon(3) where not needed.
MFC after:	1 month
2009-02-04 22:04:06 +00:00
obrien
86d5fdbc4b Partially revert r186559. 2009-02-03 15:27:29 +00:00
rwatson
0239a09bb6 Alow dirname(1) to accept multiple arguments in the same way that
basename(1) does.

(Two different PRs contained identical patches, both cited below)

PR:		121520, 86148
Submitted by:	Ighighi <ighighi at gmail dot com>
Submitted by:	Leif Neland <leif at neland dot dk>
MFC after:	3 days
2009-02-02 11:19:56 +00:00
fjoe
3a68abc6f4 Remove duplicate OPTFLAGS definition. 2009-02-02 06:25:57 +00:00
imp
414d2060bb Sort the options, per style(9).
Reviewed by:	obrien@
2009-02-02 02:05:58 +00:00
alfred
cbd30dee28 src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h

Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.

Reported and tested by:

Daichi GOTO and Masanori OZAWA.

src/sys/dev/usb2/core/usb2_process.c

Correct USB process names.

Reported by:

Andre Guibert de Bruet

src/sys/dev/usb2/serial/uftdi2.c

Integrate changes from old USB stack.

Submitted by:	hps
2009-02-02 00:49:39 +00:00
bz
5d8f0a53a7 Remove the single global unlocked route cache ip6_forward_rt
from the inet6 stack along with statistics and make sure we
properly free the rt in all cases.

While the current situation is not better performance wise it
prevents panics seen more often these days.
After more inet6 and ipsec cleanup we should be able to improve
the situation again passing the rt to ip6_forward directly.

Leave the ip6_forward_rt entry in struct vinet6 but mark it
for removal.

PR:		kern/128247, kern/131038
MFC after:	25 days
Committed from:	Bugathon #6
Tested by:	Denis Ahrens <denis@h3q.com> (different initial version)
2009-02-01 21:11:08 +00:00
imp
9333293735 David doesn't consider the prior -s behavior a bug. Back out this
change.
2009-01-31 23:17:33 +00:00
imp
0bdc05bc53 Unbreak make -s. There's about a 10% performance improvement with -s
in many environments.  The recent --- blah --- reintroduction has
killed.  That output makes almost no sense when all the other output
is silenced.
2009-01-30 16:12:32 +00:00
des
62cee65dbe Make sure the entries don't run into each other when they're longer than
the allotted space.

PR:		bin/129318
Submitted by:	Ighighi <ighighi@gmail.com>
MFC after:	3 weeks
2009-01-30 14:28:50 +00:00
trhodes
855f844ab0 When "-b" is specified, one could easily create "smaller" files
that are much larger than expected (given the default size).
Change "smaller files" to "split files" which is more in line
with what "-b" actually does.

PR:		119329
Submitted by:	Julian Stacey <jhs@berklix.org>
2009-01-24 05:32:11 +00:00
trhodes
9e3e63a72b Attaching to the init process returns EINVAL,
so give an example that is more likely to work.
Stolen from the ktrace(1) manual page.

PR:		128222
Submitted by:	Mateusz Guzik <mjguzik@gmail.com>
2009-01-23 00:58:14 +00:00
rdivacky
22410c51db Remove inlining of functions that are used mostly in different object files.
This gets rid of gnu89 style inlining. Also silence gcc by assigning two
variables NULL. This lets use to remove NO_WERROR.

Approved by:	kib (mentor)
Approved by:	harti
2009-01-20 17:15:12 +00:00
des
52e26e275d The FTP_TIMEOUT and HTTP_TIMEOUT environment variables were ignored because
T_secs already had a non-zero default.  Unbreak by moving the default to
ftp_timeout / http_timeout.

Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
MFC after:	2 weeks
2009-01-17 13:34:56 +00:00
ed
0de38335a4 Rename mail(1)'s aux.c to util.c.
The name `aux' is reserved on Windows file systems. aux.c in the mail(1)
directory contains some random utility functions. I'm renaming this file
to util.c to make it possible to check out this directory on Windows.

MFC after:	1 month
2009-01-16 15:00:30 +00:00
maxim
7abddeaa68 o Respect -ss flags (suppress zero counters) for icmp6 "histogram
of error messages" section.

Submitted by:	naddy
MFC after:	1 week
2009-01-13 07:58:57 +00:00
obrien
9b3fbd4704 Don't enable -Q by default - I've fixed the rescue build issue. 2009-01-13 06:53:53 +00:00
obrien
90add981c7 If running with "-K" really do not information about symbols from the a.out
argument.  Before this fix, after searching the currently-running kernel,
we would still search the a.out argument - completely override the in-kernel
list, essentially defeating the K flag's purpose.

PR:		47387
Submitted by:	Ryan Beasley <ryanb@goddamnbastard.org>
2009-01-12 21:49:42 +00:00
ru
f6fb926c38 Fix usage() with SYNOPSIS. 2009-01-10 22:49:02 +00:00
ru
9bc17fdeb6 Fix markup and spelling. 2009-01-10 22:48:12 +00:00
trhodes
00acc9b7ae A bit of rewording for clarity, taken from OpenBSD.
Submitted by:	jmc@OpenBSD.org
2009-01-10 12:47:22 +00:00
ru
bc0785459c Fix crash with "netstat -m -N foo".
PR:		bin/124724
MFC after:	3 days
2009-01-10 12:39:12 +00:00
obrien
2fd77860b9 Note that r186713 also contained a change to VarAdd where we propagate the
newly created 'Var' back to the caller.
Also, back out an accidentally commented WIP comment.
2009-01-06 16:24:22 +00:00
lulf
62eb8b9f1f 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
obrien
a3f555f083 + 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
obrien
87d6fde760 Flatten the file vendor area.
Remove the svn:keywords property from the vendor files.
2009-01-01 05:39:43 +00:00
maxim
21750937a7 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
rwatson
80663b9001 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
rwatson
5d4fcd09b3 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
obrien
489c6b7af5 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
obrien
5d8be9f4c7 Consistently use Var_SetGlobal(). 2008-12-29 08:05:49 +00:00
trhodes
a83406ae2e 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
a371cf7a49 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
rpaulo
53844c4850 Right align the CPU column header. 2008-12-26 11:11:30 +00:00
maxim
ea7e9a42ea o Fix grammar.
PR:		bin/129938
Submitted by:	Bruce Cran
2008-12-26 07:16:20 +00:00
trhodes
fb811d854f Remove reference to unimplemented "-c" option.
PR:		119338
2008-12-25 08:48:08 +00:00
trhodes
53d890b734 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
dougb
29da7fd3fd Update bmake glue for changes in 9.4.3 2008-12-23 22:51:10 +00:00
trhodes
bf71acb2ec Add a basic manual page for elf2aout.
Alter Makefile and remove NO_MAN.

PR:	109975
2008-12-23 01:22:57 +00:00
wollman
3dff28c944 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
wxs
3960ad7fe4 Fix a typo.
Approved by:	rwatson
2008-12-19 16:56:49 +00:00
marcus
0abe5b951a 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
fjoe
95c5b12c17 Exit with error code 2 when run with -k (continue if errors) and build failed. 2008-12-18 12:16:51 +00:00
murray
a12379d1b7 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
> Description of fields to fill in above:                     76 columns --|
> PR:            If a GNATS PR is affected by the change.
> Submitted by:  If someone else sent in the change.
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

M    usr.bin/fetch/fetch.c
M    lib/libfetch/fetch.c
2008-12-17 18:00:18 +00:00
ru
1283f09c3e Fix printing of shared memory limits.
MFC after:	3 days
2008-12-16 09:17:05 +00:00
murray
72a890ccd7 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
qingli
ec826ad5c7 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
kientzle
664c3aeb01 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
ru
29bd0877a3 Improve usage and sync SYNOPSIS with usage. 2008-12-13 17:48:06 +00:00
ru
f9772ed407 Sync manpage's synopsis with program's usage().
Trim whitespace at EOL.
2008-12-13 15:44:29 +00:00
des
a5ecf5f20c 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
kib
2e6f1edb43 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
keramida
e50dcd2922 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
kientzle
73b5159ecd bsdtar is synced up with 2.5.903a 2008-12-06 07:38:14 +00:00
kientzle
a57587d2f5 bsdtar always supports long options now, so we can remove
a documentation disclaimer.
2008-12-06 07:37:55 +00:00
kientzle
48226e3cb7 Only use GCC-specific __dead2 marker when building with GCC. 2008-12-06 07:37:14 +00:00
kientzle
220fc96fce 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
kientzle
ab919ab0a2 Make the GCC-specific __dead2 markers conditional on whether
we're compiling under GCC.
2008-12-06 07:15:42 +00:00
peter
e8960dfc4c Update format string for kve_start/end. 2008-12-02 15:08:33 +00:00
peter
76037b082e 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
peter
6c7a0d64c9 Use libutil wrapper for kinfo_get{file|vmmap}() 2008-12-01 01:45:52 +00:00
kientzle
bb05e1a003 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
kientzle
3a229bf1d0 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
bz
d2730d5b27 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
gnn
b66b1bfcdd 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
kientzle
79862beef3 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
kientzle
cfaf87c8f3 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
lulf
12b41ef604 - Add missing rsyncfile from Makefile 2008-11-23 19:43:45 +00:00
delphij
852f970889 Use strlcpy() where appropriate. 2008-11-19 00:14:15 +00:00
rdivacky
f71006748d ANSIfy the wwend function.
Approved by:	kib (mentor)
2008-11-18 21:06:49 +00:00
pho
529c4f245c Add myself
Approved by:	kib (mentor)
2008-11-18 14:05:11 +00:00
pjd
bbe899b96e 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
dds
83407db259 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
kientzle
34001f8d26 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
kientzle
19a4817b26 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
hrs
9fe9cedf42 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
kientzle
c1676b587b 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
mlaier
df30d890f6 Restore (intmax_t) casts I lost during the last change & unbreak the build. 2008-11-06 23:55:28 +00:00
mlaier
1d778ddbeb 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
rodrigc
a3c4aa0bb3 Merge latest DTrace changes from Perforce.
Approved by:	jb
2008-11-05 19:39:37 +00:00
kientzle
b52c677498 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
kientzle
17a8787cc8 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
mlaier
ce3123c324 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
mlaier
da7287b624 style(9): mostly avoiding line wrap by not indenting cases. No obj change. 2008-11-04 19:17:32 +00:00
keramida
a29fd74e21 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
keramida
551b80b676 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
lulf
811088f018 - Import csup work from p4. 2008-10-19 09:08:59 +00:00
lulf
150ad2c538 - Import the Makefile from HEAD for building csup. 2008-10-19 08:43:16 +00:00
lulf
cf5320822f - Import the HEAD csup code which is the basis for the cvsmode work. 2008-10-19 08:41:10 +00:00
delphij
cbecb62bfe Use strlcpy() when we mean it. 2008-10-17 21:14:50 +00:00
phk
3c06fc1b16 Free old arrays if we increase them.
Pointed out by:	mlaier
2008-10-16 20:56:09 +00:00
phk
e0d6bb5c82 Make ministat(1) vastly faster on huge datasets. 2008-10-16 20:39:02 +00:00
delphij
c4910a5368 ANSIfy, plus constify interfaces where possible. 2008-10-13 23:10:19 +00:00
delphij
ce7f7a7323 Use strlcpy() instead of strncpy() when we want the string to be
NUL-terminated.
2008-10-13 22:50:38 +00:00
jhb
17415143e3 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
ache
536d05c2a2 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
jhb
5ccde8cd26 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
7b7a9406b0 Add back ar(1) which was accidentally decoupled in r183242.
Approved by:	sam
2008-09-24 20:41:35 +00:00
sam
9c3d2ffcdf 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
kaiw
b30990deb3 Fix build. 2008-09-21 00:27:16 +00:00
kaiw
96088079e9 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
kientzle
a1df7e8332 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
kientzle
6d859ef6a5 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
sepotvin
a3a31596e0 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
kientzle
4f41107447 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
5f23a3b5ca 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
obrien
3406a9a37d Add gprof MIPS MD header and enable building gprof.
Obtained from:	Juniper Networks
2008-09-02 15:35:47 +00:00
kevlo
3fe0cc5a82 Use RUSAGE_SELF for the current process instead of hardcoded value 2008-09-02 02:59:38 +00:00
obrien
69573b0e0c Truss and gprof doesn't build for MIPS. 2008-09-01 18:03:09 +00:00
yar
f379ac81c2 Correct a silly typo I introduced: withing -> within.
Noticed by:	das
2008-09-01 17:48:40 +00:00
obrien
5dc67fc4b3 Minimize changes CURRENT<->releng7. 2008-09-01 15:04:38 +00:00
yar
f8df6b10b3 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
rpaulo
08e8549c49 Add ECN stats. 2008-08-26 15:12:29 +00:00
kientzle
ecf8b9b5bd 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
yar
97a6c454a4 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
kientzle
0563028aef 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
kientzle
d35834e169 straighten out the "clean" target 2008-08-24 05:49:36 +00:00
kientzle
2ba5121e5d cpio -v emits a line for every item copied. 2008-08-24 05:40:42 +00:00
kientzle
e1a151cc51 Update the passthrough_dotdot test to reproduce a
problem reported by Kris Kennaway.

PR:		bin/124924
2008-08-24 05:24:52 +00:00
kientzle
7fa5a7249f Test for proper handling of "cpio -p .."
PR:		bin/124924
2008-08-24 05:14:03 +00:00
kientzle
96d726228a 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
kientzle
23c403cbda 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
kientzle
6ab64e14fc 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
kientzle
1168b06701 Minor cleanup of the -q test: Assert that stdout/stderr are empty for each
extraction.
2008-08-22 01:35:08 +00:00
kientzle
0b3866b2b4 Don't clean before running tests. 2008-08-22 01:31:13 +00:00
kientzle
44b73660ee Explain how the test_option_q test works. 2008-08-22 01:26:55 +00:00
kientzle
dff2aaea3a Test for -q (aka --fast-read).
Fix the error uncovered by this test.
2008-08-22 01:22:55 +00:00
kientzle
a348ba0da6 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
obrien
4dd155254a Use the SCHEME_ knobs rather than knowing what they expand to.
Reviewed by:	des
2008-08-21 14:12:34 +00:00
dwmalone
6df81d1188 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
kientzle
aeb6db0092 Add some more tests to verify that "./foo" matches "foo" but "/foo" does not. 2008-08-21 07:04:57 +00:00
kientzle
b25650cc12 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
kientzle
a37514cff9 cpio should restore file flags and ACLs when they're available 2008-08-20 16:39:18 +00:00
ache
0808a9f291 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
cc3116a938 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