aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add an ENVIRONMENT section to note that the RSH variable can be set toMurray Stokely2008-12-141-0/+7
| | | | | | | | | | | override the use of the rsh(1) program in rcmd(3). PR: docs/51133 Obtained from: NetBSD, partially MFC after: 3 weeks Notes: svn path=/head/; revision=186095
* Merge the resolver part of BIND 9.4.3 into HEAD.Hajimu UMEMOTO2008-12-147-28/+182
| | | | | | | | | | | | | It includes the following fix: 2426. [bug] libbind: inet_net_pton() can sometimes return the wrong value if excessively large netmasks are supplied. [RT #18512] Reported by: Maksymilian Arciemowicz <cxib__at__securityreason.com> Notes: svn path=/head/; revision=186090
* Consolidate some variable initializations. No substantive change.David Schultz2008-12-112-13/+13
| | | | Notes: svn path=/head/; revision=185904
* Move the xprintf hook to where it belongs; it shouldn't be in theDavid Schultz2008-12-101-6/+4
| | | | | | | middle of vfprintf's variable declarations. Notes: svn path=/head/; revision=185825
* o Use full month name in .Dd macro.Maxim Konovalov2008-12-091-1/+1
| | | | Notes: svn path=/head/; revision=185789
* Add strndup(3) prototype to string.h.Konstantin Belousov2008-12-082-2/+2
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=185777
* Obey the TMPDIR, TMP, TEMP, or TEMPDIR environment variablesTim Kientzle2008-12-081-1/+14
| | | | | | | | when choosing a scratch directory for the tests. Fallback to "/tmp", of course. Notes: svn path=/head/; revision=185771
* Document processor errata that affect performance measurement.Joseph Koshy2008-12-081-0/+52
| | | | Notes: svn path=/head/; revision=185763
* Add filler man pages for the kinfo functions I added recently.Peter Wemm2008-12-073-1/+149
| | | | | | | While here, hook up the hexdump(3) man page which wasn't being installed. Notes: svn path=/head/; revision=185729
* When libthr and rtld start up, there are a number of magic spells castPeter Wemm2008-12-071-1/+1
| | | | | | | | | | | | | | | | | in order to get the symbol binding state "just so". This is to allow locking to be activated and not run into recursion problems later. However, one of the magic bits involves an explicit call to _umtx_op() to force symbol resolution. It does a wakeup operation on a fake, uninitialized (ie: random contents) umtx. Since libthr isn't active, this is harmless. Nothing can match the random wakeup. However, valgrind finds this and is not amused. Normally I'd just write a suppression record for it, but the idea of passing random args to syscalls (on purpose) just doesn't feel right. Notes: svn path=/head/; revision=185728
* Import the strndup(3) function.Konstantin Belousov2008-12-064-3/+75
| | | | | | | | | | | Copyright attribution is kept the same as in original NetBSD source. Submitted by: Florian Smeets <flo kasimir com> Obtained from: NetBSD MFC after: 2 weeks Notes: svn path=/head/; revision=185690
* Order the str*.c files mostly alphabetical.Konstantin Belousov2008-12-061-3/+3
| | | | | | | | Submitted by: Florian Smeets <flo kasimir com> MFC after: 2 weeks Notes: svn path=/head/; revision=185689
* New tests:Tim Kientzle2008-12-069-0/+27367
| | | | | | | | | | | | | | | * support for bzip2 file with multiple concatenated bzip2 streams * support for bzip2 file with junk after bzip2 stream * support for gzip file with junk after gzip stream * "fuzz" tester randomly modifies a bunch of input files in order to try to crash libarchive (this found an amusing hang in the ISO9660 code when trying to read images that advertised a zero blocksize). This test is implemented, but commented out for now: * support for gzip file with multiple concatenated gzip streams Notes: svn path=/head/; revision=185683
* Strip ";1" and trailing "." from ISO9660 entries.Tim Kientzle2008-12-061-12/+21
| | | | | | | This seems a better match for people's expectations. Notes: svn path=/head/; revision=185682
* General improvements to Rockridge parsing and ISO9660 format detection.Tim Kientzle2008-12-061-156/+354
| | | | Notes: svn path=/head/; revision=185681
* Conditionalize a bunch of debugging messages; this alsoTim Kientzle2008-12-061-1/+10
| | | | | | | eliminates what should be the only remaining stdio dependency. Notes: svn path=/head/; revision=185680
* MfP4: Big read filter refactoring.Tim Kientzle2008-12-0615-1550/+1427
| | | | | | | | | | | | | | | | | | | | | | | | | | This is an attempt to eliminate a lot of redundant code from the read ("decompression") filters by changing them to juggle arbitrary-sized blocks and consolidate reblocking code at a single point in archive_read.c. Along the way, I've changed the internal read/consume API used by the format handlers to a slightly different style originally suggested by des@. It does seem to simplify a lot of common cases. The most dramatic change is, of course, to archive_read_support_compression_none(), which has just evaporated into a no-op as the blocking code this used to hold has all been moved up a level. There's at least one more big round of refactoring yet to come before the individual filters are as straightforward as I think they should be... Notes: svn path=/head/; revision=185679
* Style: tabs after #defineTim Kientzle2008-12-061-2/+2
| | | | Notes: svn path=/head/; revision=185678
* Use GCC-specific dead function markers only when using GCC.Tim Kientzle2008-12-061-1/+8
| | | | Notes: svn path=/head/; revision=185677
* Structure declarations can't be dllexported.Tim Kientzle2008-12-061-1/+1
| | | | Notes: svn path=/head/; revision=185676
* Style fixes:Tim Kientzle2008-12-061-29/+71
| | | | | | | | | | | | | | | | | * Wrap long declarations to fit 80 chars * #undef macros that shouldn't be exported * Organize the version-dependent conditionals a bit more consistently Speculative: * libarchive 3.0 will (eventually) use int64_t instead of off_t. This is an attempt to avoid some the headaches caused by Linux LFS. (I'll still have to do ugly things for the struct stat references in archive_entry.h, of course.) Notes: svn path=/head/; revision=185675
* A couple of portability fixes from Joerg SonnenbergerTim Kientzle2008-12-061-8/+8
| | | | Notes: svn path=/head/; revision=185674
* Recover after test failure.Tim Kientzle2008-12-061-1/+4
| | | | Notes: svn path=/head/; revision=185672
* Style: skipping() function correctly counts this as a skipped test.Tim Kientzle2008-12-061-1/+1
| | | | Notes: svn path=/head/; revision=185671
* Style improvements.Tim Kientzle2008-12-061-4/+6
| | | | Notes: svn path=/head/; revision=185670
* Better reporting of test failures.Tim Kientzle2008-12-061-4/+10
| | | | Notes: svn path=/head/; revision=185669
* Recover from a test failure here.Tim Kientzle2008-12-061-1/+4
| | | | Notes: svn path=/head/; revision=185668
* New internal archive_string_concat utility function.Tim Kientzle2008-12-062-0/+18
| | | | Notes: svn path=/head/; revision=185667
* Minor portability: Declare 'r' only within the conditionalTim Kientzle2008-12-061-2/+2
| | | | | | | block where it's used; S_ISLNK is more portable than S_ISLINK. Notes: svn path=/head/; revision=185666
* Windows build now uses PLATFORM_CONFIG_H macro, so we can eliminate theTim Kientzle2008-12-061-4/+1
| | | | | | | special case for it. Notes: svn path=/head/; revision=185665
* 2 is more portable than STDERR_FILENOTim Kientzle2008-12-061-1/+1
| | | | Notes: svn path=/head/; revision=185664
* Some libstand/bootp.c extension (written by Danny Braniss, slightlyLuigi Rizzo2008-12-051-0/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | revised/modified by me) to store dhcp options into kenv variables, so the information is available to the boot loader and can be used to customize the boot process. The change is totally unintrusive, essentially made of a single function to be called while parsing a dhcp response, and a couple of tables to classify options. The values extracted from dhcp options are stored in the kenv environment in one of these forms: + options whose name and type is known are saved as dhcp.name = value (string, or number/ip addresses lists) + unknown options are assumed to be strings and saved as dhcp.option-NNN = "value" + options listed as '__INDIR' and sent on the wire as e.g. option unknown-252 "some.name=the actual value" are saved as some.name = "the actual value" + options listed as '__ILIST' and sent on the wire as e.g. option unknown-249 "a.b=foo bar; c.d= 123; e.f=done" are saved as multiple values a.b="foo bar" c.d="123" e.f="done" As you can see there is quite a bit of flexibility on what can be passed to the loader or the kernel. For the time being the vendor-specific table is mostly disabled, because there is no standard set of options for FreeBSD, and I don't know all the pxe-specific vendor options. Also, applications using libstand may live in memory-constrained environments, so it makes sense to keep these tables as small as possible, especially considering that one can generate arbitrary name=value pairs using site-specific options of type __INDIR or __ILIST (there are 4 __ILIST and 5 __INDIR in the table, numbered 246..249 and 250..254). Actually, considering that probably 75% of the standard dhcp options are totally useless, it might make sense to remove them as well. Submitted by: Danny Braniss MFC after: 4 weeks Notes: svn path=/head/; revision=185643
* Add an easier example.Pawel Jakub Dawidek2008-12-051-1/+16
| | | | | | | Reviewed by: trasz Notes: svn path=/head/; revision=185641
* Fixes for Core2 Extreme support.Joseph Koshy2008-12-031-1/+5
| | | | | | | Submitted by: "Artem Belevich" <artemb at gmail dot com> Notes: svn path=/head/; revision=185585
* Make the "test" target test the compiled version, instead of thePoul-Henning Kamp2008-12-021-7/+7
| | | | | | | installed version of the md library. Notes: svn path=/head/; revision=185568
* Provide custom simple allocator for rtld locks in libthr. The allocatorKonstantin Belousov2008-12-022-24/+24
| | | | | | | | | | | | does not use any external symbols, thus avoiding possible recursion into rtld to resolve symbols, when called. Reviewed by: kan, davidxu Tested by: rink MFC after: 1 month Notes: svn path=/head/; revision=185558
* Attempt a quick bandaid for arm build breakage. I went to the trouble ofPeter Wemm2008-12-022-4/+4
| | | | | | | maintaining alignment, but I'm not sure how to tell gcc this. Notes: svn path=/head/; revision=185553
* Merge user/peter/kinfo branch as of r185547 into head.Peter Wemm2008-12-024-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=185548
* Invoke _rtld_atfork_post earlier, before we reinitialize rtld locksAlexander Kabaev2008-12-011-3/+4
| | | | | | | | | | | | | | | by switching into single-thread mode. libthr ignores broken use of lock bitmaps used by default rtld locking implementation, this in turn turns lock handoff in _rtld_thread_init into NOP. This in turn makes child processes of forked multi-threaded programs to run with _thr_signal_block still in effect, with most signals blocked. Reported by: phk, kib Notes: svn path=/head/; revision=185531
* The times(3) function returns the number of CLK_TCKs since theGiorgos Keramidas2008-12-011-4/+9
| | | | | | | | | | | startup time of FreeBSD, not since the UNIX Epoch. PR: docs/122359 Submitted by: Viktor &#352;tujber MFC after: 1 week Notes: svn path=/head/; revision=185519
* Fix fread() to return a correct value on platforms where sizeof(int) !=Ruslan Ermilov2008-12-011-1/+1
| | | | | | | | | | sizeof(size_t), i.e. on all 64-bit platforms. Reported by: Andrey V. Elsukov MFC after: 3 days Notes: svn path=/head/; revision=185516
* Fix a lock order reversal bug that could cause deadlock during fork(2).Jason Evans2008-12-011-11/+37
| | | | | | | Reported by: kib Notes: svn path=/head/; revision=185514
* It's silly to claim recv(2) is to be removed in favour of recvfrom(2)Ivan Voras2008-11-301-1/+0
| | | | | | | | | (at least at this time :) ). Approved by: gnn (mentor) Notes: svn path=/head/; revision=185489
* Adjust an assertion to handle the case where a lock is contested, butJason Evans2008-11-301-1/+1
| | | | | | | | | spinning is avoided due to running on a single-CPU system. Reported by: stefanf Notes: svn path=/head/; revision=185483
* Do not spin when trying to lock on a single-CPU system.Jason Evans2008-11-301-11/+13
| | | | | | | Reported by: davidxu Notes: svn path=/head/; revision=185468
* Unlock the malloc() locks in the child process after fork(). This givesKonstantin Belousov2008-11-291-0/+1
| | | | | | | | | | | | | | | | us working malloc in the fork child of the multithreaded process. Although POSIX requires that only async-signal safe functions shall be operable after fork in multithreaded process, not having malloc lower the quality of our implementation. Tested by: rink Discussed with: kan, davidxu Reviewed by: kan MFC after: 1 month Notes: svn path=/head/; revision=185456
* MFp4:Bjoern A. Zeeb2008-11-293-11/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=185435
* Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post.Konstantin Belousov2008-11-273-1/+24
| | | | | | | | | | | | | | | | | Threading library calls _pre before the fork, allowing the rtld to lock itself to ensure that other threads of the process are out of dynamic linker. _post releases the locks. This allows the rtld to have consistent state in the child. Although child may legitimately call only async-safe functions, the call may need plt relocation resolution, and this requires working rtld. Reported and debugging help by: rink Reviewed by: kan, davidxu MFC after: 1 month (anyway, not before 7.1 is out) Notes: svn path=/head/; revision=185369
* Update description of an event.Joseph Koshy2008-11-271-2/+1
| | | | | | | Submitted by: "Verplanke, Edwin" <edwin dot verplanke at intel dot com> Notes: svn path=/head/; revision=185364
* - Add support for PMCs in Intel CPUs of Family 6, model 0xE (Core SoloJoseph Koshy2008-11-273-37/+447
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and Core Duo), models 0xF (Core2), model 0x17 (Core2Extreme) and model 0x1C (Atom). In these CPUs, the actual numbers, kinds and widths of PMCs present need to queried at run time. Support for specific "architectural" events also needs to be queried at run time. Model 0xE CPUs support programmable PMCs, subsequent CPUs additionally support "fixed-function" counters. - Use event names that are close to vendor documentation, taking in account that: - events with identical semantics on two or more CPUs in this family can have differing names in vendor documentation, - identical vendor event names may map to differing events across CPUs, - each type of CPU supports a different subset of measurable events. Fixed-function and programmable counters both use the same vendor names for events. The use of a class name prefix ("iaf-" or "iap-" respectively) permits these to be distinguished. - In libpmc, refactor pmc_name_of_event() into a public interface and an internal helper function, for use by log handling code. - Minor code tweaks: staticize a global, freshen a few comments. Tested by: gnn Notes: svn path=/head/; revision=185363