summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the example: free the memory that was allocated by getline().n_hibma2014-07-311-0/+1
|
* Provide a means for loaders to control which file system to use. Thismarcel2014-07-302-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to counteract the default behaviour of always trying each and every file system until one succeeds, or the open fails. The problem with the loader is that we've implemented features based on this behavior. The handling of compressed files is a good example of this. However, it is in general highly undesirable to not have a one-time probe (or taste in the geom lingo), followed by something similar to a mount whenever we (first) read from a device. Everytime we go to the same device, we can reasonably assume it (still) has the same file system. For file systems that need to do far more that a trivial read of a super block, not having something similar to a mount operation is disastrous from a performance (and thus usability) perspective. But, again, since we've implemented features based on this stateless approach, things can get complicated quickly if and when we want to change this. And yet, we sometimes do need stateful behaviour. For this reason, this change simply introduces exclusive_file_system. When set to the fsops of the file system to use, the open call will only try this file system. Setting it to NULL restores the default behaviour. It's a low-cost (low-brow?) approach to provide enough control without re-implementing the guts of the loader. A good example of when this is useful is when we're trying to load files out of a container (say, a software packaga) that itself lives on a file system or is fetched over the network. While opening the container can be done in the normal stateless manner, once it is opened, subsequent opens should only consider the container. Obtained from: Juniper Networks, Inc.
* If telldir() is called immediately after a call to seekdir(), POSIXjhb2014-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
* Update the list of cross references to include the more modern set ofgnn2014-07-281-1/+13
| | | | processors that we now support.
* Unbreak the ABI by reverting r268494 until the compat shims are providedgahr2014-07-281-1/+1
|
* In r232153, libarchive 3.0.3 was imported, replacing the archive_hash.hdim2014-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
* strftime() xlocale cleanups.pfg2014-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
* In the "Too many open files" edge cases don't try to preserve oldache2014-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
* Remove useless getpwnam() call.des2014-07-261-3/+1
| | | | | Submitted by: Arthur Mesh <amesh@juniper.net> MFC after: 1 week
* Reviewed by: impsjg2014-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
* POSIX says that passing a location returned by telldir() to seekdir()jhb2014-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
* libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is notsbruno2014-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
* Fix fault injection in bhyve.neel2014-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 *'.
* Fix mismatch.pfg2014-07-231-1/+1
| | | | MFC after: 3 days
* fparseln(3): Update from NetBSD sources.pfg2014-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
* Emulate instructions emitted by OpenBSD/i386 version 5.5:neel2014-07-232-2/+47
| | | | | | | - CMP REG, r/m - MOV AX/EAX/RAX, moffset - MOV moffset, AX/EAX/RAX - PUSH r/m
* Avoid possible cast degradation.pfg2014-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
* For "a"-mode files and rewind/fseek + fwrite combination return meaningfulache2014-07-221-0/+18
| | | | | value now, like Apple does, but avoid their __sflush physical write performance degradation as much as possible.
* Back the whole change out until I figure out how to obtain O_APPEND,ache2014-07-221-6/+0
| | | | it can't be used in this field at all.
* Checking for __SAPP alone is not enough because it is emulated O_APPENDache2014-07-221-1/+2
| | | | only, so works for only special fdopen() case. Add real O_APPEND too.
* Revert r268984:pfg2014-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
* Mostly cosmetic cleanups.pfg2014-07-222-3/+3
| | | | | | In fputs() avoid implcit casting on iov.iov_len. MFC after: 3 days
* ftello: return 1 when seeking offset on an append stream.pfg2014-07-221-0/+2
| | | | | | Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 2 weeks
* rewind: always clear error indicator.pfg2014-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
* Fix hdestroy() compliance issue.pfg2014-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
* Update license.pfg2014-07-211-7/+2
| | | | | | NetBSD has removed the advertisement clause from this file. Obtained from: NetBSD (CVS rev. 1,8)
* Add re-entrant versions of the hash functions based on the GNU api.pfg2014-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)
* Adjust errno on failed prepwrite.pfg2014-07-203-3/+10
| | | | | | Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 1 week
* Const-ify a character string.pfg2014-07-201-1/+1
| | | | | Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days
* Use a correct errno in freopen.pfg2014-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
* Update fflush(3) to return success on a read-only stream.pfg2014-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
* Add dl_unwind_find_exidx() for ARM EABI, required for C++ exceptionian2014-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
* Add support for the "account" facility.des2014-07-192-5/+25
| | | | | PR: 115164 MFC after: 1 week
* Handle nested exceptions in bhyve.neel2014-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.
* Check if the specified group is the user's primary group beforedes2014-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
* Clean up the libunbound build to avoid accidentally regenerating thedes2014-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
* Clean r268867.pfg2014-07-191-1/+1
| | | | Proposed by: bde
* Use unsigned optlen in getsourcefilter()pfg2014-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
* ttyname(3): Fix EBADF/ENOTTY error descriptions.jilles2014-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
* Extend kqueue's EVFILT_TIMER by adding precision unit flags supportbapt2014-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
* Update libucl to the 2014-07-16 snapshotbapt2014-07-181-1/+3
| | | | This update brings streamlined ucl emitter support
* Replace all uses of libncurses and libtermcap with their wide characterbrooks2014-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
* Add a comment to explain the EAGAIN is only there for POSIX compliancebapt2014-07-151-0/+1
| | | | | Resquested by: kib Reviewed by: des
* libc/stdlib: Minor cleanups to code originating in NetBSDpfg2014-07-153-22/+14
| | | | | | | Mostly ANSIfication and typos. Obtained from: NetBSD MFC after: 5 days
* Document that listen(2) can fail with EDESTADDRREQ.kevlo2014-07-151-1/+4
|
* libc/gen: small updates to code originating at OpenBSDpfg2014-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
* Make generation of nslexer.c more robust.jmmv2014-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.
* * Update the comments to agree with commit r226595.kargl2014-07-131-4/+4
| | | | * While here, fix a nearby typo in a comment.
* * Makefile: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)
* * Use 9 digits instead of 11 digits in efx and efx8.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.
OpenPOWER on IntegriCloud