summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Replace implementation of hsearch() by one that scales.ed2015-12-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally the hcreate() function creates a hash table that uses chaining, using a fixed user-provided size. The problem with this approach is that this often either wastes memory (table too big) or yields bad performance (table too small). For applications it may not always be easy to estimate the right hash table size. A fixed number only increases performance compared to a linked list by a constant factor. This problem can be solved easily by dynamically resizing the hash table. If the size of the hash table is at least doubled, this has no negative on the running time complexity. If a dynamically sized hash table is used, we can also switch to using open addressing instead of chaining, which has the advantage of just using a single allocation for the entire table, instead of allocating many small objects. Finally, a problem with the existing implementation is that its deterministic algorithm for hashing makes it possible to come up with fixed patterns to trigger an excessive number of collisions. We can easily solve this by using FNV-1a as a hashing algorithm in combination with a randomly generated offset basis. Measurements have shown that this implementation is about 20-25% faster than the existing implementation (even if the existing implementation is given an excessive number of buckets). Though it allocates more memory through malloc() than the old implementation (between 4-8 pointers per used entry instead of 3), process memory use is similar to the old implementation as if the estimated size was underestimated by a factor 10. This is due to the fact that malloc() needs to perform less bookkeeping. Reviewed by: jilles, pfg Obtained from: https://github.com/NuxiNL/cloudlibc Differential Revision: https://reviews.freebsd.org/D4644
* Let tsearch()/tdelete() use an AVL tree.ed2015-12-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing implementations of POSIX tsearch() and tdelete() don't attempt to perform any balancing at all. Testing reveals that inserting 100k nodes into a tree sequentially takes approximately one minute on my system. Though most other BSDs also don't use any balanced tree internally, C libraries like glibc and musl do provide better implementations. glibc uses a red-black tree and musl uses an AVL tree. Red-black trees have the advantage over AVL trees that they only require O(1) rotations after insertion and deletion, but have the disadvantage that the tree has a maximum depth of 2*log2(n) instead of 1.44*log2(n). My take is that it's better to focus on having a lower maximum depth, for the reason that in the case of tsearch() the invocation of the comparator likely dominates the running time. This change replaces the tsearch() and tdelete() functions by versions that create an AVL tree. Compared to musl's implementation, this version is different in two different ways: - We don't keep track of heights; just balances. This is sufficient. This has the advantage that it reduces the number of nodes that are being accessed. Storing heights requires us to also access all of the siblings along the path. - Don't use any recursion at all. We know that the tree cannot 2^64 elements in size, so the height of the tree can never be larger than 96. Use a 128-bit bitmask to keep track of the path that is computed. This allows us to iterate over the same path twice, meaning we can apply rotations from top to bottom. Inserting 100k nodes into a tree now only takes 0.015 seconds. Insertion seems to be twice as fast as glibc, whereas deletion has about the same performance. Unlike glibc, it uses a fixed amount of memory. I also experimented with both recursive and iterative bottom-up implementations of the same algorithm. This iterative top-down version performs similar to the recursive bottom-up version in terms of speed and code size. For some reason, the iterative bottom-up algorithm was actually 30% faster for deletion, but has a quadratic memory complexity to keep track of all the parent pointers. Reviewed by: jilles Obtained from: https://github.com/NuxiNL/cloudlibc Differential Revision: https://reviews.freebsd.org/D4412
* addrinfo.ai_family is an address family, not a protocol family.ume2015-12-201-1/+1
| | | | | PR: 162434 MFC after: 1 week
* Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3).ume2015-12-181-1/+1
| | | | | | | We need to change netdb.h to make it actually enabled. PR: 198092 MFC after: 1 week
* resolver: preserve binary compatibility; reduce header pollutionvangyzen2015-12-141-5/+1
| | | | | | | | | | | | | | In r289315, I added new fields to res_state. This broke binary backward compatibility. It also broke some ports (and possibly other code) by requiring the definition of time_t and struct timespec. Fix these problems by moving the new fields into __res_state_ext. Suggested by: ume Reviewed by: ume MFC after: 3 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D4472
* resolver: fix the build of some ports, broken by r289315vangyzen2015-12-081-0/+1
| | | | | | | | | | | r289315 required time_t and struct timespec to be defined before including <resolv.h>. This broke the build of net-mgmt/sx, at least. Include <sys/timespec.h> in resolv.h to fix this with minimal pollution. Reported by: Raphael Kubo da Costa <rakuco> MFC after: 3 days Sponsored by: Dell Inc.
* Move obscure lib/ installation of /usr/lib/include symlink to include/.bdrewery2015-12-041-0/+2
| | | | | | | | | This avoids the need for an afterinstall: hook and a check for LIBRARIES_ONLY. It also now respects INCLUDEDIR. This came in r249484. Sponsored by: EMC / Isilon Storage Division
* Replace ln -s calls with INSTALL_SYMLINKbdrewery2015-12-041-18/+18
| | | | Sponsored by: EMC / Isilon Storage Division
* Stop building vers.c in include/ and only build the needed osreldate.h.bdrewery2015-11-252-8/+4
| | | | | | | | | | | | | Because of how osreldate.h was being built with newvers.sh, which always spat out a vers.c dependent on SVN or git, the meta mode build was considering osreldate.h to depend on the current git or SVN index. This would lead to entire tree rebuilds when modifying git's index. There's no reason to be generating vers.c here so just skip it. While here, in mk-osreldate.sh rename PARAM_H to proper PARAMFILE (which newvers.sh already has a default for) and remove unneeded export. Sponsored by: EMC / Isilon Storage Division
* META MODE: Fix changing what "MACHINE=host" means when computing dirdeps for ↵bdrewery2015-11-181-1/+1
| | | | | | | | | | | | | include/. The _SKIP_BUILD is used while computing DIRDEPS. If MACHINE=host is passed in then this logic was replacing 'MACHINE' with a literal value of the host arch, which then caused the dirdeps graph to be wrong since it no longer had the literal 'host' for any of include's dependencies. This is a NOP currently since include/ is not usually built with MACHINE=host. Sponsored by: EMC / Isilon Storage Division
* Rename META_MODE option to DIRDEPS_BUILDsjg2015-11-141-3/+3
| | | | | | | | | This allows META_FILES option to be renamed META_MODE. Also add META_COOKIE_TOUCH for use in targets that can benefit from a cookie when in meta mode. Differential Revision: https://reviews.freebsd.org/D4153 Reviewed by: bdrewery
* Merge from head r290483bapt2015-11-071-2/+2
|\
| * Rename __sentinel to __null_sentinelpfg2015-11-051-2/+2
| | | | | | | | | | | | GCC 5 uses a conflicting __sentinel definition in include/c++/bits/stl_algo.h Reported by: matteo
* | Merge from headbapt2015-11-011-0/+3
|\ \ | |/
| * Add _flags2 per jhb@ suggestion since no room left in _flags.ache2015-10-281-0/+3
| | | | | | | | | | | | Rewrite O_APPEND flag checking using new __S2OAP flag. MFC after: 3 weeks
* | Merge from headbapt2015-10-192-1/+5
|\ \ | |/
| * Add more SUBDIR_PARALLEL.bdrewery2015-10-151-0/+1
| | | | | | | | | | MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division
| * resolver: automatically reload /etc/resolv.confvangyzen2015-10-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On each resolver query, use stat(2) to see if the modification time of /etc/resolv.conf has changed. If so, reload the file and reinitialize the resolver library. However, only call stat(2) if at least two seconds have passed since the last call to stat(2), since calling it on every query could kill performance. This new behavior is enabled by default. Add a "reload-period" option to disable it or change the period of the test. Document this behavior and option in resolv.conf(5). Polish the man page just enough to appease igor. https://lists.freebsd.org/pipermail/freebsd-arch/2015-October/017342.html Reviewed by: kp, wblock Discussed with: jilles, imp, alfred MFC after: 1 month Relnotes: yes Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D3867
* | Commit log from Dragonfly:bapt2015-10-134-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD extended ctypes to include numbers (e.g. isnumber()) but never actually implemented it. The isnumber() function was equivalent to the isdigit() function in every case. Now that DragonFly's ctype source files have number definitions, the number ctype can finally be implemented. It's given a new flag _CTYPE_N. The isalnum() and iswalnum() functions have been changed to use this flag rather than the _CTYPE_D digit flag. While isalnum(), isnumber(), and their wide equivalents now return different values in locale cases, the ishexnumber() and iswhexnumber() functions are unchanged. They are still aliases for isxdigit() and iswxdigit(). Also change ctype.h for isdigit and isxdigit to use sbistype like the other functions. Obtained from: dragonfly
* | Merge from headbapt2015-10-131-9/+9
|\ \ | |/
| * Mute this cookie as wellbdrewery2015-10-031-1/+1
| |
| * Avoid make compatibility mode issues with creating cookies from r287844 and ↵bdrewery2015-10-031-5/+3
| | | | | | | | | | | | | | | | r287848. Also hide the cookie creation. Suggested by: imp, Daniel O'Connor
| * META_MODE: Avoid command changing in 2nd build.bdrewery2015-09-181-6/+6
| | | | | | | | | | | | | | | | | | If the command to be ran changes then a rebuild is caused. Checking exists(${DESTDIR}...) from make results in this on the 2nd and possibly subsequent builds due to staging during build. Avoid this by always running the existence check in the make sh command. Sponsored by: EMC / Isilon Storage Division
| * Similar to r287844, create 'symlinks' cookie in proper place with -j and ↵bdrewery2015-09-161-0/+1
| | | | | | | | | | | | META_MODE. Sponsored by: EMC / Isilon Storage Division
| * Create 'copies' cookie in proper place in META_MODE.bdrewery2015-09-161-0/+1
| | | | | | | | | | | | With -j the cookie would be created in CURDIR/sys/teken rather than OBJDIR. Sponsored by: EMC / Isilon Storage Division
* | Merge from HEADbapt2015-08-251-28/+30
|\ \ | |/
| * Use bool rather than _Bool for C++ compatibility.jasone2015-08-191-8/+8
| | | | | | | | Submitted by: Nikolai Lifanov
| * Fix minor malloc regressions.jasone2015-08-191-7/+8
| | | | | | | | | | | | | | | | - Use _Bool rather than bool to resolve missing type errors in malloc_np.h. - Fix malloc manual page #include documentation. - Add *allocm manual pages to obsolete files. Submitted by: jbeich
| * Update jemalloc to version 4.0.0.jasone2015-08-181-28/+29
| |
* | Merge from HEADbapt2015-08-091-1/+1
|/
* Use the __sentinel attribute.pfg2015-07-081-2/+2
| | | | | | | | Start using the gcc sentinel attribute, which can be used to mark varargs function that need a NULL pointer to mark argument termination, like execl(3). Relnotes: yes
* Add fdclose(3) function.oshogbo2015-07-041-0/+1
| | | | | | | | | | This function is equivalent to fclose(3) function except that it does not close the underlying file descriptor. fdclose(3) is step forward to make FILE structure private. Reviewed by: wblock, jilles, jhb, pjd Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D2697
* new dependssjg2015-06-161-0/+1
|
* Add META_MODE support.sjg2015-06-139-3/+118
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-087-14/+0
| |
| * Merge sync of headsjg2015-05-279-140/+157
| |\
| * | update dependenciessjg2014-11-301-1/+0
| | |
| * | Merge from head@274682sjg2014-11-1913-99/+230
| |\ \
| * \ \ Merge head from 7/28sjg2014-08-1916-27/+101
| |\ \ \
| * | | | Actually avoid stage_includes targetsjg2014-05-161-2/+2
| | | | |
| * | | | We want to use stage_includes as a hook, so use NO_STAGE_INCLUDESsjg2014-05-161-1/+10
| | | | | | | | | | | | | | | | | | | | in include/Makefile to suppress normal behavior
| * | | | use mv -f to avoid questionssjg2014-05-161-1/+1
| | | | |
| * | | | Updated dependenciessjg2014-05-161-0/+1
| | | | |
| * | | | Merge from headsjg2014-05-082-2/+2
| |\ \ \ \
| * \ \ \ \ Merge headsjg2014-04-2851-1112/+1114
| |\ \ \ \ \
| * \ \ \ \ \ Merge head@256284sjg2013-10-133-19/+65
| |\ \ \ \ \ \
| * | | | | | | In meta mode touch targets like copies so we don't needlessly repeat them.sjg2013-10-121-1/+10
| | | | | | | |
OpenPOWER on IntegriCloud