summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* MFC 309274:jhb2016-12-161-1/+1
| | | | Use the correct name for the GCC macro indicating max_align_t is defined.
* MFC 307756: Define max_align_t for C11.jhb2016-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
* MFC r307227 and r307343:ed2016-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.
* MFC r307131: install header files required development with libzfs_coreavg2016-10-281-0/+11
|
* MFC r305706, r305749, r306274gonzo2016-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>
* MFC r306588:kib2016-10-092-1/+4
| | | | Export the mq_getfd_np() and timer_oshandle_np() symbols from librt.so.
* MFC r306568, r306569vangyzen2016-10-081-2/+2
| | | | | | | Add the __printflike attribute to the declarations of dprintf(3) and vdprintf(3). Sponsored by: Dell EMC
* MFC r304176:kib2016-08-291-0/+1
| | | | Add a trivial implementation of fdatasync(2).
* MFC r304703, r304755ache2016-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
* Remove incorrect attributes from posix_memalign(3) declaration.pfg2016-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)
* Commit the bits of nda that were missed. This should fix the build.imp2016-06-101-1/+1
| | | | Approved by: re@
* Implement an NSS backend for netgroups and add getnetgrent_r(3).markj2016-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
* Fix prototype of dbm_open().ed2016-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
* Make strfmon_l() work without requiring the use of <xlocale.h>.ed2016-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_.
* Let dbm's datum::dptr use the right type.ed2016-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
* Add missing va_list to <wchar.h>.ed2016-05-301-0/+7
| | | | | It looks like va_list should always be defined when XSI is enabled. It moved over to the POSIX base in the 2008 edition.
* Fix the signature of the psignal() function.ed2016-05-301-1/+1
| | | | | | | | POSIX 2008 added the psignal() function which has already been part of the BSDs for a long time. The only difference is, the POSIX version uses an 'int' for the signal number, unlike our version which uses an 'unsigned int'. Fix up the function to use an 'int'. This should not affect the ABI.
* Add missing types and constants to <netdb.h>.ed2016-05-301-0/+12
| | | | | | According to POSIX, the netdb.h header must also provide in_addr_t and in_port_t. It should also provide IPPORT_RESERVED. Copy over the necessary bits from <netinet/in.h> to achieve that.
* Add missing declaration of ino_t.ed2016-05-301-1/+9
| | | | | | POSIX requires that <dirent.h> provides ino_t in the XSI case. In our case, this wasn't being exposed, as d_ino is a macro that expands to d_fileno that is an uint32_t, not an ino_t.
* Fix style of the libgen.h header.ed2016-05-291-10/+2
| | | | | | - Remove unneeded declarations of removed/unimplemented features. - Add missing tab after #define. - Add missing ! before trailing comment.
* WITH_META_MODE: Disable cookie handling for include installation.bdrewery2016-05-211-3/+3
| | | | | | | | | | | | | | | Using a cookie with meta mode causes it to *not rerun* (as normal make does) unless the command changes or filemon-detected files change. After all of the work done here it turns out that skipping installation is dangerous since the install commands use <dir>/*.h. The actual build command is not changing but the files installed are changing by the mere act of adding a new header into the source tree. Thus we cannot safely use meta mode logic here. It must always rerun and install the headers. The install -C flag at least prevents churning timestamps when installing a header that was already present. Sponsored by: EMC / Isilon Storage Division
* Add implementation of robust mutexes, hopefully close enough to thekib2016-05-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013. A robust mutex is guaranteed to be cleared by the system upon either thread or process owner termination while the mutex is held. The next mutex locker is then notified about inconsistent mutex state and can execute (or abandon) corrective actions. The patch mostly consists of small changes here and there, adding neccessary checks for the inconsistent and abandoned conditions into existing paths. Additionally, the thread exit handler was extended to iterate over the userspace-maintained list of owned robust mutexes, unlocking and marking as terminated each of them. The list of owned robust mutexes cannot be maintained atomically synchronous with the mutex lock state (it is possible in kernel, but is too expensive). Instead, for the duration of lock or unlock operation, the current mutex is remembered in a special slot that is also checked by the kernel at thread termination. Kernel must be aware about the per-thread location of the heads of robust mutex lists and the current active mutex slot. When a thread touches a robust mutex for the first time, a new umtx op syscall is issued which informs about location of lists heads. The umtx sleep queues for PP and PI mutexes are split between non-robust and robust. Somewhat unrelated changes in the patch: 1. Style. 2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared pi mutexes. 3. Removal of the userspace struct pthread_mutex m_owner field. 4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls the lifetime of the shared mutex associated with a vnode' page. Reviewed by: jilles (previous version, supposedly the objection was fixed) Discussed with: brooks, Martin Simmons <martin@lispworks.com> (some aspects) Tested by: pho Sponsored by: The FreeBSD Foundation
* stdio.h: Fix function-type typedef style and use _types.h __ssize_tcem2016-05-121-4/+4
| | | | | | | | | | | | I'm still not sure why only Pypy runs into the error with the function typedefs. Fix it anyway. Use __ssize_t instead of ssize_t for the types; it's possible for the size_t type to not be visible if at the wrong POSIX_VISIBLE level. A final (crossing my fingers) follow-up to r299456. Sponsored by: EMC / Isilon Storage Division
* Pollute more places with off64_t and add __off64_tcem2016-05-121-1/+1
| | | | | | | | | | | Despite the private namespace, several broken ports depend on the __off64_t name for the type. Export it exactly the same way off_t and __off_t are exported. A follow-up to r299456. Suggested by: php56 Sponsored by: EMC / Isilon Storage Division
* libc: Add fopencookie(3) wrapper around funopen(3)cem2016-05-111-0/+17
| | | | | | Reviewed by: jhb, oshogbo Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6282
* Improve performance and functionality of the bitstring(3) apiasomers2016-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which allow for efficient searching of set or cleared bits starting from any bit offset within the bit string. Performance is improved by operating on longs instead of bytes and using ffsl() for searches within a long. ffsl() is a compiler builtin in both clang and gcc for most architectures, converting what was a brute force while loop search into a couple of instructions. All of the bitstring(3) API continues to be contained in the header file. Some of the functions are large enough that perhaps they should be uninlined and moved to a library, but that is beyond the scope of this commit. sys/sys/bitstring.h: Convert the majority of the existing bit string implementation from macros to inline functions. Properly protect the implementation from inadvertant macro expansion when included in a user's program by prefixing all private macros/functions and local variables with '_'. Add bit_ffs_at() and bit_ffc_at(). Implement bit_ffs() and bit_ffc() in terms of their "at" counterparts. Provide a kernel implementation of bit_alloc(), making the full API usable in the kernel. Improve code documenation. share/man/man3/bitstring.3: Add pre-exisiting API bit_ffc() to the synopsis. Document new APIs. Document the initialization state of the bit strings allocated/declared by bit_alloc() and bit_decl(). Correct documentation for bitstr_size(). The original code comments indicate the size is in bytes, not "elements of bitstr_t". The new implementation follows this lead. Only hastd assumed "elements" rather than bytes and it has been corrected. etc/mtree/BSD.tests.dist: tests/sys/Makefile: tests/sys/sys/Makefile: tests/sys/sys/bitstring.c: Add tests for all existing and new functionality. include/bitstring.h Include all headers needed by sys/bitstring.h lib/libbluetooth/bluetooth.h: usr.sbin/bluetooth/hccontrol/le.c: Include bitstring.h instead of sys/bitstring.h. sbin/hastd/activemap.c: Correct usage of bitstr_size(). sys/dev/xen/blkback/blkback.c Use new bit_alloc. sys/kern/subr_unit.c: Remove hard-coded assumption that sizeof(bitstr_t) is 1. Get rid of unrb.busy, which caches the number of bits set in unrb.map. When INVARIANTS are disabled, nothing needs to know that information. callapse_unr can be adapted to use bit_ffs and bit_ffc instead. Eliminating unrb.busy saves memory, simplifies the code, and provides a slight speedup when INVARIANTS are disabled. sys/net/flowtable.c: Use the new kernel implementation of bit-alloc, instead of hacking the old libc-dependent macro. sys/sys/param.h Update __FreeBSD_version to indicate availability of new API Submitted by: gibbs, asomers Reviewed by: gibbs, ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6004
* include: minor spelling fixes.pfg2016-04-302-2/+2
| | | | No functional change.
* MFHgjb2016-04-161-8/+8
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * Rework META_TARGETS so that it automatically adds META_DEPS to the targets.bdrewery2016-04-141-8/+8
| | | | | | | | | | | | | | | | This will only be done if the target is defined, so if the target is defined after bsd.sys.mk is included then it needs to manually add ${META_DEPS} still. Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-04-042-1/+2
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * For C++, expose long long types and functions (lldiv_t, llabs, lldiv,dim2016-03-231-1/+1
| | | | | | | | | | | | | | etc) in stdlib.h. These will be needed for newer versions of libc++, which uses them for defining overloaded versions of abs() and div(). MFC after: 1 week
| * Implement suggestion by jhb@ to have _PATH_FIRMWARE instead of hardimp2016-03-231-0/+1
| | | | | | | | coding it to be "/usr/share/firmware".
* | MFHgjb2016-03-141-33/+5
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * META_MODE: Simplify the META_COOKIE handling to use .USE/.USEBEFORE.bdrewery2016-03-111-10/+4
| | | | | | | | | | | | | | Extend it to other cases of meta mode cookies so they get the proper rm cookie behavior when a .meta file detects it needs to rebuild and fails. Sponsored by: EMC / Isilon Storage Division
| * DIRDEPS_BUILD: None of this is needed anymore.bdrewery2016-03-111-22/+2
| | | | | | | | | | | | | | | | | | This file is using stage-install, so all of the .dirdep files are properly handled. The cookie handling also properly handles rebuilds with .meta files. DESTDIR from bsd.sys.mk is also respected for staging. This logic came in r239572. Sponsored by: EMC / Isilon Storage Division
| * DIRDEPS_BUILD: Remove the cookie when target is out-of-date.bdrewery2016-03-111-9/+7
| | | | | | | | | | | | | | | | | | | | | | The meta file may decide the target is out of date but nothing ensures that the *next* build will build this target if it fails this time for some reason; it is still out-of-date until it succeeds. Convert the include/ cookie usage to the global versions. Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-062-9/+6
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * xdr: Fix xdr_rpc* defines.pfg2016-03-041-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The defines for xdr_rpc* in xdr.h are wrong. It could be very well that Solaris did strip the '_t' from xdr_u_int32_t, but Solaris has a xdr_u_int32 function, we don't have this. So all of this defines will lead to an unresolved symbol. This explains why we do not use these functions in FreeBSD while they are used in Illumos/Solaris. Obtained from: linux libtirpc (git 7864122e61ffe4db1aa8ace89117358a1e3a391b) MFC after: 3 weeks
| * Add sunrpc compat define for xp_sock.pfg2016-03-031-0/+1
| | | | | | | | | | | | | | | | | | SunRPC is using xp_sock in SVCXPRT, while TI-RPC is using xp_fd. Add a compatibility define. Illumos has something similar for the non-kernel case. Obtained from: linux-nfs project (git 0d94036c3a0d4c24d22bf6a8c40ac6625d972c29)
* | MFHgjb2016-03-024-3/+10
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Update jemalloc to 4.1.0.jasone2016-02-291-0/+7
| | | | | | | | | | | | | | | | | | | | Add missing Symbol.map entry for __aligned_alloc. Add weak-->strong symbol binding for {malloc_stats_print,mallctl,mallctlnametomib,mallctlbymib} --> {__malloc_stats_print,__mallctl,__mallctlnametomib,__mallctlbymib}. These bindings complete the set necessary to allow applications to replace all malloc-related symbols.
| * Implement process-shared locks support for libthr.so.3, withoutkib2016-02-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | breaking the ABI. Special value is stored in the lock pointer to indicate shared lock, and offline page in the shared memory is allocated to store the actual lock. Reviewed by: vangyzen (previous version) Discussed with: deischen, emaste, jhb, rwatson, Martin Simmons <martin@lispworks.com> Tested by: pho Sponsored by: The FreeBSD Foundation
| * RPC: update the getrpcbyname() definition to include a const qualifier.pfg2016-02-261-1/+1
| | | | | | | | | | | | | | Add const qualifier making getrpcbyname() and getrpcbyname_r() prototypes match those used in latest Sun RPC code (TI-RPC 2.3). Obtained from: NetBSD
* | MFHgjb2016-02-151-1/+4
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Hide ucontext_t and mcontext_t when neither POSIX nor XSI features arekib2016-02-131-0/+2
| | | | | | | | | | | | | | | | | | enabled in the compilation environment, i.e. for ANSI C use of #include <signal.h>. Requested and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 13 days
| * POSIX states that #include <signal.h> shall make both mcontext_t andkib2016-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ucontext_t available. Our code even has XXX comment about this. Add a bit of compliance by moving struct __ucontext definition into sys/_ucontext.h and including it into signal.h and sys/ucontext.h. Several machine/ucontext.h headers were changed to use namespace-safe types (like uint64_t->__uint64_t) to not depend on sys/types.h. struct __stack_t from sys/signal.h is made always visible in private namespace to satisfy sys/_ucontext.h requirements. Apparently mips _types.h pollutes global namespace with f_register_t type definition. This commit does not try to fix the issue. PR: 207079 Reported and tested by: Ting-Wei Lan <lantw44@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | Ensure include/ is properly tagged in the METALOG.gjb2016-02-081-41/+43
|/ | | | | Noticed by: des Sponsored by: The FreeBSD Foundation
* Provide new socket option TCP_CCALGOOPT, which stands for TCP congestionglebius2016-01-221-0/+1
| | | | | | | | | | | | | | | control algorithm options. The argument is variable length and is opaque to TCP, forwarded directly to the algorithm's ctl_output method. Provide new includes directory netinet/cc, where algorithm specific headers can be installed. The new API doesn't yet have any in tree consumers. The original code written by lstewart. Reviewed by: rrs, emax Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D711
* - Add the definition of CHARCLASS_NAME_MAX, as per POSIX.1-2001.kevlo2016-01-091-2/+5
| | | | | | | | - Avoid namespace pollution and move definitions of _POSIX2_CHARCLASS_NAME_MAX and _POSIX2_COLL_WEIGHTS_MAX into the .2001 section. With input from bde. Submitted by bde
* Add sbin and /usr/local directories to _PATH_DEFPATH.jilles2016-01-051-2/+2
| | | | | | | | | | | | | | | | | Set _PATH_DEFPATH to /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the path in the default class in the default /etc/login.conf, excluding ~/bin which would not be expanded properly in a string constant. For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf, ~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and by cron. Especially the latter is a common trap (most recently in PR 204813). PR: 204813 Reviewed by: secteam (delphij), alfred
OpenPOWER on IntegriCloud