aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge head from 7/28Simon J. Gerraty2014-08-19443-7126/+4861
|\ | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * If telldir() is called immediately after a call to seekdir(), POSIXJohn Baldwin2014-07-292-28/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requires the return value of telldir() to equal the value passed to seekdir(). The current seekdir code with SINGLEUSE enabled breaks this case as each call to telldir() allocates a new cookie. Instead, remove the SINGLEUSE code and change telldir() to look for an existing cookie for the directory's current location rather than always creating a new cookie. CR: https://phabric.freebsd.org/D490 PR: 121656 Reviewed by: jilles MFC after: 1 week Notes: svn path=/head/; revision=269204
| * Update the list of cross references to include the more modern set ofGeorge V. Neville-Neil2014-07-281-1/+13
| | | | | | | | | | | | | | processors that we now support. Notes: svn path=/head/; revision=269182
| * Unbreak the ABI by reverting r268494 until the compat shims are providedPietro Cerutti2014-07-281-1/+1
| | | | | | | | Notes: svn path=/head/; revision=269179
| * In r232153, libarchive 3.0.3 was imported, replacing the archive_hash.hDimitry Andric2014-07-261-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | header with archive_crypto_private.h, and its ARCHIVE_HASH_xxx macros were renamed to ARCHIVE_CRYPTO_xxx. Rename these macros in lib/libarchive/config_freebsd.h, to re-enable the hashes for libarchive again. This affects the mtree format writer, and the xar format reader and writer modules. This also requires changes in the library order for statically linking rescue, otherwise ld would complain about redefined symbols. Thanks to jkim for pointing out the solution. Reviewed by: kientzle MFC after: 1 week Notes: svn path=/head/; revision=269125
| * strftime() xlocale cleanups.Pedro F. Giffuni2014-07-261-37/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace fprintf_l with fputs when output is unformatted. Use locale_t in _conv() since it was using sprintf (now sprintf_l) Use locale_t on _yconv() sinci it calls _conv() Obtained from: Apple Inc. (Libc 997.90.3) CR: D482 Reviewed by: theraven MFC after: 1 week Notes: svn path=/head/; revision=269124
| * In the "Too many open files" edge cases don't try to preserve oldAndrey A. Chernov2014-07-261-0/+8
| | | | | | | | | | | | | | | | | | | | number for non-std* descriptors, but close old file and retry. Obtained from: inspired by Apple's change from pfg@ MFC after: 2 weeks Notes: svn path=/head/; revision=269116
| * Remove useless getpwnam() call.Dag-Erling Smørgrav2014-07-261-3/+1
| | | | | | | | | | | | | | | | Submitted by: Arthur Mesh <amesh@juniper.net> MFC after: 1 week Notes: svn path=/head/; revision=269115
| * Reviewed by: impSimon J. Gerraty2014-07-261-3/+3
| | | | | | | | | | | | | | | | LDFLAGS is supposed to be given to CC not LD. Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD Notes: svn path=/head/; revision=269114
| * POSIX says that passing a location returned by telldir() to seekdir()John Baldwin2014-07-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | after an intervening call to rewinddir() is undefined, so reclaim any pending telldir() cookies in the directory when rewinddir() is called. CR: D459 Reviewed by: jilles MFC after: 1 week Notes: svn path=/head/; revision=269079
| * libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is notSean Bruno2014-07-242-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | true on amd64 I'm not quite positive this is the "correct" solution for this but it does seem to compile and shut up the spew of warnings when compiling libstand for userboot. Add two _Static_asserts() so that in the future somebody will get a compile failure if an architecture develops that violates the assumptions of this code. (strongly suggested by jmg) Change commetns to indicate int types instead of long. (noted by ian in phabric review) Phabric: https://phabric.freebsd.org/D443 Notes: svn path=/head/; revision=269077
| * Fix fault injection in bhyve.Neel Natu2014-07-242-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The faulting instruction needs to be restarted when the exception handler is done handling the fault. bhyve now does this correctly by setting 'vmexit[vcpu].inst_length' to zero so the %rip is not advanced. A minor complication is that the fault injection APIs are used by instruction emulation code that is shared by vmm.ko and bhyve. Thus the argument that refers to 'struct vm *' in kernel or 'struct vmctx *' in userspace needs to be loosely typed as a 'void *'. Notes: svn path=/head/; revision=269042
| * Fix mismatch.Pedro F. Giffuni2014-07-231-1/+1
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=269016
| * fparseln(3): Update from NetBSD sources.Pedro F. Giffuni2014-07-231-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fix a condition so that fparseln() doesn't report spurious empty lines eg after 2 comment lines, or on EOF after a single comment line -no escape character means no escaped characters modify the previous fix so that no pointless realloc()s are done in the case of multiple empty continuation lines, and comment the code to make the logics obvious fparseln is now part of libc in NetBSD so this changes the previous revision numbering. Obtained from: NetBSD (CVS Rev. 1.6-1.7) MFC after: 2 weeks Notes: svn path=/head/; revision=269015
| * Emulate instructions emitted by OpenBSD/i386 version 5.5:Neel Natu2014-07-232-2/+47
| | | | | | | | | | | | | | | | | | | | - CMP REG, r/m - MOV AX/EAX/RAX, moffset - MOV moffset, AX/EAX/RAX - PUSH r/m Notes: svn path=/head/; revision=269008
| * Avoid possible cast degradation.Pedro F. Giffuni2014-07-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For consistency with r268985 for fputs.c, assign iov_len first, avoiding the cast to uio_resid (int in stdio) from degrading the value. We currently don't support lengths higher than INT_MAX so this change is little more than cosmetic. MFC after: 3 days Notes: svn path=/head/; revision=269001
| * For "a"-mode files and rewind/fseek + fwrite combination return meaningfulAndrey A. Chernov2014-07-221-0/+18
| | | | | | | | | | | | | | | | value now, like Apple does, but avoid their __sflush physical write performance degradation as much as possible. Notes: svn path=/head/; revision=268997
| * Back the whole change out until I figure out how to obtain O_APPEND,Andrey A. Chernov2014-07-221-6/+0
| | | | | | | | | | | | | | it can't be used in this field at all. Notes: svn path=/head/; revision=268992
| * Checking for __SAPP alone is not enough because it is emulated O_APPENDAndrey A. Chernov2014-07-221-1/+2
| | | | | | | | | | | | | | only, so works for only special fdopen() case. Add real O_APPEND too. Notes: svn path=/head/; revision=268991
| * Revert r268984:Pedro F. Giffuni2014-07-221-2/+5
| | | | | | | | | | | | | | | | | | | | | | Check for __SAPP flag before calling sflush. This avoids performance degradation compared to the previous approach. Submitted by: ache MFC after: 2 weeks Notes: svn path=/head/; revision=268987
| * Mostly cosmetic cleanups.Pedro F. Giffuni2014-07-222-3/+3
| | | | | | | | | | | | | | | | | | In fputs() avoid implcit casting on iov.iov_len. MFC after: 3 days Notes: svn path=/head/; revision=268985
| * ftello: return 1 when seeking offset on an append stream.Pedro F. Giffuni2014-07-221-0/+2
| | | | | | | | | | | | | | | | | | Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 2 weeks Notes: svn path=/head/; revision=268984
| * rewind: always clear error indicator.Pedro F. Giffuni2014-07-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | Required by POSIX: http://pubs.opengroup.org/onlinepubs/009695399/functions/rewind.html Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 1 week Notes: svn path=/head/; revision=268983
| * Fix hdestroy() compliance issue.Pedro F. Giffuni2014-07-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hcreate(3) implementation and related functions we inherited from NetBSD used to free() the key value, something that is not supported by the standard implementation. This would cause a segmentation fault when attempting to run the examples from the opengroup and linux manpages. NetBSD has added non-standard calls to provide the previous behaviour but hdestroy is not very commonly used so at this time it seems excessive to bring those to FreeBSD. Bump the __FreeBSD_version as this is an ABI change. Reference: http://bugs.dragonflybsd.org/issues/1398 MFC after: 2 weeks Notes: svn path=/head/; revision=268945
| * Update license.Pedro F. Giffuni2014-07-211-7/+2
| | | | | | | | | | | | | | | | | | NetBSD has removed the advertisement clause from this file. Obtained from: NetBSD (CVS rev. 1,8) Notes: svn path=/head/; revision=268944
| * Add re-entrant versions of the hash functions based on the GNU api.Pedro F. Giffuni2014-07-214-41/+153
| | | | | | | | | | | | | | | | | | | | While testing this I found a conformance issue in hdestroy() that will be fixed in a subsequent commit. Obtained from: NetBSD (hcreate.c, CVS Rev. 1.7) Notes: svn path=/head/; revision=268943
| * Adjust errno on failed prepwrite.Pedro F. Giffuni2014-07-203-3/+10
| | | | | | | | | | | | | | | | | | Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 1 week Notes: svn path=/head/; revision=268930
| * Const-ify a character string.Pedro F. Giffuni2014-07-201-1/+1
| | | | | | | | | | | | | | | | Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days Notes: svn path=/head/; revision=268928
| * Use a correct errno in freopen.Pedro F. Giffuni2014-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use EBADF instead of EINVAL when working around incorrect O_ACCMODE. Phabric: D442 Obtained from: Apple Inc. (Libc 997.90.3) Reviewed by: jilles MFC after: 1 week Notes: svn path=/head/; revision=268926
| * Update fflush(3) to return success on a read-only stream.Pedro F. Giffuni2014-07-201-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | This has small changes to what Apple uses for compliance with SUSv3. The changes cause no secondary effects in the gnulib tests (we pass them). Obtained from: Apple Inc. (Libc 997.90.3 with changes) Reviewed by: bde Phabric: D440 Notes: svn path=/head/; revision=268924
| * Add dl_unwind_find_exidx() for ARM EABI, required for C++ exceptionIan Lepore2014-07-193-1/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handling. For statically linked apps this uses the __exidx_start/end symbols set up by the linker. For dynamically linked apps it finds the shared object that contains the given address and returns the location and size of the exidx section in that shared object. The dl_unwind_find_exidx() name is used by other BSD projects and Android, and is mentioned in clang 3.5 comments as "the BSD interface" for finding exidx data. GCC (in libgcc_s) expects the exact same API and functionality to be provided by a function named __gnu_Unwind_Find_exidx(), so we provide that with an alias ("strong reference"). Reviewed by: kib@ MFC after: 1 week Notes: svn path=/head/; revision=268893
| * Add support for the "account" facility.Dag-Erling Smørgrav2014-07-192-5/+25
| | | | | | | | | | | | | | | | PR: 115164 MFC after: 1 week Notes: svn path=/head/; revision=268890
| * Handle nested exceptions in bhyve.Neel Natu2014-07-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A nested exception condition arises when a second exception is triggered while delivering the first exception. Most nested exceptions can be handled serially but some are converted into a double fault. If an exception is generated during delivery of a double fault then the virtual machine shuts down as a result of a triple fault. vm_exit_intinfo() is used to record that a VM-exit happened while an event was being delivered through the IDT. If an exception is triggered while handling the VM-exit it will be treated like a nested exception. vm_entry_intinfo() is used by processor-specific code to get the event to be injected into the guest on the next VM-entry. This function is responsible for deciding the disposition of nested exceptions. Notes: svn path=/head/; revision=268889
| * Check if the specified group is the user's primary group beforeDag-Erling Smørgrav2014-07-191-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | iterating over the (possibly empty) list of members. Otherwise, we get a false negative when the target group has no members listed in /etc/group. This went mostly unnoticed because root is explicitly listed as a member of wheel, so the bug is never triggered in the most common use case, which is su(8). PR: 109416 MFC after: 1 week Notes: svn path=/head/; revision=268888
| * Clean up the libunbound build to avoid accidentally regenerating theDag-Erling Smørgrav2014-07-191-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | configuration lexer and parser during buildworld. Instead of being included in the source as it is in the upstream distribution, the code is now always generated (in ${.OBJDIR}) at build time. PR: 190739 MFC after: 1 week Notes: svn path=/head/; revision=268883
| * Clean r268867.Pedro F. Giffuni2014-07-191-1/+1
| | | | | | | | | | | | | | Proposed by: bde Notes: svn path=/head/; revision=268878
| * Use unsigned optlen in getsourcefilter()Pedro F. Giffuni2014-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | Sizes can not be negative and the functions that use it expect an unsigned value anyways. Obtained from: Apple (Libc-997.90.3) MFC after: 1 week Notes: svn path=/head/; revision=268867
| * ttyname(3): Fix EBADF/ENOTTY error descriptions.Jilles Tjoelker2014-07-181-5/+21
| | | | | | | | | | | | | | | | | | | | | | Also, make sure to document the return values and errors for all three functions in the man page. PR: 191931 MFC after: 1 week Notes: svn path=/head/; revision=268857
| * Extend kqueue's EVFILT_TIMER by adding precision unit flags supportBaptiste Daroussin2014-07-181-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | Define the precision macros as bits sets to conform with XNU equivalent. Test fflags passed for EVFILT_TIMER and return EINVAL in case an invalid flag is passed. Phabric: https://phabric.freebsd.org/D421 Reviewed by: kib Notes: svn path=/head/; revision=268843
| * Update libucl to the 2014-07-16 snapshotBaptiste Daroussin2014-07-181-1/+3
| | | | | | | | | | | | | | This update brings streamlined ucl emitter support Notes: svn path=/head/; revision=268831
| * Replace all uses of libncurses and libtermcap with their wide characterBrooks Davis2014-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | variants. This allows usable file system images (i.e. those with both a shell and an editor) to be created with only one copy of the curses library. Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=268804
| * Add a comment to explain the EAGAIN is only there for POSIX complianceBaptiste Daroussin2014-07-151-0/+1
| | | | | | | | | | | | | | | | Resquested by: kib Reviewed by: des Notes: svn path=/head/; revision=268671
| * libc/stdlib: Minor cleanups to code originating in NetBSDPedro F. Giffuni2014-07-153-22/+14
| | | | | | | | | | | | | | | | | | | | Mostly ANSIfication and typos. Obtained from: NetBSD MFC after: 5 days Notes: svn path=/head/; revision=268644
| * Document that listen(2) can fail with EDESTADDRREQ.Kevin Lo2014-07-151-1/+4
| | | | | | | | Notes: svn path=/head/; revision=268643
| * libc/gen: small updates to code originating at OpenBSDPedro F. Giffuni2014-07-152-19/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arc4random.c - CVS rev. 1.22 Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as ``-upper_bound % upper_bound''. Simplifies the code and makes it the same on both ILP32 and LP64 architectures, and also slightly faster on LP64 architectures by using a 32-bit remainder instead of a 64-bit remainder. - CVS rev. 1.23 Spacing readpassphrase.c -CVS rev. v 1.24 most obvious unsigned char casts for ctype Obtained from: OpenBSD MFC after: 5 days Notes: svn path=/head/; revision=268642
| * Make generation of nslexer.c more robust.Julio Merino2014-07-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that lex errors fail the build instead of being silently ignored due to the piped call. Also postpone the update of the nslexer.c file until we are sure we have generated it properly. These changes fix some very obscure build failures I encountered while building FreeBSD within a chroot that did not have devfs mounted. The specific errors looked like: .../libc.so.7: undefined reference to `_nsyyerror' .../libc.so.7: undefined reference to `_nsyyin' .../libc.so.7: undefined reference to `_nsyylex' .../libc.so.7: undefined reference to `_nsyylineno' .../libc.so.7: undefined reference to `_nsyytext' and were caused due to a mangled nslexer.c being linked into libc. Notes: svn path=/head/; revision=268620
| * * Update the comments to agree with commit r226595.Steve Kargl2014-07-131-4/+4
| | | | | | | | | | | | | | * While here, fix a nearby typo in a comment. Notes: svn path=/head/; revision=268597
| * * Makefile:Steve Kargl2014-07-138-19/+696
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . Add s_erfl.c to building libm. . Add MLINKS for erfl.3 and erfcl.3. * Symbol.map: . Move erfl and erfcl to their proper location. * ld128/s_erfl.c: . Implementations of erfl and erfcl in the IEEE 754 128-bit format. * ld80/s_erfl.c: . Implementations of erfl and erfcl in the Intel 80-bit format. * man/erf.3: . Document the new functions. . While here, remove an incomplete sentence. * src/imprecise.c: . Remove the stupidity of mapping erfl and erfcl to erf and erfc. * src/math.h: . Move the declarations of erfl and erfcl to their proper place. * src/s_erf.c: . For architectures where double and long double are the same floating point format, use weak references to map erfl to erf and ercl to erfc. Reviewed by: bde (many earlier versions) Notes: svn path=/head/; revision=268593
| * * Use 9 digits instead of 11 digits in efx and efx8.Steve Kargl2014-07-131-54/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update the domain and range of comments for the polynomial approximations, including using the the correct variable names (e.g., pp(x) instead of p(x)). * Use hex values of the form 0x3e0375d4 instead of 0x1.06eba8p-3, which was obtained from printf("%.6a"). * In the domain [0.84375, 1.25], qa(x) can be reduced from a 4th order polynomial to 3rd order. * In the domain [1.25,1/0.35], sa(x) can be reduced from a 4th order polynomial to 3rd order. * In the domain [1/0.35, 11], the 4th order polynomials rb(x) and sb(x) can be reduced to 2nd and 3rd order, respectively. Notes: svn path=/head/; revision=268590
| * * Update the comments that refer to erf[c](nan) and erf[c](+-inf)Steve Kargl2014-07-131-4/+4
| | | | | | | | | | | | | | to use erf[c]f. Notes: svn path=/head/; revision=268589