summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Update format string for kve_start/end.peter2008-12-021-2/+3
|
* Merge user/peter/kinfo branch as of r185547 into head.peter2008-12-023-64/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Use libutil wrapper for kinfo_get{file|vmmap}()peter2008-12-013-64/+16
| |
* | Format the output of -itv for real. In particular:kientzle2008-11-293-13/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | When deciding which characters (of a filename, for instance)kientzle2008-11-292-49/+119
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | MFp4:bz2008-11-292-13/+23
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a printing problem when using the -L flag to netstat causedgnn2008-11-281-13/+16
| | | | | | | by adding the -x flag earlier. Submitted by: Anton Yuzhaninov MFC after: 3 days
* After visiting a subdirectory, we use chdir("..") orkientzle2008-11-273-19/+57
| | | | | | | | | | 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
* If we're unable to chdir() to a directory that we know exists,kientzle2008-11-271-1/+3
| | | | | | | | | | 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
* Use strlcpy() where appropriate.delphij2008-11-191-4/+2
|
* ANSIfy the wwend function.rdivacky2008-11-181-1/+2
| | | | Approved by: kib (mentor)
* Add myselfpho2008-11-181-0/+1
| | | | Approved by: kib (mentor)
* Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.pjd2008-11-171-35/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix the code to conform to the "or more" part of the following POSIXdds2008-11-111-1/+1
| | | | | | | | | | 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
* Include more detailed explanation of this case, since it's prettykientzle2008-11-101-5/+34
| | | | | | | | | | | | | | | 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
* Test --strip-components and fix it to actually work. Jaakko did akientzle2008-11-103-16/+116
| | | | | | | | | | | | | | | 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
* Add workaround for a back reference when no correspondinghrs2008-11-091-0/+8
| | | | | | | | | | | 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
* New command-line parser for bsdtar.kientzle2008-11-086-356/+455
| | | | | | | | | | 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
* Restore (intmax_t) casts I lost during the last change & unbreak the build.mlaier2008-11-061-4/+6
|
* Add two new options to du(1):mlaier2008-11-062-35/+85
| | | | | | | | | | | | | | | | | | | | | | -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@
* Merge latest DTrace changes from Perforce.rodrigc2008-11-051-0/+1
| | | | Approved by: jb
* When comparing, cast to the larger size, off_t in this case.kientzle2008-11-051-1/+1
| | | | | | | Once we know which one is smaller, then we cast to the smaller size. Thanks to Xin Li (delphij@) Pointy hat: /me
* Fix compile warnings building on amd64. This is modified slightlykientzle2008-11-051-4/+5
| | | | | | | | | | 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
* Declare functions and variables static and save a few byte. This is amlaier2008-11-041-9/+9
| | | | style(9)-change, too. Separate commit as it changes the object.
* style(9): mostly avoiding line wrap by not indenting cases. No obj change.mlaier2008-11-041-114/+121
|
* Fix comment typo that managed to sneak in when I copy pasted somekeramida2008-11-041-1/+1
| | | | comments & code from iostat.
* Repeat vmstat header after window.rows instead of a hardcoded 20.keramida2008-11-041-9/+69
| | | | | | | | | | | | 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
* Use strlcpy() when we mean it.delphij2008-10-172-6/+3
|
* Free old arrays if we increase them.phk2008-10-161-0/+1
| | | | Pointed out by: mlaier
* Make ministat(1) vastly faster on huge datasets.phk2008-10-162-51/+36
|
* ANSIfy, plus constify interfaces where possible.delphij2008-10-134-115/+50
|
* Use strlcpy() instead of strncpy() when we want the string to bedelphij2008-10-131-3/+2
| | | | NUL-terminated.
* Make the CPU column in top always be 2 characters and print in decimaljhb2008-10-011-3/+3
| | | | | | rather than hex. Requested by: rwatson
* Since in some cases (when found obsolete) 'make' can be builded earlierache2008-09-291-1/+6
| | | | | at 'upgrade_checks' target, put arc4random_uniform() into __FreeBSD_version ifdef.
* Support for CPU sets is going to appear in 7.1 before 8.0.jhb2008-09-291-1/+1
| | | | MFC after: 3 days
* Add back ar(1) which was accidentally decoupled in r183242.marius2008-09-241-0/+1
| | | | Approved by: sam
* add new build knobs and jigger some existing controls to improvesam2008-09-214-32/+95
| | | | | | | | 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
* Fix build.kaiw2008-09-211-0/+2
|
* Add support for option "-M", which is used to operate ar(1) in akaiw2008-09-206-47/+864
| | | | | | | | | | | | | | | 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
* Clean up flags support just a tad: FreeBSD support depends onkientzle2008-09-142-28/+30
| | | | | | | 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.
* Test handling of restores relative to symlinks.kientzle2008-09-142-0/+173
| | | | | | | 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
* Display the sum of the runtime of all the threads in a process when it'ssepotvin2008-09-121-0/+1
| | | | | | | | multithreaded instead of picking the time of the first thread found. Reviewed by: jhb Approved by: kan (mentor) MFC after: 1 month
* Don't destroy the archive until after you finish pulling usefulkientzle2008-09-041-1/+1
| | | | information out of it. As reported by Giorgos Keramidas.
* Add support for RLIMIT_NPTS to limits(1).ed2008-09-022-54/+68
| | | | | | | | | | | | | 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>
* Add gprof MIPS MD header and enable building gprof.obrien2008-09-022-2/+46
| | | | Obtained from: Juniper Networks
* Use RUSAGE_SELF for the current process instead of hardcoded valuekevlo2008-09-021-1/+1
|
* Truss and gprof doesn't build for MIPS.obrien2008-09-011-1/+3
|
* Correct a silly typo I introduced: withing -> within.yar2008-09-011-1/+1
| | | | Noticed by: das
* Minimize changes CURRENT<->releng7.obrien2008-09-014-9/+8
|
* pkill(1) first appeared in /usr/bin, but later it was moved to /binyar2008-08-314-1064/+0
| | | | | | | 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
OpenPOWER on IntegriCloud