summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Simplify libusb_open_device_with_vid_pid(): Only sethselasky2011-12-031-4/+5
| | | | | | | | pdev to non-NULL on success instead of unconditonally setting it and maybe resetting it later. Submitted by: Christoph Mallon MFC after: 3 days
* libusb_open() sets the given device handle to NULL if ithselasky2011-12-031-2/+1
| | | | | | | fails, so there is no need to do it again after returning. Submitted by: Christoph Mallon MFC after: 3 days
* Revert r227812 and r227808 per discussioneadler2011-12-024-30/+18
| | | | | Reviewed by: many Approved by: des
* Split sentences at period boundaries.obrien2011-12-027-73/+93
|
* Tweak the r137233 fix to r136283 -- Code was making two send() attemptsobrien2011-12-021-3/+3
| | | | | | | | | | | | | vs. the comment documented "If we are working with a privileged socket, then take only one attempt". Make the code match. Furthermore, critical privileged applications that [over] log a vast amount can look like a DoS to this code. Given it's unlikely the single reattempted send() will succeeded, avoid usurping the scheduler in a library API for a single non-critical facility in critical applications. Obtained from: Juniper Networks Discussed with: glebius
* Use INCSLINKS so that "make installincludes" installs links during buildworld.fjoe2011-11-291-1/+1
|
* - Hide _rl_qsort_string_compare() that should be private to libreadline()fjoe2011-11-292-1/+1
| | | | | | | implementation. - Add symlink /usr/include/edit/readline/tilde.h -> readline.h All this makes it possible to build and link gdb with -ledit.
* .include <bsd.init.mk> instead of <bsd.own.mk>fjoe2011-11-281-3/+1
| | | | The former allows common settings from ../Makefile.inc to be used.
* Cross-reference capsicum.4 from cap_enter.2 and cap_new.2.rwatson2011-11-272-1/+3
| | | | | MFC after: 3 days Sponsored by: Google, Inc.
* Update libcxxrt to remove the pthread dependency.theraven2011-11-261-1/+0
| | | | | | Also add the license from upstream to contrib. Approved by: dim (mentor)
* style(9) fix.theraven2011-11-261-1/+1
| | | | Approved by: dim (mentor)
* Return not-implemented from pthread_once and pthread_key_create, rathertheraven2011-11-261-2/+10
| | | | | | | | | than silently failing and returning success. Without this, code calls pthread_once(), receives a return value of success, and thinks that the passed function has been called. Approved by: dim (mentor)
* Fix breakage after r227983; lib/libcxxrt still got built, because it wasdim2011-11-261-7/+8
| | | | | | | | not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in Makefile.inc1 was incorrect. Pointy hat to: dim
* Import libc++ / libcxxrt into base. Not build by default yet (usetheraven2011-11-253-0/+187
| | | | | | | | | | | MK_LIBCPLUSPLUS=yes to enable). This is a work-in-progress. It works for me, but is not guaranteed to work for anyone else and may eat your dog. To build C++ using libc++, add -stdlib=libc++ to your CXX and LD flags. Bug reports welcome, bug fixes even more welcome... Approved by: dim (mentor)
* Revert r227841 and part of r227798. We still build libpam in two passes,des2011-11-241-1/+10
| | | | | | but we use STATIC_CFLAGS instead of our own private .c.o rule. MFC after: 3 weeks
* fdopendir(): Do not close the passed file descriptor on failure.jilles2011-11-221-4/+13
| | | | Reviewed by: delphij
* Now kvm_getenvv() and kvm_getargv() don't need procfs(5).trociny2011-11-222-341/+27
| | | | MFC after: 2 weeks
* Fix a crash when trying to duplicate a locale that contains some implicit C ↵theraven2011-11-221-1/+6
| | | | | | | locale components. Reported by: Michael Butler Approved by: dim (mentor)
* - fix some style(9) nits with my last commiteadler2011-11-222-3/+5
| | | | | | | - add a comment explaining why I used '|' instead of '||' Submitted by: danfe@ Approved by: emaste@
* - add check for pointer equality prior to performing the O(n) passeadler2011-11-224-18/+28
| | | | | | | | | - while here change 's' to 's1' in strcoll Submitted by: eadler@ Reviewed by: theraven@ Approved by: brooks@ MFC after: 2 weeks
* (Hopefully) Fix the build with clang by removing a typedef that's no longer ↵theraven2011-11-211-2/+0
| | | | | | needed. Approved by: brooks (mentor)
* Simplify the libpam build by removing the shared modules' dependencydes2011-11-212-13/+3
| | | | | | | on the shared library. The modules are loaded by the library, so we know it'll be there when we need it. MFC after: 3 weeks
* Add history for setsockopt(2).pluknet2011-11-211-2/+4
| | | | | | PR: docs/162719 Submitted by: Niclas Zeising <niclas at zeising gmail> MFC after: 1 week
* - Add the ffclock_getcounter(), ffclock_getestimate() and ffclock_setestimate()lstewart2011-11-213-1/+183
| | | | | | | | | | | | | | | | | | | | system calls to provide feed-forward clock management capabilities to userspace processes. ffclock_getcounter() returns the current value of the kernel's feed-forward clock counter. ffclock_getestimate() returns the current feed-forward clock parameter estimates and ffclock_setestimate() updates the feed-forward clock parameter estimates. - Document the syscalls in the ffclock.2 man page. - Regenerate the script-derived syscall related files. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au)
* Connect LLVM/clang to the build on powerpc64. After the binutils 2.17.50nwhitehorn2011-11-211-1/+1
| | | | import, it works without issue.
* key_load_private() ignores the passphrase argument if the private keydes2011-11-201-7/+18
| | | | | | | | | | | | is unencrypted. This defeats the nullok check, because it means a non-null passphrase will successfully unlock the key. To address this, try at first to load the key without a passphrase. If this succeeds and the user provided a non-empty passphrase *or* nullok is false, reject the key. MFC after: 1 week Noticed by: Guy Helmer <guy.helmer@palisadesystems.com>
* Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option.tuexen2011-11-201-0/+3
| | | | | | | Retire the the now unused sctp_udp_tunneling_for_client_enable sysctl variable. MFC after: 3 months.
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds atheraven2011-11-20141-800/+4050
| | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor)
* Free unused allocation on error.kib2011-11-181-0/+2
| | | | | Reported by: slonoman2011 yandex ru MFC after: 1 week
* Add unicode support to msdosfs and smbfs; original pathes from imura,kevlo2011-11-181-0/+12
| | | | | | bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>. Tested by me in production for several days at work.
* Revert r227538, since it doesn't compile with clang at all (it doesn'tdim2011-11-172-6/+2
| | | | | | | | | | | allow the built-in operations to be redefined, at least not without excessive force). Instead, just disable LLVM's support for atomic operations for now. Nothing in either clang or the tablegen tools currently depends on it. This still allows users of head built before r198344 to upgrade to top-of-head seamlessly.
* Fix typo.kib2011-11-171-2/+2
| | | | | Submitted by: arundel MFC after: 3 days
* Pass CVWAIT flags to kernel, this should handledavidxu2011-11-171-3/+2
| | | | | | | | | timeout correctly for pthread_cond_timedwait when it uses kernel-based condition variable. PR: 162403 Submitted by: jilles MFC after: 3 days
* Further reduce diffs with OpenBSD's arc4random. The main functionaldas2011-11-151-33/+30
| | | | | | | | | | | | | | | | change here is to ensure that when a process forks after arc4random is seeded, the parent and child don't observe the same random sequence. OpenBSD's fix introduces some additional overhead in the form of a getpid() call. This could be improved upon, e.g., by setting a flag in fork(), if it proves to be a problem. This was discussed with secteam (simon, csjp, rwatson) in 2008, shortly prior to my going out of town and forgetting all about it. The conclusion was that the problem with forks is worrisome, but it doesn't appear to have introduced an actual vulnerability for any known programs. The only significant remaining difference between our arc4random and OpenBSD's is in how we seed the generator in arc4_stir().
* Sync the style, comments, and variable names of arc4random.c withdas2011-11-151-39/+33
| | | | | | | | | | OpenBSD's version (r1.22). While some of our style changes were indeed small improvements, being able to easily track functionality changes in OpenBSD seems more useful. Also fix style bugs in the FreeBSD-specific parts of this file. No functional changes, as verified with md5.
* Expose the unimplemented libm functions in the math.h header. This allows ↵theraven2011-11-121-13/+13
| | | | | | | C++'s <cmath> to work without the compiler complaining that the C++ versions are calling implicitly-declared functions. You will still get a linker error when they are called. OpenBSD 5.0 claims to fully implement the C99 <math.h> stuff, so might be worth investigating... Reviewed by: das Approved by: dim (mentor)
* Converting int to wint_t leads to broekn comparison of raw charkevlo2011-11-111-8/+8
| | | | | | and encoded wint_t. Spotted by: ache
* Document that flock can return ENOLCKdougb2011-11-101-1/+3
|
* - Don't handle out-of-memory conditionkevlo2011-11-101-20/+21
| | | | | | | - Fix types of function arguments match their declaration Reviewed by: delphij Obtained from: NetBSD
* Add definition of some USB 3.0 descriptors to libusb 1.0 and libusb 2.0.hselasky2011-11-096-3/+332
| | | | | | | Some header file parts of this patch were taken from a patch submitted by Maya Erez <merez@codeaurora.org> to the LibUSB developers list. MFC after: 1 week
* Ensure pam_lastlog removes the /dev/ component of the TTY name.ed2011-11-071-0/+5
| | | | | | | | | | Some consumers of PAM remove the /dev/ component (i.e. login), while others don't (i.e. su). We must ensure that the /dev/ component is removed to ensure that the utmpx entries properly work with tools such as w(1). Discussed with: des MFC after: 1 week
* When one attempts to compile the tree with -march=i386, which also useddim2011-11-062-0/+4
| | | | | | | | | | | to be gcc's default before r198344, calls to atomic builtins will not be expanded inline. Instead, they will be generated as calls to external functions (e.g. __sync_fetch_and_add_N), leading to linking errors later on. Put in a seatbelt that disables use of atomic builtins in libstdc++ and llvm, when tuning specifically for the real i386 CPU. This does not protect against all possible issues, but it is better than nothing.
* Remove an unused variable from pam_unix.ed2011-11-051-2/+0
| | | | | | | | This variable was added in r82352 back in 2001, but even then it didn't have any use. Because it's not marked static, the C compiler won't complain about it. Discussed with: des
* Fix a warning emitted by Clang.ed2011-11-041-1/+2
| | | | | | The size passed to strlcat() must depend on the input length, not the output length. Because the input and output buffers are equal in size, the resulting binary does not change at all.
* Add the posix_fadvise(2) system call. It is somewhat similar tojhb2011-11-044-2/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | madvise(2) except that it operates on a file descriptor instead of a memory region. It is currently only supported on regular files. Just as with madvise(2), the advice given to posix_fadvise(2) can be divided into two types. The first type provide hints about data access patterns and are used in the file read and write routines to modify the I/O flags passed down to VOP_READ() and VOP_WRITE(). These modes are thus filesystem independent. Note that to ease implementation (and since this API is only advisory anyway), only a single non-normal range is allowed per file descriptor. The second type of hints are used to hint to the OS that data will or will not be used. These hints are implemented via a new VOP_ADVISE(). A default implementation is provided which does nothing for the WILLNEED request and attempts to move any clean pages to the cache page queue for the DONTNEED request. This latter case required two other changes. First, a new V_CLEANONLY flag was added to vinvalbuf(). This requests vinvalbuf() to only flush clean buffers for the vnode from the buffer cache and to not remove any backing pages from the vnode. This is used to ensure clean pages are not wired into the buffer cache before attempting to move them to the cache page queue. The second change adds a new vm_object_page_cache() method. This method is somewhat similar to vm_object_page_remove() except that instead of freeing each page in the specified range, it attempts to move clean pages to the cache queue if possible. To preserve the ABI of struct file, the f_cdevpriv pointer is now reused in a union to point to the currently active advice region if one is present for regular files. Reviewed by: jilles, kib, arch@ Approved by: re (kib) MFC after: 1 month
* Note that pam_unix(8) does not respect PAM_CHANGE_EXPIRED_AUTHTOK.des2011-11-021-0/+6
|
* Despite official i386 ABI does not mandate any stack alignment besideskib2011-11-022-0/+28
| | | | | | | | the word alignment, some versions of gcc do require 16-byte alignment. Make sure the stack is 16-byte aligned before calling a subroutine. Inspired by: PR amd64/162214 MFC after: 1 week
* Make sure that stack is 16-byte aligned before calling a function,kib2011-11-022-0/+6
| | | | | | | | | as it is required by amd64 ABI. Add a comment for the places were the stack is accidentally properly aligned already. PR: amd64/162214 Submitted by: yamayan <yamayan kbh biglobe ne jp> MFC after: 1 week
* Don't forget to kick the man page date.ed2011-10-271-1/+1
|
* Make our utmpx more like System V.ed2011-10-272-3/+20
| | | | | | | | | | | | | | | | | | | | When booting the system, truncate the utx.active file, but do write the BOOT_TIME record into it afterwards. This allows one to obtain the boot time of the system as follows: struct utmpx u1 = { .ut_type = BOOT_TIME }, *u2; setutxent(); u2 = getutxid(&u1); Now, the boot time is stored in u2->ut_tv, just like on Linux and other systems. We don't open the utx.active file with O_EXLOCK. It's rather unlikely that other applications use this database at the same time and I want to prevent the possibility of deadlocks in init(8). Discussed with: pluknet
OpenPOWER on IntegriCloud