summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't check has_waiters twice, inline some small functions.davidxu2010-01-051-8/+5
| | | | | | performance result on my machine: mutex Elapsed: 902115 us; per iteration: 90 ns. semaphore Elapsed: 958780 us; per iteration: 95 ns.
* Use umtx to implement process sharable semaphore, to make this work,davidxu2010-01-0512-311/+854
| | | | | | | | | | | | | | | | | | | | | | now type sema_t is a structure which can be put in a shared memory area, and multiple processes can operate it concurrently. User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open() to initialize a shared semaphore. Named semaphore uses file system and is located in /tmp directory, and its file name is prefixed with 'SEMD', so now it is chroot or jail friendly. In simplist cases, both for named and un-named semaphore, userland code does not have to enter kernel to reduce/increase semaphore's count. The semaphore is designed to be crash-safe, it means even if an application is crashed in the middle of operating semaphore, the semaphore state is still safely recovered by later use, there is no waiter counter maintained by userland code. The main semaphore code is in libc and libthr only has some necessary stubs, this makes it possible that a non-threaded application can use semaphore without linking to thread library. Old semaphore implementation is kept libc to maintain binary compatibility. The kernel ksem API is no longer used in the new implemenation. Discussed on: threads@
* Modernize scandir(3) and alphasort(3) interfaces according to the IEEEkib2010-01-043-18/+15
| | | | | | | | | | | | | | | | | | | | Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions, so we better follow too (older glibc used old BSDish alphasort prototype and corresponding type of the comparision function for scandir). While there, change the definitions of the functions to ANSI C and fix several style issues nearby. Remove requirement for "sys/types.h" include for functions from manpage. POSIX also requires that alphasort(3) sorts as if strcoll(3) was used, but leave the strcmp(3) call in the function for now. Adapt in-tree callers of scandir(3) to new declaration. The fact that select_sections() from catman(1) could modify supplied struct dirent is a bug. PR: standards/142255 MFC after: 2 weeks
* Don't forget to clean up the file copied from the kernel sources.ed2010-01-021-0/+2
| | | | MFC after: 1 week
* Build lib/ with WARNS=6 by default.ed2010-01-0265-37/+81
| | | | | | | | | Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and lower it when needed. I'm setting WARNS?=0 for secure/. It seems secure/ includes the Makefile.inc provided by lib/. I'm not going to touch that directory. Most of the code there is contributed anyway.
* The devices that supported EVFILT_NETDEV kqueue filters were removed inbrooks2009-12-311-20/+0
| | | | | | | | | | | | r195175. Remove all definitions, documentation, and usage. fifo_misc.c: Remove all kqueue tests as fifo_io.c performs all those that would have remained. Reviewed by: rwatson MFC after: 3 weeks X-MFC note: don't change vlan_link_state() function signature
* Remove an unused variable.ed2009-12-311-1/+0
|
* Add missing `void' keyword.ed2009-12-311-1/+1
|
* Use _once() to initialize the pthread key for thread-local storage to holdjhb2009-12-301-14/+14
| | | | | | the results of gmtime() instead of using a pthread mutex directly. MFC after: 1 week
* Remove some test files that are no longer used.kientzle2009-12-305-27092/+0
|
* Reserve constants for RPM unwrapper and XAR reader.kientzle2009-12-301-0/+2
|
* Libarchive in FreeBSD is now synced up with 2.7.901a fromkientzle2009-12-301-2/+2
| | | | libarchive.googlecode.com
* UU decoder. Now that libarchive can recursively taste input streams,kientzle2009-12-306-0/+767
| | | | you can do things like this: tar xvf archive.tar.gz.uu
* A raft of test changes and improvements from the Googlecode repository.kientzle2009-12-3073-1315/+6267
| | | | | In particular, this includes tests for the new features I've merged over the last few days.
* Merge Michihiro NAKAJIMA's significant work on the ISO9660 readerkientzle2009-12-301-323/+1659
| | | | | | | | | | from googlecode: * Support for zisofs compressed entries * Support for relocated deep directories * Direct calculation of link counts for accurate nlink values even on images that lack Rockridge extensions * Faster handling of the internal file lists. * Better detection of ISO variants
* Document _FAST and _PRECISE clocks.kib2009-12-291-10/+40
| | | | | Submitted by: Valentin Nechayev <netch segfault kiev ua> MFC after: 3 days
* Document CLOCK_SECOND, add cross-reference from time(3) to clock_gettime(2).kib2009-12-292-3/+7
| | | | | Based on submission by: pluknet gmail com MFC after: 3 days
* Use clock_gettime(CLOCK_SECOND) instead of gettimeofday(2) forkib2009-12-291-4/+3
| | | | | | | | implementation of time(3). CLOCK_SECOND is much faster. No objections from: phk Submitted by: Valentin Nechayev <netch segfault kiev ua> MFC after: 1 week
* Rationalize the support for cryptographic hashes.kientzle2009-12-292-105/+250
|
* Essentially eliminate problems with false hardlinks in POSIX cpiokientzle2009-12-291-16/+91
| | | | | archives by generating synthetic ino values and mapping values from disk into the new values.
* Clear extraneous error messages.kientzle2009-12-291-0/+2
|
* Zip write support for libarchive.kientzle2009-12-295-0/+671
| | | | | The initial implementation was developed by Anselm Strauss as part of Google Summer of Code 2008, then completed by Joerg Sonnenberger.
* If we're linking against liblzma, allow the decompressor to use up tokientzle2009-12-291-23/+87
| | | | | | | | 1<<30 bytes of memory, which is required for some streams. Also, try to make the taster more discriminating about raw lzma streams. The detection here is still really weak, though; please use xz instead of lzma.
* Minor style fixes plus a fix for an obscure crash on certain malformedkientzle2009-12-291-11/+5
| | | | mtree files.
* Be a little more skeptical of dev/ino matches when reading cpio files.kientzle2009-12-291-35/+35
| | | | This eliminates some false-positives in the hardlink detection logic.
* Style and portability fixes for pax writer. Mostly very routine, except for:kientzle2009-12-291-32/+26
| | | | | * Use ino64 where appropriate * Don't pass atime or nsec to ustar formatter
* Style fixes to tar reader:kientzle2009-12-291-16/+16
| | | | | | | For portability, prefer int64_t to off_t. Improve numeric overflow handling when parsing. Fix some variable types. Eliminate some unused results.
* Various style fixes to the 'newc' cpio writer:kientzle2009-12-291-17/+26
| | | | | | * Warn about truncation of ino * Use a macro to hide the somewhat obscure pad-to-multiple-of-4 calculation * Eliminate some unused variables
* Various fixes when creating objects on disk:kientzle2009-12-291-23/+74
| | | | | | | | | * Write xattrs last instead of first (required on platforms that use system xattrs for security attributes) * Better handling of chdir() failures * Don't bother trying to shorten files via seek()/write() * Fix build on systems that lack link()/symlink()/mknod() * Prefer futimens()/utimensat() when they're present
* Catch decompression failures earlier. In particular, this giveskientzle2009-12-291-0/+8
| | | | immediate feedback if we fail to fork an external decompression program.
* Various style and portability fixes, including:kientzle2009-12-291-12/+35
| | | | | | * Enforce option interface can only be used before the archive is opened * Correctly handle large skips on platforms with 32-bit off_t * Use int64_t instead of off_t
* 64-bit ino support and discourage bad use of this header.kientzle2009-12-291-1/+5
|
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.antoine2009-12-284-6/+6
| | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month
* Grammar fix.delphij2009-12-281-1/+1
| | | | | Submitted by: Kenyon Ralph <kenyon kenyonralph com> MFC after: 1 week
* bring the NGM_IPFW_COOKIE back into ng_ipfw.h, libnetgraph expectsluigi2009-12-281-2/+0
| | | | | to find it there. Unfortunately this reintroduces the dependency on ip_fw_pfil.c
* this file is also affected by the ipfw changesluigi2009-12-281-0/+2
|
* Portability.kientzle2009-12-281-1/+3
|
* Remove some dead assignments, fix some declarations.kientzle2009-12-281-3/+1
|
* Clarify an example so Linux folks won't keep getting confused by this point.kientzle2009-12-281-0/+3
|
* Compatibility with old systems with non-POSIX getpwuid_r/getgrgid_r.kientzle2009-12-281-0/+2
|
* Fix some unused variables and dead assignments.kientzle2009-12-283-5/+2
|
* Remove an unused variable and an unreachable statement.kientzle2009-12-281-3/+1
|
* Fix line endings.kientzle2009-12-281-187/+187
|
* Discourage external use of this header.kientzle2009-12-281-0/+4
|
* Remove unused variable.kientzle2009-12-281-2/+0
|
* O_BINARY for Windows.kientzle2009-12-281-0/+9
|
* Handle Zip CRC validation for uncompressed Zip archives even onkientzle2009-12-282-6/+71
| | | | platforms that lack zlib.
* Include limits.h; remove unused variable.kientzle2009-12-281-3/+3
|
* Use ino64 interface.kientzle2009-12-282-6/+6
|
* Use new ino64 interface.kientzle2009-12-281-2/+1
|
OpenPOWER on IntegriCloud