Commit Graph

14045 Commits

Author SHA1 Message Date
David Chisnall
4fb4550854 Small style(9) improvements.
Approved by:	dim (mentor)
2011-12-15 11:16:41 +00:00
Ruslan Ermilov
e26e60ee36 Clean up includes; the prototype for getosreldate() has moved to
<unistd.h> in r183390.
2011-12-14 08:35:08 +00:00
Ed Schouten
59340eb8e2 Don't use __P().
The rest of the file doesn't use it either and according to style(9), it
should not be used.
2011-12-13 14:53:26 +00:00
Dimitry Andric
214ca32f1f Use the correct upstream revision number for llvm/clang 3.0 release.
The r145546 revision is from branches/release_30, the r145349 revision
is from tags/RELEASE_30/final.

MFC after:	1 week
2011-12-10 01:01:44 +00:00
Dimitry Andric
f8254f43c5 Upgrade our copy of llvm/clang to 3.0 release. Release notes can be
found at: http://llvm.org/releases/3.0/docs/ReleaseNotes.html

MFC after:	1 week
2011-12-09 22:23:45 +00:00
Dimitry Andric
9da628931e Vendor import of clang 3.0 final release:
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_30/final@145349
2011-12-09 18:30:42 +00:00
Dimitry Andric
d4c8b5d2e8 Vendor import of llvm 3.0 final release:
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_30/final@145349
2011-12-09 18:27:22 +00:00
Robert Millan
bcedb9c091 Make berase() work on platforms whose kernel lacks DIOCGDELETE ioctl.
Approved by:	kib (mentor)
2011-12-08 12:31:47 +00:00
David Chisnall
af8065219d Some fixes to the man pages for [at_]quick_exit(3)
Reviewed by:    pluknet
Approved by:    dim (mentor)
2011-12-07 21:02:35 +00:00
David Chisnall
e86328cbfb style(9) cleanups.
Approved by:	brooks (mentor)
2011-12-07 16:12:54 +00:00
David Chisnall
0a31efe016 Implement quick_exit() / at_quick_exit() from C++11 / C1x. Also add a
__noreturn macro and modify the other exiting functions to use it.

The __noreturn macro, unlike __dead2, must be used BEFORE the function.
This is in line with the C and C++ specifications that place _Noreturn (c1x)
and [[noreturn]] (C++11) in front of the functions.  As with __dead2, this
macro falls back to using the GCC attribute.

Unfortunately, clang currently sets the same value for the C version macro
in C99 and C1x modes, so these functions are hidden by default.  At some
point before 10.0, I need to go through the headers and clean up the C1x /
C++11 visibility.

Reviewed by:	brooks (mentor)
2011-12-07 15:25:48 +00:00
Ruslan Ermilov
20df026c9a The NOTE_COPY should have been named NOTE_FFCOPY from the very
beginning.

Submitted by:	Igor Sysoev
2011-12-07 11:06:18 +00:00
Jilles Tjoelker
54ad8a62ed libc: Eliminate 13 relative relocations in wctype(). 2011-12-05 00:00:47 +00:00
Hans Petter Selasky
3f709d07c5 Simplify libusb_open_device_with_vid_pid(): Only set
pdev to non-NULL on success instead of unconditonally
setting it and maybe resetting it later.

Submitted by:	Christoph Mallon
MFC after:	3 days
2011-12-03 16:30:47 +00:00
Hans Petter Selasky
dc93480306 libusb_open() sets the given device handle to NULL if it
fails, so there is no need to do it again after returning.

Submitted by:	Christoph Mallon
MFC after:	3 days
2011-12-03 16:19:07 +00:00
Eitan Adler
0f701093d2 Revert r227812 and r227808 per discussion
Reviewed by:	many
Approved by:	des
2011-12-02 15:41:09 +00:00
David E. O'Brien
8449399687 Split sentences at period boundaries. 2011-12-02 11:55:09 +00:00
David E. O'Brien
0582474525 Tweak the r137233 fix to r136283 -- Code was making two send() attempts
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
2011-12-02 01:06:33 +00:00
Max Khon
1e671ba260 Use INCSLINKS so that "make installincludes" installs links during buildworld. 2011-11-29 06:21:01 +00:00
Max Khon
8480e502f4 - Hide _rl_qsort_string_compare() that should be private to libreadline()
implementation.
- Add symlink /usr/include/edit/readline/tilde.h -> readline.h

All this makes it possible to build and link gdb with -ledit.
2011-11-29 04:50:57 +00:00
Max Khon
106235a4b8 .include <bsd.init.mk> instead of <bsd.own.mk>
The former allows common settings from ../Makefile.inc to be used.
2011-11-28 14:01:17 +00:00
Robert Watson
251944df31 Cross-reference capsicum.4 from cap_enter.2 and cap_new.2.
MFC after:	3 days
Sponsored by:	Google, Inc.
2011-11-27 19:45:41 +00:00
David Chisnall
db47c4bf21 Update libcxxrt to remove the pthread dependency.
Also add the license from upstream to contrib.

Approved by:	dim (mentor)
2011-11-26 18:46:33 +00:00
David Chisnall
5bf69a4b16 style(9) fix.
Approved by:	dim (mentor)
2011-11-26 16:49:25 +00:00
David Chisnall
48cb9786e1 Return not-implemented from pthread_once and pthread_key_create, rather
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)
2011-11-26 15:57:09 +00:00
Dimitry Andric
49c8e5e77e Fix breakage after r227983; lib/libcxxrt still got built, because it was
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
2011-11-26 03:26:06 +00:00
David Chisnall
7a98470824 Import libc++ / libcxxrt into base. Not build by default yet (use
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)
2011-11-25 20:59:04 +00:00
Dag-Erling Smørgrav
dcf83bf794 Revert r227841 and part of r227798. We still build libpam in two passes,
but we use STATIC_CFLAGS instead of our own private .c.o rule.

MFC after:	3 weeks
2011-11-24 13:18:58 +00:00
Jilles Tjoelker
38574aa8df fdopendir(): Do not close the passed file descriptor on failure.
Reviewed by:	delphij
2011-11-22 23:46:56 +00:00
Mikolaj Golub
ee5169dc9d Now kvm_getenvv() and kvm_getargv() don't need procfs(5).
MFC after:	2 weeks
2011-11-22 21:12:28 +00:00
David Chisnall
2013459487 Fix a crash when trying to duplicate a locale that contains some implicit C locale components.
Reported by:	Michael Butler
Approved by:	dim (mentor)
2011-11-22 14:11:42 +00:00
Eitan Adler
623b87d8f4 - fix some style(9) nits with my last commit
- add a comment explaining why I used '|' instead of '||'

Submitted by:	danfe@
Approved by:	emaste@
2011-11-22 02:50:24 +00:00
Eitan Adler
55e84fcee1 - add check for pointer equality prior to performing the O(n) pass
- while here change 's' to 's1' in strcoll

Submitted by:	eadler@
Reviewed by:	theraven@
Approved by:	brooks@
MFC after:	2 weeks
2011-11-22 00:07:53 +00:00
David Chisnall
a54626e0cd (Hopefully) Fix the build with clang by removing a typedef that's no longer needed.
Approved by:	brooks (mentor)
2011-11-21 23:32:14 +00:00
Dag-Erling Smørgrav
e03e3b699e Simplify the libpam build by removing the shared modules' dependency
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
2011-11-21 16:40:39 +00:00
Sergey Kandaurov
0a1c3432f6 Add history for setsockopt(2).
PR:		docs/162719
Submitted by:	Niclas Zeising <niclas at zeising gmail>
MFC after:	1 week
2011-11-21 14:36:19 +00:00
Lawrence Stewart
cf13a58510 - Add the ffclock_getcounter(), ffclock_getestimate() and ffclock_setestimate()
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)
2011-11-21 01:26:10 +00:00
Nathan Whitehorn
ebcc5e9a0d Connect LLVM/clang to the build on powerpc64. After the binutils 2.17.50
import, it works without issue.
2011-11-21 00:49:46 +00:00
Dag-Erling Smørgrav
4520e72ebf key_load_private() ignores the passphrase argument if the private key
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>
2011-11-20 15:18:49 +00:00
Michael Tuexen
c9c5805975 Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option.
Retire the the now unused sctp_udp_tunneling_for_client_enable
sysctl variable.

MFC after: 3 months.
2011-11-20 15:00:45 +00:00
David Chisnall
3c87aa1d3d Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a
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)
2011-11-20 14:45:42 +00:00
Konstantin Belousov
289317dac9 Free unused allocation on error.
Reported by:	slonoman2011 yandex ru
MFC after:	1 week
2011-11-18 09:56:40 +00:00
Kevin Lo
41f1dccceb Add unicode support to msdosfs and smbfs; original pathes from imura,
bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>.

Tested by me in production for several days at work.
2011-11-18 03:05:20 +00:00
Dimitry Andric
fd75cb79ce Revert r227538, since it doesn't compile with clang at all (it doesn't
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.
2011-11-17 21:06:53 +00:00
Konstantin Belousov
2cda7d0049 Fix typo.
Submitted by:	arundel
MFC after:	3 days
2011-11-17 13:14:07 +00:00
David Xu
7859df8e67 Pass CVWAIT flags to kernel, this should handle
timeout correctly for pthread_cond_timedwait when
it uses kernel-based condition variable.

PR:	162403
Submitted by: jilles
MFC after: 3 days
2011-11-17 01:43:50 +00:00
David Schultz
7a0789b485 Further reduce diffs with OpenBSD's arc4random. The main functional
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().
2011-11-15 05:49:24 +00:00
David Schultz
c0b4847030 Sync the style, comments, and variable names of arc4random.c with
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.
2011-11-15 05:45:46 +00:00
David Chisnall
e481b86384 Expose the unimplemented libm functions in the math.h header. This allows 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)
2011-11-12 19:55:48 +00:00
Kevin Lo
5249ac8610 Converting int to wint_t leads to broekn comparison of raw char
and encoded wint_t.

Spotted by:	ache
2011-11-11 01:35:07 +00:00
Doug Barton
cbbacf9bcc Document that flock can return ENOLCK 2011-11-10 06:20:18 +00:00
Kevin Lo
2bf213eb6c - Don't handle out-of-memory condition
- Fix types of function arguments match their declaration

Reviewed by:	delphij
Obtained from:	NetBSD
2011-11-10 01:44:05 +00:00
Hans Petter Selasky
4c0392e6fd Add definition of some USB 3.0 descriptors to libusb 1.0 and libusb 2.0.
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
2011-11-09 19:03:26 +00:00
Ed Schouten
f1b61fc829 Ensure pam_lastlog removes the /dev/ component of the TTY name.
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
2011-11-07 19:57:42 +00:00
Dimitry Andric
130515293b When one attempts to compile the tree with -march=i386, which also used
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.
2011-11-06 14:07:23 +00:00
Ed Schouten
82a36aefae Remove an unused variable from pam_unix.
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
2011-11-05 10:00:29 +00:00
Ed Schouten
24a92ae013 Fix a warning emitted by Clang.
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.
2011-11-04 19:56:34 +00:00
John Baldwin
936c09ac0f Add the posix_fadvise(2) system call. It is somewhat similar to
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
2011-11-04 04:02:50 +00:00
Dag-Erling Smørgrav
23b8f4d84a Note that pam_unix(8) does not respect PAM_CHANGE_EXPIRED_AUTHTOK. 2011-11-02 23:40:21 +00:00
Konstantin Belousov
1a9879c32a Despite official i386 ABI does not mandate any stack alignment besides
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
2011-11-02 18:08:30 +00:00
Konstantin Belousov
990d53343a Make sure that stack is 16-byte aligned before calling a function,
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
2011-11-02 18:06:22 +00:00
Ed Schouten
ad033677ea Don't forget to kick the man page date. 2011-10-27 17:21:41 +00:00
Ed Schouten
c5cf53fc3e Make our utmpx more like System V.
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
2011-10-27 17:05:18 +00:00
Sergey Kandaurov
7112398c93 Fix the manual section number for a cross-reference to open(2) and sort it.
Reviewed by:	ed
MFC after:	3 days
2011-10-27 13:17:42 +00:00
Sergey Kandaurov
52f047eeac Fix typo in timer_getoverrun cross-reference.
MFC after:	3 days
2011-10-26 14:26:10 +00:00
Tim Kientzle
83c1083f53 Fix Buildworld WITHOUT_OPENSSL.
PR:		kern/160922
MFC after:	3 days
2011-10-22 22:22:46 +00:00
Tim Kientzle
c5499409f8 Correct the spelling of getgrgid and getpwuid in the man page.
MFC after:	3 days
2011-10-22 17:56:24 +00:00
Dimitry Andric
6122f3e60d Upgrade our copy of llvm/clang to r142614, from upstream's release_30
branch.  This brings us very close to the 3.0 release, which is expected
in a week or two.

MFC after:	1 week
2011-10-22 14:08:43 +00:00
Dag-Erling Smørgrav
907c13d85f Revert the previous commit and add a comment explaining why it was wrong. 2011-10-22 14:08:21 +00:00
Dag-Erling Smørgrav
5acce7d734 openpam_static.c isn't auto-generated. 2011-10-22 04:39:12 +00:00
David Schultz
1f52bcdde4 Minor corrections and clarifications regarding exceptions. 2011-10-21 14:23:59 +00:00
David Schultz
6232589aeb Replace a proliferation of buggy MD implementations of modf() with a
working MI one.  The MI one only needs to be overridden on machines
with non-IEEE754 arithmetic.  (The last supported one was the VAX.)
It can also be overridden if someone comes up with a faster one that
actually passes the regression tests -- but this is harder than it sounds.
2011-10-21 06:40:36 +00:00
David Schultz
bd26fb812d Add support for the 'x' mode option in fopen() as specified in the C1X
draft standard.  The option is equivalent to O_EXCL.

MFC after:	1 month
2011-10-21 06:35:58 +00:00
David Schultz
0c7e4d5fc1 Fix a regression introduced in r226371: When the high part of x*y
exactly cancels with z, return the low part of x*y instead of
discarding it.
2011-10-21 06:30:43 +00:00
David Schultz
bc23acdc32 Fix a corner case: tan(large + Inf i) == NaN + NaN i. 2011-10-21 06:30:16 +00:00
David Schultz
c6df46bafb Improved handling of large x in ccosh{,f}():
- Handle cases where exp(x) would overflow, but ccosh(x) ~= exp(x) / 2
  shouldn't.
- Use the ccosh(x) ~= exp(x) / 2 approximation to simplify the calculation
  when x is large.

Similarly for csinh().  Also fixed the return value of csinh(-Inf +- 0i).
2011-10-21 06:29:32 +00:00
David Schultz
d4657ac799 Use __ldexp_exp() to simplify things and improve accuracy for x near
the overflow threshold.
2011-10-21 06:28:47 +00:00
David Schultz
12188b77a2 The cexp() and {,c}{cos,sin}h functions all need to be able to compute
exp(x) scaled down by some factor, and the challenge is doing this
accurately when exp(x) would overflow.  This change replaces all of
the tricks we've been using with common __ldexp_exp() and
__ldexp_cexp() routines that handle all the scaling.

bde plans to improve on this further by moving the guts of exp() into
k_exp.c and handling the scaling in a more direct manner.  But the
current approach is simple and adequate for now.
2011-10-21 06:27:56 +00:00
David Schultz
f2ea2b9d27 Use STRICT_ASSIGN() to ensure that the compiler doesn't screw things
up by storing x in a wider type than it's supposed to.

Submitted by:	bde
2011-10-21 06:26:38 +00:00
David Schultz
cd24d79843 Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1.
MFC after:	2 weeks
2011-10-21 06:26:07 +00:00
David Schultz
741ae1d017 Bugfix: feenableexcept() and fedisableexcept() should just return the
old exception mask, not mask | ~FE_ALL_EXCEPT.

MFC after:	2 weeks
2011-10-21 06:25:31 +00:00
Dimitry Andric
36981b17ed Vendor import of clang release_30 branch r142614:
http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614
2011-10-20 21:14:49 +00:00
Dimitry Andric
30815c536b Vendor import of llvm release_30 branch r142614:
http://llvm.org/svn/llvm-project/llvm/branches/release_30@142614
2011-10-20 21:10:27 +00:00
Dag-Erling Smørgrav
578153f1ba latin1 -> utf8 2011-10-19 11:43:51 +00:00
Fabien Thomas
dceed24a7c Add a flush of the current PMC log buffer before displaying the next top.
As the underlying block is 4KB if the PMC throughput is low the measurement
will be reported on the next tick. pmcstat(8) use the modified flush API to
reclaim current buffer before displaying next top.

MFC after:	1 month
2011-10-18 15:25:43 +00:00
Dimitry Andric
db53c95fc8 Update llvm/clang's target triple (confusingly named LLVM_HOSTTRIPLE) to
$arch-unknown-freebsd10.0.
2011-10-17 18:30:18 +00:00
David Schultz
715a43edd0 It's no longer accurate to say that math.h "constitute[s] the C math
library," since complex.h, tgmath.h, and fenv.h are also part of the
math library.  Replace the outdated sentence with some references to
the other parts.
2011-10-17 06:10:32 +00:00
David Schultz
3daee1d6c3 Add c{cos,sin,tan}{,h}{,f} functions. This is joint work with
bde and kargl.
2011-10-17 05:41:03 +00:00
Pawel Jakub Dawidek
e8cc80c0a0 In pidfile_open(), if the pidfile is locked, but empty (PID is not stored yet)
and the caller requested other process' PID by passing non-NULL pidptr
argument, we will wait at most 100ms for the PID to show up in the file and if
it won't, we will store -1 in *pidptr.

From now on, pidfile_open() function never sets errno to EAGAIN on failure.

In collaboration with:	des
MFC after:		1 week
2011-10-16 21:30:15 +00:00
Eitan Adler
36daf0495a - change "is is" to "is" or "it is"
- change "the the" to "the"

Approved by:	lstewart
Approved by:	sahil (mentor)
MFC after:	3 days
2011-10-16 14:30:28 +00:00
Ed Schouten
1e47e0ca1b Change the SDP_GET* macros to cast to a const buffer.
This fixes a compiler warning when passing a const buffer to them.
2011-10-16 08:45:16 +00:00
Ed Schouten
64995097dd Change ncp_scan_bindery_object() to pass a constant search string.
The ncp_scan_bindery_object() function does not modify search_string
internally, so there is no need to declare it as `char *'.
2011-10-16 08:44:03 +00:00
David Schultz
5d9fefacf2 Use #include "fenv.h" instead of #include <fenv.h>. This makes it
more convenient to compile the math library by itself.

Requested by:	bde
2011-10-16 05:37:56 +00:00
David Schultz
0ddbe81e4f Fix some non-standard variable declarations. 2011-10-16 05:37:20 +00:00
David Schultz
4ce31585dc Optimize the case of pure imaginary arguments. Calls like this are
common, e.g., in DFT implementations.

Discussed with:	bde, kargl
2011-10-16 05:37:01 +00:00
David Schultz
e62394861d Move the macros GET_LDBL_EXPSIGN() and SET_LDBL_EXPSIGN() into
math_private.h, so they can be used elsewhere in the math library.
2011-10-16 05:36:39 +00:00
David Schultz
eccf8b3a30 Remove an unused variable. 2011-10-16 05:36:23 +00:00
David Schultz
e595c01fd8 Remove some unnecessary initializations.
Obtained from:	DragonFlyBSD
2011-10-15 07:00:28 +00:00
David Schultz
b052ec9065 Various changes to improve the accuracy and speed of log{2,10}{,f}.
- Rename __kernel_log() to k_log1p().
- Move some of the work that was previously done in the kernel log into
  the callers.  This enables further refactoring to improve accuracy or
  speed, although I don't recall the details.
- Use extra precision when adding the final scaling term, which improves
  accuracy.
- Describe and work around compiler problems that break some of the
  multiprecision calculations.

A fix for a small bug is also included:
- Add a special case for log*(1).  This is needed to ensure that log*(1) == +0
  instead of -0, even when the rounding mode is FE_DOWNWARD.

Submitted by:	bde
2011-10-15 05:23:28 +00:00
David Schultz
5ebf26f6a1 Style fixes and updates to comments.
Submitted by:	bde
2011-10-15 05:00:56 +00:00