summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Test for /etc/ssl/cert.pem existence to avoid masking SSL_CA_CERT_PATHbapt2016-01-191-3/+10
| | | | | | | | | | | | | | | | | Prior to this patch, unless SSL_CA_CERT_FILE is set in the environment, libfetch will set the CA file to "/usr/local/etc/cert.pem" if it exists, and to "/etc/ssl/cert.pem" otherwise. This has the consequence of masking SSL_CA_CERT_PATH, because OpenSSL will ignore the CA path if a CA file is set but fails to load (see X509_STORE_load_locations()). While here, fall back to OpenSSL defaults if neither SSL_CA_CERT_FILE nor SSL_CA_CERT_PATH are set in the environment, and if neither of the libfetch default CA files exists. PR: 193871 Submitted by: John W. O'Brien <john@saltant.com> Approved by: des MFC after: 1 week
* Update elftc version to 3272M, imported in r292120emaste2016-01-181-1/+1
|
* mdoc: sort Xrjoel2016-01-181-1/+1
|
* Fix compilation on MIPS (typo introduced in r294227).br2016-01-181-1/+1
|
* utimensat(2): Correct description of [EINVAL] error.jilles2016-01-171-3/+6
| | | | MFC after: 4 days
* Bring in initial libc and libstand support for RISC-V.br2016-01-1729-13/+1401
| | | | | | | Reviewed by: andrew, emaste, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4943
* Add mmu format info into ARM vmcore.skra2016-01-152-9/+28
| | | | | | | | Fix kvatop translation for 64K pages. Reviewed by: jhb Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D4942
* Improvements to the MDXFileChunk() template function:jtl2016-01-141-29/+31
| | | | | | | | | | | | | - Remove unneeded fstat()/lseek() calls. - Return NULL and set errno to EINVAL on negative length. - Fix small style problems and expand variable names. After this change, it is possible to use this code for some irregular files. For example, 'md5 /dev/md0' should now succeed. Differential Revision: https://reviews.freebsd.org/D4748 Suggested by: bde Reviewed by: bde, allanjude, delphij
* Set -mlong-calls where needed to get a static clang and lldb 3.8.0andrew2016-01-142-0/+7
| | | | | | | | | | | linking. These are too large for a branch instruction to branch from an earlier point in the code to somewhere later. This will also allow these to be build with Thumb-2 when we get this infrastructure. Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D4855
* Fix building with GCC since PAGE_MASK is signed on i386.jhb2016-01-141-1/+1
| | | | | | Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4772
* Remove an unneeded assignment of the return value.ed2016-01-141-1/+0
| | | | | | | tdelete() is supposed to return the address of the parent node that has been deleted. We already keep track of this node in the loop between lines 94-107. The GO_LEFT()/GO_RIGHT() macros are used later on as well, so we must make sure not to change it to something else.
* Default to en_US.ISO8859-1 if no localedteske2016-01-142-0/+9
| | | | | MFC after: 3 days X-MFC-to: stable/10
* - Add the 'restrict' type qualifier to match function prototype.kevlo2016-01-141-4/+3
| | | | - Remove sys/types.h.
* libthr: const-ify two variablesvangyzen2016-01-131-2/+3
| | | | | | | | Make the default umutex and urwlock initializers const, because they can be, and as a microoptimization. MFC after: 5 days Sponsored by: Dell Inc.
* Avoid reading pass the end of the source buffer when it is not NULbrooks2016-01-131-1/+1
| | | | | | | | | | | terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206178 Submitted by: Alexander Cherepanov <cherepan@mccme.ru> MFC after: 1 week
* Avoid reading pass the end of the source buffer when it is not NULbrooks2016-01-131-1/+1
| | | | | | | | | | | terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206177 Submitted by: Alexander Cherepanov <cherepan@mccme.ru> MFC after: 1 week
* Remove the compat code to handle the kernel passing us an unalingedandrew2016-01-131-5/+1
| | | | | | | | stackpointer. Userland expects the kernel to pass it an aligned sp and pass a pointer to the arguments in x0. The kernel side was updated in r289502, 3 months ago. Sponsored by: ABT Systems Ltd
* Update futimens/utimensat for MFC to stable/10:jilles2016-01-123-4/+10
| | | | | | | | | | * Fix __FreeBSD_version check. * Update history section in man page. An MFC of this commit to stable/10 will allow using the new system calls instead of the fallback. MFC after: 3 days
* Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)`ngie2016-01-121-2/+2
| | | | | | | | | | | This fixes the potential NULL pointer dereference properly, and also fixes memory leaks encountered in the process of iterating through `*rp`. MFC after: 1 week Found by: Valgrind Reported by: Dan Roberts <dan.roberts@isilon.com> Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
* Similar to r293704, fix theoretical leak of netconfig(3) resources inngie2016-01-111-2/+2
| | | | | | | | | | | __rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating resources, but not completely successful by moving the endnetconfig(3) call up before we return from the function if nconf == NULL. MFC after: 1 week Reported by: Coverity Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
* Fix theoretical leak of netconfig(3) resources in svcunix_create(..)ngie2016-01-111-1/+1
| | | | | | | | | | | | | In the event that the getconfig(3) call in svcunix_create is partly successful, some of the netconfig(3) resources allocated might be leaked if the call returns NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the resources are fully cleaned up by going to the `done` label, which will call endnetconfig(3) for us. MFC after: 1 week Reported by: Coverity Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
* Use -mlong-calls to build crt1.o and gcrt1.o. This tells the compiler toandrew2016-01-101-2/+3
| | | | | | | | generate code to branch based on an address in a register. This allows us to have binaries larger than the 32MiB limit of a branch instruction. The main use of this is with clang. Clang 3.8.0 has been shown to be larger than the above limit.
* Make tohex() work as expected.ae2016-01-091-1/+1
|
* Fix a typo.ae2016-01-091-1/+1
| | | | PR: 205722
* New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 andglebius2016-01-081-32/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | up to now. The new sendfile is the code that Netflix uses to send their multiple tens of gigabits of data per second. The new implementation features asynchronous I/O, when I/O operations are launched, but not awaited to be complete. An explanation of why such behavior is beneficial compared to old one is going to be too long for a commit message, so we will skip it here. Additional features of new syscall are extra flags, which provide an application more control over data sent. The SF_NOCACHE flag tells kernel that data shouldn't be cached after it was sent. The SF_READAHEAD() macro allows to specify readahead size in pages. The new syscalls is a drop in replacement. No modifications are required to applications. One can take nginx binary for stable/10 and run it successfully on head. Although SF_NODISKIO lost its original sense, as now sendfile doesn't block, and now means something completely different (tm), using the new sendfile the old way is absolutely safe. Celebrates: Netflix global launch! Sponsored by: Nginx, Inc. Sponsored by: Netflix Relnotes: yes
* Bump copyright (forgotten part of r293340)dteske2016-01-071-1/+1
| | | | | | MFC after: 3 days X-MFC-to: stable/10 X-MFC-with: r293340
* DIRDEPS_BUILD: Update dependencies.bdrewery2016-01-071-0/+3
| | | | Sponsored by: EMC / Isilon Storage Division
* Don't install /usr/include/stand.h twice after r293040.bdrewery2016-01-071-1/+1
| | | | | | Only install it from lib/libstand. Sponsored by: EMC / Isilon Storage Division
* Increase maximum buffer size for `-x cmd' valuedteske2016-01-071-1/+1
| | | | | MFC after: 3 days X-MFC-to: stable/10
* Add in DIRDEPS_BUILD support.bdrewery2016-01-071-0/+22
| | | | Sponsored by: EMC / Isilon Storage Division
* Add fls() to libstandemaste2016-01-061-2/+3
| | | | | | | Although we don't use it in tree yet libstand is installed as user- facing /usr/liblibstand.a, and some work in progress makes use of it. Instead of conflicting with ongoing libstand Makefile deduplication, just add it now.
* Add sbin and /usr/local directories to _PATH_DEFPATH.jilles2016-01-052-4/+4
| | | | | | | | | | | | | | | | | 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
* Fix a memory leak in gss_release_oid_setdfr2016-01-041-6/+16
|
* Remove free'ing of an uninitialized variablengie2016-01-041-2/+0
| | | | | | | | | | | Just remove it completely from the test as it's initialized but unused apart from the free(3) call Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reported by: cppcheck Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Use `nitems(x)` macro instead of using hardcoded numbers for indices intongie2016-01-041-53/+59
| | | | | | | | | | | | the nvlists Convert some of the variables from int to unsigned int to squelch -Wsign-compare warnings when converting hardcoded values to nitems(..) Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Convert another `string` variable to `string_arr` missed in r293130ngie2016-01-041-3/+3
| | | | | | | Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Rename nitems and string variables to avoid collisionsngie2016-01-041-105/+106
| | | | | | | | | | | | | | Rename the `nitems` variable to `num_items` to avoid collisions with the macro in sys/param.h for counting elements in an array Similarly, rename `string` to `string_arr` to avoid future collisions with potential keywords, as well as make it clear that `string_arr` isn't a char* value, but instead a char** value. Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Add sys/types.h for for size_t, etcngie2016-01-031-0/+1
| | | | | | | stable/10 requires it due to header pollution MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Reduce libstand Makefile duplicationemaste2016-01-011-3/+4
| | | | | | | | | | | | | | | | libstand is built in three places (lib/libstand, sys/boot/libstand32, and sys/boot/userboot/libstand). Reduce Makefile duplication by .including libstand/Makefile from sys/boot/libstand32/Makefile. sys/boot/userboot/libstand/Makefile will be addressed later, as it contains additional differences yet to be handled. This change also switches libstand32 to use the new uuid_from_string and uuid_to_string, which was not included in r292473. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4747
* When building libstand for arm, don't emit instructions that requireian2015-12-311-0/+6
| | | | | | relocation fixups unsupported by the self_reloc() code, and don't optimize memcpy/memset using floating point registers, because in a standalone environment nothing has initialized the fpu hardware.
* Fix a file descriptor leak in mdXhl.c (which is used by numerous hashingjtl2015-12-301-4/+9
| | | | | | | | | | algorithms. CID: 1305669,1305611,1305663,1305603,1305584,1305639,1346865,1305601 Differential Revision: https://reviews.freebsd.org/D4732 Reviewed by: allanjude, delphij MFC after: 2 weeks Sponsored by: Juniper Networks
* Use __alignof__ instead of assuming int64_t to get the rightimp2015-12-301-10/+1
| | | | | | alignment. Differential Revision: https://reviews.freebsd.org/D4708
* Document the recently added support for ptrace(2) LWP events.jhb2015-12-301-1/+38
|
* The FILE structure has a mbstate_t in it. This structure needs to beimp2015-12-271-2/+14
| | | | | | | | | | aligned on a int64_t boundary. However, when we allocate the array of these structures, we use ALIGNBYTES which defaults to sizeof(int) on arm, i386 and others. The i386 stuff can handle unaligned accesses seemlessly. However, arm cannot. Take this into account when creating the array of FILEs, and add some comments about why. Differential Revision: https://reviews.freebsd.org/D4708
* Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.callanjude2015-12-276-423/+78
| | | | | | | | | | | | | | | | | | cperciva's libmd implementation is 5-30% faster The same was done for SHA256 previously in r263218 cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation Extend sbin/md5 to create sha384(1) Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h} Reviewed by: cperciva, des, delphij Approved by: secteam, bapt (mentor) MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3929
* Verify that tv_sec value specified in settimeofday() and clock_settime()dchagin2015-12-272-2/+8
| | | | | | | | | | | | | | (CLOCK_REALTIME case) system calls is non negative. This commit hides a kernel panic in atrtc_settime() as the clock_ts_to_ct() does not properly convert negative tv_sec. ps. in my opinion clock_ts_to_ct() should be rewritten to properly handle negative tv_sec values. Differential Revision: https://reviews.freebsd.org/D4714 Reviewed by: kib MFC after: 1 week
* Replace implementation of hsearch() by one that scales.ed2015-12-277-185/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Typo.kib2015-12-271-1/+1
|
* Upgrade our copies of clang and llvm to 3.7.1 release. This is adim2015-12-256-13/+13
| | | | | | | bugfix-only release, with no new features. Please note that from 3.5.0 onwards, clang and llvm require C++11 support to build; see UPDATING for more information.
* Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, ascperciva2015-12-251-0/+1
| | | | | | | | | POSIX requires for the c99 compiler. (In fact, our c99(1) already ignores -lxnet; but our make(1) doesn't set ${CC} correctly, and our cc(1) treats xnet like any other library.) Reviewed by: kib
OpenPOWER on IntegriCloud