aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* If we close or sync a hash-based db file, make sure to call fsync toDavid Malone2016-02-231-1/+5
| | | | | | | | | | | | make sure the changes are on disk. The people at pfSense noticed that it didn't always make it to the disk soon enough with soft updates. Differential Revision: https://reviews.freebsd.org/D5186 Reviewed by: garga, vangyzen, bapt, se MFC after: 1 week Notes: svn path=/head/; revision=295924
* As <machine/param.h> is included from <sys/param.h>, there is no needSvatopluk Kraus2016-02-221-1/+0
| | | | | | | | | | to include it explicitly when <sys/param.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5378 Notes: svn path=/head/; revision=295881
* Rename pte.h to pte-v4.h and start including directly either pte-v4.hSvatopluk Kraus2016-02-191-4/+6
| | | | | | | | | | | | | | | | | or pte-v6.h in files which needs it. There are quite internal definitions in pte-v4.h and pte-v6.h headers specific for corresponding pmap implementation. These headers should be included only in very few files and an intention is to not hide for which implementation such files are. Further, sys/arm/arm/elf_trampoline.c is an example of file which uses armv4 like pmap implementation for both armv4 and armv6 platforms. This is another reason why pte.h which includes specific header according to __ARM_ARCH is not created. Notes: svn path=/head/; revision=295801
* Remove sys/types.hKevin Lo2016-02-191-2/+1
| | | | Notes: svn path=/head/; revision=295797
* Bump .Dd for r295764Benjamin Kaduk2016-02-181-3/+3
| | | | | | | Also fix a spelling and grammar nit while here. Notes: svn path=/head/; revision=295765
* Right now, the "virtual hole" API feature of lseek(2) is very vaguelyMaxim Sobolev2016-02-181-4/+12
| | | | | | | | | | | | | | documented and easy to miss. At the same time, it's pretty important for anyone who is trying to use SEEK_HOLE/SEEK_DATA in real app. Try to bridge that gap by making that description more pronounced and also document how it affects failure codes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5162 Notes: svn path=/head/; revision=295764
* Remove dd xfer stats emitted during buildworldEd Maste2016-02-182-2/+2
| | | | | | | They result in gratuitous differences when comparing build log output. Notes: svn path=/head/; revision=295757
* Remove redundant ARM_L2_ADDR_BITS and L2_ADDR_BITS definitions andSvatopluk Kraus2016-02-182-4/+1
| | | | | | | replace them by primary ones where needed. Notes: svn path=/head/; revision=295752
* Fix build race after r295643.Bryan Drewery2016-02-171-0/+2
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295713
* DIRDEPS_BUILD: Hookup CLANG_EXTRAS.Bryan Drewery2016-02-167-0/+114
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295681
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2016-02-161-0/+13
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295650
* fputs: Return the number of bytes written.Pedro F. Giffuni2016-02-151-1/+1
| | | | | | | | | | Fix r295631: wrong value. Pointy hat: pfg (me) Pointed out by: bde Notes: svn path=/head/; revision=295638
* getln: We cannot expand the buffer beyond INT_MAX.Pedro F. Giffuni2016-02-152-2/+12
| | | | | | | | | | | | In such cases return ENOMEM. This is a limitation of our implementation, alternatively you may consider getline(3). Differential Revision: https://reviews.freebsd.org/D442 (Partial) Obtained from: Apple Inc. (Libc 997.90.3) Relnotes: yes Notes: svn path=/head/; revision=295632
* fputs: Return the number of bytes written.Pedro F. Giffuni2016-02-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | POSIX.1-2008 requires that successful completion simply return a non-negative integer. We have regularly returned a constant value. Another, equally valid, implementation convention implies returning the number of bytes written. Adopt this last convention to be in line with what Apple's libc does. POSIX also explicitly notes: Note that this implementation convention cannot be adhered to for strings longer than {INT_MAX} bytes as the value would not be representable in the return type of the function. For backwards-compatibility, implementations can return the number of bytes for strings of up to {INT_MAX} bytes, and return {INT_MAX} for all longer strings. Developers shouldn't depend specifically on either convention but the change may help port software from Apple. Differential Revision: https://reviews.freebsd.org/D442 (Partial) Obtained from: Apple Inc. (Libc 997.90.3 with changes) Relnotes: yes Notes: svn path=/head/; revision=295631
* Add libpe for elfcopy(1) PE/COFF supportEd Maste2016-02-122-0/+36
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=295581
* Update ELF Tool Chain to upstream rev 3400Ed Maste2016-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some notable improvements include: readelf: - Add AArch64 relocation definitions. - Report value of unknown relocation types. elfcopy: - Consider symbols with STB_GNU_UNIQUE binding as global symbols. - Fixed support for VMA adjustment for loadable sections found in relocatable objects. - Handle nameless global symbols. - Improve wildcard matching for !-prefixed symbols. - Add PE/COFF support. elfdump: - Improve section type reporting. - Add MIPS-specific section types. This update also includes a significant number of bug fixes. PR: 207091 [exp-run] Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=295577
* Fix double-free error: r289419 moved all error handling in http_connect()Dag-Erling Smørgrav2016-02-111-1/+0
| | | | | | | | | | | | to the end of the function, but did not remove a fetch_close() call which was made redundant by the one in the shared error-handling code. PR: 206774 Submitted by: Christian Heckendorf <heckendorfc@gmail.com> MFC after: 3 days Notes: svn path=/head/; revision=295536
* Use the new insecure-lan-zones option instead of listing each AS112 zoneDag-Erling Smørgrav2016-02-111-1/+1
| | | | | | | | | separately. MFC after: 3 days Notes: svn path=/head/; revision=295535
* Remove man page references to rndassociates.com, which has been taken overJamie Gritton2016-02-101-1/+0
| | | | | | | by a domain squatter. Notes: svn path=/head/; revision=295468
* Include sys/_task.h into uma_int.h, so that taskqueue.h isn't aGleb Smirnoff2016-02-091-1/+0
| | | | | | | | | requirement for uma_int.h. Suggested by: jhb Notes: svn path=/head/; revision=295451
* Fix the gcc build after r295407.Mark Johnston2016-02-081-1/+1
| | | | | | | X-MFC-With: r295407 Notes: svn path=/head/; revision=295416
* If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbolsKonstantin Belousov2016-02-087-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | do not participate in the global symbols namespace, but rtld locks are still replaced and functions are interposed. In particular, __pthread_map_stacks_exec is resolved to the libc version. If a library is loaded later, which requires adjustment of the stack protection mode, rtld calls into libc __pthread_map_stacks_exec due to the symbols scope. The libc version might recurse into binder and recursively acquire rtld bind lock, causing the hang. Make libc __pthread_map_stacks_exec() interposed, which synchronizes rtld locks and version of the stack exec hook when libthr loaded, regardless of the symbol scope control or symbol resolution order. The __pthread_map_stacks_exec() symbol is removed from the private version in libthr since libc symbol now operates correctly in presence of libthr. Reported and tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=295407
* semget(2): Add missing [EINVAL] conditions.Jilles Tjoelker2016-02-071-1/+12
| | | | | | | PR: 206927 Notes: svn path=/head/; revision=295384
* MFV r295360Pedro F. Giffuni2016-02-077-43/+54
| | | | | | | | | Sync our libedit with NetBSD's libedit 2016-01-16 Obtained from: NetBSD Notes: svn path=/head/; revision=295369
* - connect(2) Clarify namelenJason Helfman2016-02-041-1/+9
| | | | | | | | | | | PR: 206838 Submitted by: t@tobik.me Approved by: bcr (mentor) MFH: after 1 week Differential Revision: https://reviews.freebsd.org/D5194 Notes: svn path=/head/; revision=295272
* Fix build.Gleb Smirnoff2016-02-041-0/+1
| | | | Notes: svn path=/head/; revision=295226
* Move logic to destroy a struct catentry to its own function.Bryan Drewery2016-02-021-9/+17
| | | | | | | | | | This will be used later for memory leak handling. Obtained from: OneFS Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295176
* - Note that devctl(8) will appear in 10.3 first.John Baldwin2016-02-021-4/+5
| | | | | | | | | | - Add missing devctl_set_driver entry to namelist in devlist(3). - Fix sorting of function prototypes in devlist(3). MFC after: 3 days Notes: svn path=/head/; revision=295174
* This seems like a very trivial bug that should have been squashed a longMaxim Sobolev2016-01-302-0/+98
| | | | | | | | | | | | | | | | | | | | | | time ago, but for some reason it was not. Basically, without this change dlopen(3)'ing an empty .so file would just cause application to dump core with SIGSEGV. Make sure the file has enough data for at least the ELF header before mmap'ing it. Add a test case to check that dlopen an empty file return an error. There were a separate discussion as to whether it should be SIGBUS instead when you try to access region mapped from an empty file, but it's definitely SIGSEGV now, so if anyone want to check that please be my guest. Reviewed by: mjg, cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5112 Notes: svn path=/head/; revision=295059
* Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions.John Baldwin2016-01-303-19/+19
| | | | | | | | | Suggested by: jmallett Reviewed by: bdrewery, jmallett Differential Revision: https://reviews.freebsd.org/D5123 Notes: svn path=/head/; revision=295056
* Add implementations of sendmmsg(3) and recvmmsg(3) functions whichKonstantin Belousov2016-01-298-20/+303
| | | | | | | | | | | | | | | | | | | | | wraps sendmsg(2) and recvmsg(2) into batch send and receive operation. The goal of this implementation is only to provide API compatibility with Linux. The cancellation behaviour of the functions is not quite right, but due to relative rare use of cancellation it is considered acceptable comparing with the complexity of the correct implementation. If functions are reimplemented as syscalls, the fix would come almost trivial. The direct use of the syscall trampolines instead of libc wrappers for sendmsg(2) and recvmsg(2) is to avoid data loss on cancellation. Submitted by: Boris Astardzhiev <boris.astardzhiev@gmail.com> Discussed with: jilles (cancellation behaviour) MFC after: 1 month Notes: svn path=/head/; revision=295039
* Use intptr_t note ptrdiff_t when storing flags in the bottom bits ofBrooks Davis2016-01-292-6/+6
| | | | | | | | | | pointers. Obtained from: CheriBSD (e3a69027cc5a384431156d61c90d4304387a9b9d) Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=295031
* Declare bt_devenum() to match the definition.Brooks Davis2016-01-291-1/+1
| | | | | | | | | Obtained from: CheriBSD (1c1dad87ef9983a4ca0c7d6eb0792d489436bcd1) MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=295028
* Fix fatal warn when compiling under GCC 5.2.0Devin Teske2016-01-271-2/+2
| | | | | | | | | | | | | | GCC 5.2.0 generates the following [fatal] warning: dialog_util.c:270:23: error: zero-length gnu_printf format string [-Werror=format-zero-length] sprintf(dargv[n++], ""); Fix malloc argument while here, removing sprintf. Reported by: Ruslan Bukin <ruslan.bukin at cl cam ac uk> Notes: svn path=/head/; revision=294922
* Add pthread MD part for RISC-V.Ruslan Bukin2016-01-271-0/+92
| | | | | | | | | | Reviewed by: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5063 Notes: svn path=/head/; revision=294912
* Add the RISC-V MD parts of libthread_db.Ruslan Bukin2016-01-271-0/+104
| | | | | | | | | Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5064 Notes: svn path=/head/; revision=294908
* Fix a crash if `-D' is used without `-t title'Devin Teske2016-01-271-0/+7
| | | | | | | | | | | | | dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s dialog_gauge() and dialog(1)'s `--gauge', will segmentation fault in strlen(3) if no title is set for the widget. Reproducible with `dialog --gauge hi 6 20' (adding `--title ""' is enough to prevent segmentation fault). MFC after: 3 days X-MFC-to: stable/10 Notes: svn path=/head/; revision=294893
* Remove unused function prototypeDevin Teske2016-01-271-1/+0
| | | | | | | | MFC after: 3 days X-MFC-to: stable/10 Notes: svn path=/head/; revision=294892
* Convert rman to use rman_res_t instead of u_longJustin Hibbits2016-01-272-8/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075 Notes: svn path=/head/; revision=294883
* Replace nslexer.l->nslexer.c custom rule with a -D CFLAG.Bryan Drewery2016-01-271-8/+3
| | | | | | | | | | | | | | This avoids reproducing the lex logic which had dependencies set wrong and used an intermediate file for modifying the YY_BUF_SIZE. This has only been possible since flex 2.5.37 was imported in r250873, which uses #ifndef YY_BUF_SIZE. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294877
* nslexer.c does not depend on nsparser.h.Bryan Drewery2016-01-271-1/+1
| | | | | | | | | | | | | nslexer.o depends on nsparser.h, which is already added by bsd.lib.mk and .depend. This reverts r237402. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294876
* Remove excess whitespaceBryan Drewery2016-01-271-1/+1
| | | | Notes: svn path=/head/; revision=294868
* Bump copyrightsDevin Teske2016-01-273-3/+3
| | | | Notes: svn path=/head/; revision=294862
* Add keep_tite configuration optionDevin Teske2016-01-264-3/+9
| | | | | | | | | Similar to dialog(3) keep_tite option used to prevent visually disturbing initialization or exit that could occur when run from a script using dpv(3) by way of dpv(1) in sequence with other dialog(1) invocations. Notes: svn path=/head/; revision=294860
* Add support to libsysdecode for decoding system call names.John Baldwin2016-01-265-2/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | A new sysdecode_syscallname() function accepts a system call code and returns a string of the corresponding name (or NULL if the code is unknown). To support different process ABIs, the new function accepts a value from a new sysdecode_abi enum as its first argument to select the ABI in use. Current ABIs supported include FREEBSD (native binaries), FREEBSD32, LINUX, LINUX32, and CLOUDABI64. Note that not all ABIs are supported by all platforms. In general, a given ABI is only supported if a platform can execute binaries for that ABI. To simplify the implementation, libsysdecode's build reuses the existing pre-generated files from the kernel source tree rather than duplicating new copies of said files during the build. kdump(1) and truss(1) now use these functions to map system call identifiers to names. For kdump(1), a new 'syscallname()' function consolidates duplicated code from ktrsyscall() and ktrsyscallret(). The Linux ABI no longer requires custom handling for ktrsyscall() and linux_ktrsyscall() has been removed as a result. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4823 Notes: svn path=/head/; revision=294849
* Add fenv.c for RISC-V. Copied from MIPS.Ruslan Bukin2016-01-261-0/+52
| | | | Notes: svn path=/head/; revision=294833
* Restore flushing of output for revoke(2) again. Document revoke()'sKonstantin Belousov2016-01-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | intended behaviour in its man page. Simplify tty_drain() to match. Don't call ttydevsw methods in tty_flush() if the device is gone since we now sometimes call it then. The flushing was supposed to be implemented by passing the FNONBLOCK flag to VOP_CLOSE() for revoke(). The tty driver is one of the few that can block in close and was one of the fewer that knew about this. This almost worked in FreeBSD-1 and similarly in Net/2. These versions only almost worked because there was and is considerable confusion between IO_NDELAY and FNONBLOCK (aka O_NONBLOCK). IO_NDELAY is only valid for VOP_READ() and VOP_WRITE(). For other VOPs it has the same value as O_SHLOCK. But since vfs_subr.c and tty.c consistently used the wrong flag and the O_SHLOCK flag is rarely set, this mostly worked. It also gave the feature than applications could get the non-blocking close by abusing O_SHLOCK. This was first broken then fixed in 1995. I changed only the tty driver to use FNONBLOCK, as a hack to get non-blocking via the normal flag FNONBLOCK for last closes. I didn't know about revoke()'s use of IO_NDELAY or change it to be consistent, so revoke() was broken. Then I changed revoke() to match. This was next broken in 1997 then fixed in 1998. Importing Lite2 made the flags inconsistent again by undoing the fix only in vfs_subr.c. This was next broken in 2008 by replacing everything in tty.c and not checking any flags in last close. Other bugs in draining limited the resulting unbounded waits to drain in some cases. It is now possible to fix this better using the new FREVOKE flag. Just restore flushing for revoke() for now. Don't restore or undo any hacks for ordinary last closes yet. But remove dead code in the 1-second relative timeout (r272789). This did extra work to extend the buggy draining for revoke() for as long as possible. The 1-second timeout made this not very long by usually flushing after 1 second. Submitted by: bde MFC after: 2 weeks Notes: svn path=/head/; revision=294778
* Replace .CURDIR with SRCTOP to respect LIBC_SRCTOP feature.Bryan Drewery2016-01-251-5/+5
| | | | Notes: svn path=/head/; revision=294745
* Style.Ruslan Bukin2016-01-251-1/+2
| | | | Notes: svn path=/head/; revision=294717
* Do build libproc and librtld_db for RISC-V as well.Ruslan Bukin2016-01-251-1/+1
| | | | Notes: svn path=/head/; revision=294714