aboutsummaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* MFC r336017,r338799Sean Eric Fagan2018-09-291-6/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r336017 This exposes ZFS user and group quotas via the normal quatactl(2) mechanism. (Read-only at this point, however.) In particular, this is to allow rpc.rquotad query quotas for NFS mounts, allowing users to see their quotas on the hosts using the datasets. The changes specifically: * Add new RPC entry points for querying quotas. * Changes the library routines to allow non-UFS quotas. * Changes rquotad to check for quotas on mounted filesystems, rather than being limited to entries in /etc/fstab * Lastly, adds a VFS entry-point for ZFS to query quotas. Note that this makes one unavoidable behavioural change: if quotas are enabled, then they can be queried, as opposed to the current method of checking for quotas being specified in fstab. (With ZFS, if there are user or group quotas, they're used, always.) r338799 Author: kib Fix ZFS VFS op quotactl to follow busy protocol. Approved by: mav Sponsored by: iXsystems, inc Notes: svn path=/stable/11/; revision=339008
* MFC r337992, r338125:Pedro F. Giffuni2018-09-171-37/+54
| | | | | | | | | | | | | | | | POSIX compliance improvements in the pthread(3) functions. This basically adds makes use of the C99 restrict keyword, and also adds some 'const's to four threading functions: pthread_mutexattr_gettype(), pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018. Hinted by: DragonFlyBSD Relnotes: yes Notes: svn path=/stable/11/; revision=338707
* MFC r337983, r338044:Konstantin Belousov2018-08-311-0/+1
| | | | | | | Add pthread_get_name_np(3). Notes: svn path=/stable/11/; revision=338405
* MFC r337981:Konstantin Belousov2018-08-241-3/+3
| | | | | | | Reorder alphabetically. Notes: svn path=/stable/11/; revision=338298
* MFC r337696: Use INCS for non-sys/ libnvpair and libzfs_core includesKyle Evans2018-08-201-6/+0
| | | | | | | | | | | | | | | | While nothing was wrong with libnvpair.h, libzfs_core.h was only guarded by MK_CDDL rather than MK_CDDL && MK_ZFS. Rather than ugl'if'ying include/Makefile to impose the extra restriction, just move the non-sys/ includes into INCS with the respect lib builds. This has the added bonus of allowing third party packagers to try and split these libs out of the FreeBSD-runtime package, if they are so inclined. The sys/ include was left alone- generally userland libraries shouldn't install kernel headers. Notes: svn path=/stable/11/; revision=338080
* MFC r327400 (by eadler):Dimitry Andric2018-07-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cacos(3): correct spelling of 'I' In some cases we had 'i' instead of 'I'. PR: 195517 Submitted by: stephen MFC r329259 (by eadler): msun: signed overflow in atan2 As a component of atan2(y, x), the case of x == 1.0 is farmed out to atan(y). The current implementation of this comparison is vulnerable to signed integer underflow (that is, undefined behavior), and it's performed in a somewhat more complicated way than it need be. Change it to not be quite so cute, rather directly comparing the high/low bits of x to the specific IEEE-754 bit pattern that encodes 1.0. Note that while there are three different e_atan* files in the relevant directory, only this one needs fixing. e_atan2f.c already compares against the full bit pattern encoding 1.0f, while e_atan2l.cuses bitwise-ands/ors/nots and so doesn't require a change. Closes #130 Submitted by: Jeff Walden (@jswalden github PR #130) Reviewed by: bde MFC r334721 (by cem): clog.3, complex.3: Fix typos and igor style issues PR: 228783 Reported by: Karsten <freebsd-bugzilla AT kkoenig.net> MFC r336299 (by mmacy): msun: add ld80/ld128 powl, cpow, cpowf, cpowl from openbsd This corresponds to the latest status (hasn't changed in 9+ years) from openbsd of ld80/ld128 powl, and source cpowf, cpow, cpowl (the complex power functions for float complex, double complex, and long double complex) which are required for C99 compliance and were missing from FreeBSD. Also required for some numerical codes using complex numbered Hamiltonians. Thanks to jhb for tracking down the issue with making weak_reference compile on powerpc. When asked to review, bde said "I don't like it" - but provided no actionable feedback or superior implementations. Discussed with: jhb Submitted by: jmd Differential Revision: https://reviews.freebsd.org/D15919 MFC r336563: Recommit r336497: Fix powl, cpow, cpowf, and cpowl imports from OpenBSD This is a follow-up to r336299. * lib/msun/Makefile: . Remove polevll.c * lib/msun/ld80/e_powl.c: . Copy contents of polevll.c to here. This is the only consumer of these functions. Make functions 'static inline'. . Make reducl a 'static inline' function. * lib/msun/man/exp.3: . Remove BUGS section that no longer applies. * lib/msun/src/math_private.h: . Remove prototypes of __p1evll() and __polevll() * lib/msun/src/s_cpow.c: * lib/msun/src/s_cpowf.c: * lib/msun/src/s_cpowl.c . Include math_private.h. . Use the CMPLX macro from either C99 or math_private.h (depends on compiler support) instead of the problematic use of complex I. Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu> PR: 229876 Notes: svn path=/stable/11/; revision=336767
* MFC r335939, r336088:Konstantin Belousov2018-07-181-0/+1
| | | | | | | Add setproctitle_fast(3) for frequent callers. Notes: svn path=/stable/11/; revision=336449
* MFC r333577:Konstantin Belousov2018-06-051-0/+4
| | | | | | | | | Add implementations for clog(3), clogf(3), and clogl(3). PR: 216863 Notes: svn path=/stable/11/; revision=334654
* MFC r315733, r315737, r315740, r330054:Glen Barber2018-05-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r315733 (imp): Impelemnt ttys onifexists in init. Implement a new init(8) option in /etc/ttys. If this option is present on the entry in /etc/ttys, the entry will be active if and only if it exists. If the name starts with a '/', it will be considered an absolute path. If not, it will be a path relative to /dev. This allows one to turn off video console getty that aren't present (while running a getty on them even when they aren't the system console). Likewise with serial ports. It differs from onifconsole in only requiring the device exist rather than it be listed as one of the system consoles. r315737 (ngie): Unbreak world by adding sys/stat.h for stat(2) r315740 (imp): Simplify the code a little. r330054 (trasz): Improve missing tty handling in init(8). This removes a check that did nothing - it was checking for ENXIO, which, with devfs, is no longer returned - and was badly placed anyway, and replaces it with similar one that works, and is done just before starting getty, instead of being done when rereading ttys(5). From the practical point of view, this makes init(8) handle disappearing terminals (eg /dev/ttyU*) gracefully, without unneccessary getty restarts and resulting error messages. Reported by: Bart Ender, Andre Albsmeier PR: 228315 Blocks: 11.2-BETA2 Approved by: re (marius) Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/11/; revision=333796
* MFC r331936, r331942, r331943, r331945, r331947, r331948Cy Schubert2018-04-181-0/+8
| | | | | | | | | | | | | | | Add new gets_s(3) stdio function. This implements the gets_s(3) function as documented at http://en.cppreference.com/w/c/io/gets. It facilitates the optional removal of gets(3). Reviewed by: ed Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12785 Notes: svn path=/stable/11/; revision=332736
* MFC r331969, r332035:Pedro F. Giffuni2018-04-081-111/+93
| | | | | | | | | | | | | | | | pthread.h: drop nullability attributes. These have been found to be practically useless. We were actually following the Android bionic library and had some interest in replicating the same warnings and behaviour but Android has since removed them. We are still keeping some uses of nullability attributes in other headers, somewhat in line with Apple's libc. Hinted by: bionic (git 3f66e74b903905e763e104396aff52a81718cfde) Notes: svn path=/stable/11/; revision=332308
* MFC r329859,r329860: Float protection in standKyle Evans2018-04-061-0/+2
| | | | | | | | | | | | | | r329859: Do not include float interfaces when using libsa. We don't support float in the boot loaders, so don't include interfaces for float or double in systems headers. In addition, take the unusual step of spiking double and float to prevent any more accidental seepage. r329860: Floaty McFloatface is funnier... Notes: svn path=/stable/11/; revision=332135
* Revert r330897:Eitan Adler2018-03-29135-303/+32
| | | | | | | | | | | | | | | | | | | | This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code. Revert with prejudice. This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes. Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes. Requested by: gjb (re) Notes: svn path=/stable/11/; revision=331722
* Fix buildworld after r331586 by adapting the installation ofHans Petter Selasky2018-03-261-3/+3
| | | | | | | | | | | | | dev/mlx5/mlx5io.h to the build system in FreeBSD 11-stable. This is a direct commit. Found by: jhb@ Pointy hat: hselasky@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=331601
* MFC r330653:Hans Petter Selasky2018-03-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Add kernel and userspace code to dump the firmware state of supported ConnectX-4/5 devices in mlx5core. The dump is obtained by reading a predefined register map from the non-destructive crspace, accessible by the vendor-specific PCIe capability (VSC). The dump is stored in preallocated kernel memory and managed by the mlx5tool(8), which communicates with the driver using a character device node. The utility allows to store the dump in format <address> <value> into a file, to reset the dump content, and to manually initiate the dump. A call to mlx5_fwdump() should be added at the places where a dump must be fetched automatically. The most likely place is right before a firmware reset request. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=331586
* MFC r313818:Eitan Adler2018-03-191-1/+1
| | | | | | | Small inclusion guard comment fix. Notes: svn path=/stable/11/; revision=331190
* Partial merge of the SPDX changesEitan Adler2018-03-14135-32/+303
| | | | | | | | | | These changes are incomplete but are making it difficult to determine what other changes can/should be merged. No objections from: pfg Notes: svn path=/stable/11/; revision=330897
* MFC r326283:Eitan Adler2018-03-081-5/+35
| | | | | | | | | | netconfig.h: sync with upstream. Bring some comments and the license. Add SPDX License ID tag while here. Notes: svn path=/stable/11/; revision=330632
* MFC r328237:Hans Petter Selasky2018-02-071-3/+3
| | | | | | | | | | | | | | | | | | | Use the __alloc_size2 attribute where relevant. This follows the documented use in GCC. It is basically only relevant for calloc(3), reallocarray(3) and mallocarray(9). NOTE: Without this change clang 5.0.1 can produce incorrect optimisation code for static processing of data using the allocated object. For example this has been seen compiling the mlx4 core module, which allocates a fixed size array which is then sorted by a fixed order loop. The optimised result, -O2, is incorrect unless this patch is in place. Suggested by: Mark Millard Reference: https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 Notes: svn path=/stable/11/; revision=328973
* MFC r327697, r327699:Pedro F. Giffuni2018-01-121-1/+1
| | | | | | | | | | | | | | | Use the __result_use_check attribute for reallocf(9). MFC r327751: Use the __result_use_check attribute also for reallocf(3). The GCC attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. Unlike the traditional realloc, with reallocf(3) we don't have to check for NULL values but we still have to make sure the result is used. Notes: svn path=/stable/11/; revision=327883
* Sync (make same) the offsetof macro definition in include/ with theCy Schubert2017-10-291-1/+1
| | | | | | | | | | | | definition of the same in sys/sys/. The problem was discovered while working on implementing a new C11 gets_s() for libc. (The new gets_s() requires rsize_t found in include/stddef.h.) The solution to sync the two definitions was suggested by ed@ while discussing D12667. Suggested by: ed Notes: svn path=/stable/11/; revision=325090
* MFC r320240:Ed Schouten2017-07-221-1/+1
| | | | | | | | | | | | | | | | Use __ISO_C_VISIBLE, as opposed to testing __STDC_VERSION__. FreeBSD's C library uses __STDC_VERSION__ to determine whether the compiler provides language features specific to a certain version of the C standard. __ISO_C_VISIBLE is used to specify which library features need to be exposed. max_align_t currently uses __STDC_VERSION__, even though it should be using __ISO_C_VISIBLE to remain consistent with the rest of the headers in include/. Notes: svn path=/stable/11/; revision=321372
* MFC r318780:Konstantin Belousov2017-06-071-4/+4
| | | | | | | | | Use __BSD_VISIBLE test instead checking for absense of _POSIX_SOURCE. Approved by: re (marius) Notes: svn path=/stable/11/; revision=319651
* MFC r318539 r318580 r318581 r318584 r318749 r318952 r318953 r318955Eric van Gyzen2017-06-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libthr: fix warnings at WARNS=6 Fix warnings about the following when WARNS=6 (which I will commit soon): - casting away const - no previous 'extern' declaration for non-static variable - others as explained by #pragmas and comments - unused parameters libthr: disable thread-safety warnings These warnings don't make sense for code that implements the locking primitives. libthr: change CHECK_AND_INIT_RWLOCK to an inline function This was prompted by a compiler warning about 'ret' shadowing a local variable in the callers of the macro. libthr: Use CLI flags instead of pragmas to disable warnings People tweaking the build system or compilers tend to look into the Makefile and not into the source. Having some warning controls in the Makefile and some in the source code is surprising. Pragmas have the advantage that they leave the warnings enabled for more code, but that advantage isn't very relevant in these cases. libthr: fix warnings from GCC when WARNS=6 Fix warnings about: - redundant declarations - a local variable shadowing a global function (dlinfo) - an old-style function definition (with an empty parameter list) - a variable that is possibly used uninitialized libthr: prevent setcontext() from masking SIGTHR __thr_setcontext() mistakenly tested for the presence of SIGCANCEL in its local ucontext_t instead of the parameter. Therefore, if a thread calls setcontext() with a context whose signal mask contains SIGTHR (a.k.a. SIGCANCEL), that signal will be blocked, preventing the thread from being cancelled or suspended. Sponsored by: Dell EMC Notes: svn path=/stable/11/; revision=319430
* MFC r304106:Xin LI2017-05-311-0/+2
| | | | | | | | | | Add timingsafe_bcmp and timingsafe_memcmp. Obtained from: OpenBSD Reviewed by: trasz Notes: svn path=/stable/11/; revision=319292
* MFC: r312939, r313250, r314811 (partial), r314887 (partial), r315760,Marius Strobl2017-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r315845, 315430, r317981, r315466 o Fix some overly long lines, whitespace and other bugs according to style(9) as well as spelling etc. in mmc(4), mmcsd(4) and sdhci(4). o In the mmc(4) bridges and sdhci(4) (bus) front-ends: - Remove redundant assignments of the default bus_generic_print_child device method, - use DEVMETHOD_END, - use NULL instead of 0 for pointers. o Trim/adjust includes. o Add and use a MMC_DECLARE_BRIDGE macro for declaring mmc(4) bridges as kernel drivers and their dependency onto mmc(4). o Add support for eMMC "partitions". Besides the user data area, i. e. the default partition, eMMC v4.41 and later devices can additionally provide up to: 1 enhanced user data area partition 2 boot partitions 1 RPMB (Replay Protected Memory Block) partition 4 general purpose partitions (optionally with a enhanced or extended attribute) Besides simply subdividing eMMC devices, some Intel NUCs having UEFI code in the boot partitions etc., another use case for the partition support is the activation of pseudo-SLC mode, which manufacturers of eMMC chips typically associate with the enhanced user data area and/ or the enhanced attribute of general purpose partitions. CAVEAT EMPTOR: Partitioning eMMC devices is a one-time operation. o Now that properly issuing CMD6 is crucial (so data isn't written to the wrong partition for example), make a step into the direction of correctly handling the timeout for these commands in the MMC layer. Also, do a SEND_STATUS when CMD6 is invoked with an R1B response as recommended by relevant specifications. o Add an IOCTL interface to mmcsd(4); this is sufficiently compatible with Linux so that the GNU mmc-utils can be ported to and used with FreeBSD (note that due to the remaining deficiencies outlined above SANITIZE operations issued by/with `mmc` currently most likely will fail). These latter have been added to ports as sysutils/mmc-utils. Among others, the `mmc` tool of mmc-utils allows for partitioning eMMC devices (tested working). o For devices following the eMMC specification v4.41 or later, year 0 is 2013 rather than 1997; so correct this for assembling the device ID string properly. o Let mmcsd.ko depend on mmc.ko. Additionally, bump MMC_VERSION as at least for some of the above a matching pair is required. o In the ACPI front-end of sdhci(4) describe the Intel eMMC and SDXC controllers as such in order to match the PCI one. Additionally, in the entry for the 80860F14 SDXC controller remove the eMMC-only SDHCI_QUIRK_INTEL_POWER_UP_RESET. Notes: svn path=/stable/11/; revision=318197
* MFC r315526Eric van Gyzen2017-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Add clock_nanosleep() Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Regenerate syscall files. Relnotes: yes Sponsored by: Dell EMC Notes: svn path=/stable/11/; revision=317618
* MFC r316213:Konstantin Belousov2017-04-233-0/+44
| | | | | | | | | | | Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1. MFC r316258: Only activate __EXT1_VISIBLE block when using sys/errno.h in userspace. Notes: svn path=/stable/11/; revision=317342
* MFC r312934:Pedro F. Giffuni2017-03-145-134/+170
| | | | | | | | | | | | | | | | | | Make use of clang nullability attributes in C headers. Replace uses of the GCC __nonnull__ attribute with the clang nullability qualifiers. These are starting to get use in clang's static analyzer. Replacement should be transparent for developers using clang. GCC ports from older FreeBSD versions may need updating if the compiler was built before r312860 (Jan-27-2017). Hinted by: Apple's Libc-1158.20.4, Bionic libc Relnotes: yes Notes: svn path=/stable/11/; revision=315282
* MFC r314179 r314206 r314424Eric van Gyzen2017-03-141-0/+4
| | | | | | | | | | | | | | | | | | | | Add sem_clockwait_np() This function allows the caller to specify the reference clock and choose between absolute and relative mode. In relative mode, the remaining time can be returned. The API is similar to clock_nanosleep(3). Thanks to Ed Schouten for that suggestion. While I'm here, reduce the sleep time in the semaphore "child" test to greatly reduce its runtime. Also add a reasonable timeout. Relnotes: yes Sponsored by: Dell EMC Notes: svn path=/stable/11/; revision=315274
* MFC r313819:Pedro F. Giffuni2017-02-191-1/+1
| | | | | | | | | | Remove outdated claim. Despite wishful thinking the removal of these old functions hasn't happened yet. Notes: svn path=/stable/11/; revision=313970
* MFC r310630: libkvm: support access to vmm guest memory, allow writes toAndriy Gapon2017-01-181-0/+1
| | | | | | | | | fwmem and vmm Sponsored by: Panzura Notes: svn path=/stable/11/; revision=312381
* MFC 310048,310101,310239Sepherosa Ziehau2017-01-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 310048 hyperv: Implement "enlightened" time counter, which is rdtsc based. Reviewed by: kib Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8763 310101 hyperv: Allow userland to ro-mmap reference TSC page This paves way to implement VDSO for the enlightened time counter. Reviewed by: kib Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8768 310239 hyperv: Implement userspace gettimeofday(2) with Hyper-V reference TSC This 6 times gettimeofday performance, as measured by tools/tools/syscall_timing Reviewed by: kib Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8789 Notes: svn path=/stable/11/; revision=311376
* MFC 308664,308742,308743Sepherosa Ziehau2017-01-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 308664 hyperv/vss: Add driver and tools for VSS VSS stands for "Volume Shadow Copy Service". Unlike virtual machine snapshot, it only takes snapshot for the virtual disks, so both filesystem and applications have to aware of it, and cooperate the whole VSS process. This driver exposes two device files to the userland: /dev/hv_fsvss_dev Normally userland programs should _not_ mess with this device file. It is currently used by the hv_vss_daemon(8), which freezes and thaws the filesystem. NOTE: currently only UFS is supported, if the system mounts _any_ other filesystems, the hv_vss_daemon(8) will veto the VSS process. If hv_vss_daemon(8) was disabled, then this device file must be opened, and proper ioctls must be issued to keep the VSS working. /dev/hv_appvss_dev Userland application can opened this device file to receive the VSS freeze notification, hold the VSS for a while (mainly to flush application data to filesystem), release the VSS process, and receive the VSS thaw notification i.e. applications can run again. The VSS will still work, even if this device file is not opened. However, only filesystem consistency is promised, if this device file is not opened or is not operated properly. hv_vss_daemon(8) is started by devd(8) by default. It can be disabled by editting /etc/devd/hyperv.conf. Submitted by: Hongjiang Zhang <honzhan microsoft com> Reviewed by: kib, mckusick Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8224 308742 hyperv/vss: Nuke unused variables. Submitted by: markj Reported by: markj Sponsored by: Microsoft 308743 hyperv/vss: Install the userland daemon to /usr/sbin instead of / Submitted by: markj Reported by: markj Sponsored by: Microsoft Notes: svn path=/stable/11/; revision=311353
* MFC r311012Pedro F. Giffuni2017-01-043-87/+68
| | | | | | | | | | | | | | | Remove some uses of the GCC __nonnull() attribute. While the checks are considered useful, the attribute does dangerous optimizations, removing NULL checks where they can be needed. Remove the uses of this attribute introduced in r281130: the changes were inspired on Google's bionic where this attribute is not used anymore. In general, the __nonnull() attribute has fulfilled its roll and will be replaced with the Clang _Nonnull qualifier in the future. Notes: svn path=/stable/11/; revision=311234
* MFC 309274:John Baldwin2016-12-161-1/+1
| | | | | | | Use the correct name for the GCC macro indicating max_align_t is defined. Notes: svn path=/stable/11/; revision=310134
* MFC 307756: Define max_align_t for C11.John Baldwin2016-11-281-0/+8
| | | | | | | | | | | | | | libc++'s stddef.h includes an existing definition of max_align_t for C++11, but it is only defined for C++, not for C. In addition, GCC and clang both define an alternate version of max_align_t that uses a union of multiple types rather than a plain long double as in libc++. This adds a __max_align_t to <sys/_types.h> that matches the GCC and clang definition that is mapped to max_align_t in <stddef.h>. PR: 210890 Notes: svn path=/stable/11/; revision=309258
* MFC r307227 and r307343:Ed Schouten2016-10-291-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Improve typing of POSIX search tree functions. Back in 2015 when I reimplemented these functions to use an AVL tree, I was annoyed by the weakness of the typing of these functions. Both tree nodes and keys are represented by 'void *', meaning that things like the documentation for these functions are an absolute train wreck. To make things worse, users of these functions need to cast the return value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to access the key. Technically speaking such casts violate aliasing rules. I've observed actual breakages as a result of this by enabling features like LTO. I've filed a bug report at the Austin Group. Looking at the way the bug got resolved, they made a pretty good step in the right direction. A new type 'posix_tnode' has been added to correspond to tree nodes. It is still defined as 'void' for source-level compatibility, but in the very far future it could be replaced by a proper structure type containing a key pointer. Notes: svn path=/stable/11/; revision=308090
* MFC r307131: install header files required development with libzfs_coreAndriy Gapon2016-10-281-0/+11
| | | | Notes: svn path=/stable/11/; revision=308043
* MFC r305706, r305749, r306274Oleksandr Tymoshenko2016-10-221-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r305706: Add evdev protocol implementation evdev is a generic input event interface compatible with Linux evdev API at ioctl level. It allows using unmodified (apart from header name) input evdev drivers in Xorg, Wayland, Qt. This commit has only generic kernel API. evdev support for individual hardware drivers like ukbd, ums, atkbd, etc. will be committed later. Project was started by Jakub Klama as part of GSoC 2014. Jakub's evdev implementation was later used as a base, updated and finished by Vladimir Kondratiev. Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru> Reviewed by: adrian, hans Differential Revision: https://reviews.freebsd.org/D6998 r305749: Remove semicolon from the end of the macro definition Reported by: hans r306274: Handle NULL argument in evdev_free Add check for evdev argument of evdev_free being NULL. This is valid value and should not cause crash. In this case evdev_free does nothing Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru> Notes: svn path=/stable/11/; revision=307760
* MFC r306588:Konstantin Belousov2016-10-092-1/+4
| | | | | | | Export the mq_getfd_np() and timer_oshandle_np() symbols from librt.so. Notes: svn path=/stable/11/; revision=306905
* MFC r306568, r306569Eric van Gyzen2016-10-081-2/+2
| | | | | | | | | | Add the __printflike attribute to the declarations of dprintf(3) and vdprintf(3). Sponsored by: Dell EMC Notes: svn path=/stable/11/; revision=306845
* MFC r304176:Konstantin Belousov2016-08-291-0/+1
| | | | | | | Add a trivial implementation of fdatasync(2). Notes: svn path=/stable/11/; revision=304977
* MFC r304703, r304755Andrey A. Chernov2016-08-261-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1) _locale.h LC_*_MASK bit shifting order was partially broken from the initial commit time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the right order. The order here should match XLC_* from "xlocale_private.h" which, in turn, match LC_* publicly visible order from <locale.h> which determines how locale components are stored in the structure. LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale() and equivalent shift loop in the newlocale(), so mapped to some wrong components (excluding two mentioned above). Formally the fix is ABI breakage, but old code using those masks never works properly in any case. Only newlocale() and querylocale() are affected. 2) msgcat.c Use current locale (f.e. set by thread). It was global locale always previously. PR: 211743 Notes: svn path=/stable/11/; revision=304863
* Remove incorrect attributes from posix_memalign(3) declaration.Pedro F. Giffuni2016-07-051-2/+1
| | | | | | | | | | | | | | | | Both __alloc_align and __alloc_size can't be used when the function returns a pointer to memory. This fixes breakage when building with clang 3.4: In file included from /usr/src/svn/usr.sbin/bhyve/atkbdc.c:40: /usr/include/stdlib.h:176:6: error: '__alloc_size__' attribute only applies to functions that return a pointer [-Werror,-Wignored-attributes] Pointed out by: ngie, cem Approved by: re (gjb) Notes: svn path=/head/; revision=302358
* Commit the bits of nda that were missed. This should fix the build.Warner Losh2016-06-101-1/+1
| | | | | | | Approved by: re@ Notes: svn path=/head/; revision=301778
* Implement an NSS backend for netgroups and add getnetgrent_r(3).Mark Johnston2016-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | This support appears to have been documented in nsswitch.conf(5) for some time. The implementation adds two NSS netgroup providers to libc. The default, compat, provides the behaviour documented in netgroup(5), so this change does not make any user-visible behaviour changes. A files provider is also implemented. innetgr(3) is implemented as an optional NSS method so that providers such as NIS which are able to implement efficient reverse lookup can do so. A fallback implementation is used otherwise. getnetgrent_r(3) is added for convenience and to provide compatibility with glibc and Solaris. With a small patch to net/nss_ldap, it's possible to specify an ldap netgroup provider, allowing one to query nisNetgroupTriple entries. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=301711
* Fix prototype of dbm_open().Ed Schouten2016-05-311-1/+1
| | | | | | | | | | | The last argument of dbm_open() should be a mode_t according to POSIX; not an int. Reviewed by: pfg, kib Differential Revision: https://reviews.freebsd.org/D6650 Notes: svn path=/head/; revision=301066
* Make strfmon_l() work without requiring the use of <xlocale.h>.Ed Schouten2016-05-311-1/+1
| | | | | | | | | | | | The strfmon_l() function provided by <xlocale/_monetary.h> is also part of POSIX 2008's <monetary.h>, so it should be exposed by default. Change the check used in <monetary.h> to be similar to the one that's part of <wchar.h>, where we both test for __POSIX_VISIBLE and _XLOCALE_H_. Notes: svn path=/head/; revision=301035
* Let dbm's datum::dptr use the right type.Ed Schouten2016-05-301-1/+1
| | | | | | | | | | | | According to POSIX, it should use void *, not char *. Unfortunately, the dsize field also has the wrong type. It should be size_t. I'm not going to change that, as that will break the ABI. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D6647 Notes: svn path=/head/; revision=300999