12718 Commits

Author SHA1 Message Date
Ryan Stone
fa3592281b MFC r207482
When configuring hwpmc to use the EXT_SNOOP event, only send a default
 cachestate qualifier on the Atom processor.  Other Intel processors do not
 accept a cachestate qualifier and currently hwpmc will return EINVAL if you
 try to use the EXT_SNOOP event on those processors

Approved by:	emaste (mentor)
2010-05-24 19:42:27 +00:00
Marius Strobl
158355ef99 MFC: r208341
Update to a config.h created by a file 5.03 configure script. This causes
file.1 to contain the correct version number and SIZEOF_LONG_LONG to be
defined as appropriate, which is crucial for 64-bit big-endian ELF files
to be handled correctly on big-endian systems.

PR:		146387
Reviewed by:	delphij
2010-05-23 11:18:05 +00:00
Edward Tomasz Napierala
674d3a9960 MFC r208034:
Make branding less intrusive - in acl_set(3), in case ACL brand
is ACL_BRAND_UNKNOWN, do what the programmer says instead of failing.
2010-05-20 18:46:11 +00:00
Edward Tomasz Napierala
0941e62812 MFC r208033:
Make it possible to actually use NFSv4 permission bits with acl_set_perm(3)
and acl_delete_perm(3).  It went undetected, because neither setfacl(1)
nor Samba use this routines.  D'oh.
2010-05-20 18:45:07 +00:00
Gordon Tetlow
db86a57ece MFC r207981:
Fix a bug due to a type conversion from 64 to 32 bits. The side effect of
 this type conversion is the high bits which were used to indicate if a
 special character was a literal or special were dropped. As a result, all
 special character were treated as special, even if they were supposed to
 be literals.

Approved by:	mentor (wes@)
2010-05-19 22:03:45 +00:00
Kai Wang
73f68b3d41 MFC r205728
Merge improvements from kernel HID parser to the userland usbhid(3)
  parser.  This merge does not change any API and should not break any
  native or thirdparty applications.

  Changes include:

  * Merge multiple report ID support and other improvements from kernel
    HID parser.
  * Ignore rid argument in hid_start_parser, parse all the report items since
    we now support multiple report ID.
  * Skip report ID byte in hid_get_data() and set report ID byte in
    hid_set_data(), if report ID is non-zero.
  * Reimplement hid_get_report_id: instead get report id from uhid device
    (which is always 0), try parsing the report descriptor and return the
    first report ID encountered.

MFC r207812

  hid_get_data() now expects that the hid data passed in always contains
  the report ID byte. Thus we should not skip the the report ID byte in
  hid_interrupt().  Also, if HUP_KEYBOARD usage is an array, do not try
  to modify the 'data' pointer, instead, increase the hid_item_t field
  'pos' by 'report_size' before calling hid_get_data() during each
  iteration.
2010-05-18 10:32:20 +00:00
Martin Matuska
3829a73468 MFC r207842, r207844, r208099:
MFC r207842:
Import of liblzma, xz, xzdec, lzmainfo from vendor branch
Add support for xz and lzma to lesspipe.sh (xzless, lzless)

MFC r207844:
Add two public headers missing in r207842
Adjust CFLAGS for lzmainfo, xz, xzdec

MFC r208099:
Add versioned symbols to liblzma
Use default SHLIB_MAJOR.

Approved by:	delphij (mentor)
2010-05-18 09:59:09 +00:00
Andrew Thompson
574f062304 MFC r208023
Use fixed width integer types for parsing the binary hid data.
2010-05-18 03:16:02 +00:00
Martin Matuska
379e47715a MFC r204738, r205113 (imp):
MFC r204738:
Remove stale references to libkrb5.
Rejigger the SUBDIR setting a smidge: we now set all the libraries that depend
on something else, and then SUBDIR+= the rest.

MFC r205113:
Make this conform to the other top-level Makefile subdir listings with
one file per line.

Approved by:	delphij (mentor)
2010-05-18 00:46:15 +00:00
Andrew Thompson
be5dc99871 MFC r203773
Within libusb 0.1 API, bus number is always faked to 0. Device numbers,
 however, are possitive and seem to be reverse sorted in the list.

 Conform device numbering and bring a result that is consistent with the
 libusb 0.1 API.  It is now possible to distinguish a device based on its
 (bus, dev) numbers.
2010-05-17 23:59:14 +00:00
Andrew Thompson
1eeca0bf19 MFC r208012
Support getting signed and unsigned HID data.
2010-05-17 23:57:34 +00:00
Andrew Thompson
300902e282 MFC r208021
Fix return values for usb_find_busses() and usb_find_devices(). We should try
 to return the actual number of busses and devices.
2010-05-17 23:56:17 +00:00
Andrew Thompson
005044bdc0 MFC r208020
Fix header file compliancy with libusb 1.0 from sourceforge.
2010-05-17 23:55:23 +00:00
Martin Matuska
66a7924d0b MFC r207553, r207555, r207651:
Implement the no_user_check option to pam_krb5.

This option is available in the Linux implementation of pam_krb5
and allows to authorize a user not known to the local system.

Ccache is not used as we don't have a secure uid/gid for the cache file.

Usable for authentication of external kerberos users (e.g Active Directory)
via PAM from applications like Cyrus saslauthd, PHP or perl.

PR:		bin/146186
Approved by:	deplhij (mentor)
2010-05-17 14:27:40 +00:00
Xin LI
42ddb8f1db MFC r205099-205100,205108:
Two optimizations to MI strlen(3) inspired by David S. Miller's
blog posting [1].

 - Use word-sized test for unaligned pointer before working
   the hard way.

   Memory page boundary is always integral multiple of a word
   alignment boundary.  Therefore, if we can access memory
   referenced by pointer p, then (p & ~word mask) must be also
   accessible.

 - Better utilization of multi-issue processor's ability of
   concurrency.

   The previous implementation utilized a formular that must be
   executed sequentially.  However, the ~, & and - operations can
   actually be caculated at the same time when the operand were
   different and unrelated.

   The original Hacker's Delight formular also offered consistent
   performance regardless whether the input would contain
   characters with their highest-bit set, as it catches real
   nul characters only.

These two optimizations has shown further improvements over the
previous implementation on microbenchmarks on i386 and amd64 CPU
including Pentium 4, Core Duo 2 and i7.

[1] http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/03/08#strlen_1
2010-05-13 23:28:20 +00:00
Jilles Tjoelker
1270ecd86a MFC r207734: sigaltstack(2): document some modernizations:
* un-document 'struct sigaltstack' tag for stack_t as this is BSD-specific;
  this doesn't seem useful enough to document as such
* alternate stacks are per thread, not per process
* update error codes to what the kernel does and POSIX requires
2010-05-13 15:44:49 +00:00
Konstantin Belousov
bdf855784c MFC r207604:
Document RUSAGE_THREAD.
2010-05-11 13:39:37 +00:00
Jilles Tjoelker
3a425b8d28 MFC r206760: getcwd(3): Clarify that EACCES may or may not be checked.
POSIX permits but does not require checking access on the current and parent
directories.

Because various programs do not like it if getcwd(3) fails, it seems best
to avoid checking access as much as possible. There are various reports in
GNATS about this (search for getcwd).

Our getcwd(3) implementation first queries the kernel for the pathname
directly, which does not check any permissions but sometimes fails, and then
falls back to reading all parent directories for the names.

PR:		standards/44425
2010-05-05 22:17:17 +00:00
Jilles Tjoelker
2239c5fda0 MFC r207190: unlinkat(2): unlinkat(AT_REMOVEDIR) fails with ENOTEMPTY
like rmdir() for non-empty directories.

POSIX permits both ENOTEMPTY and EEXIST, but we use the clearer ENOTEMPTY,
following BSD tradition.
2010-05-05 22:12:56 +00:00
Jilles Tjoelker
ad5308635f MFC r207186: sysctl(3): Update description of various kern.* variables.
Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3)
(which is a more convenient way to access some of the variables).

PR:		116480
2010-05-05 22:00:57 +00:00
Konstantin Belousov
5e7622a371 MFC r207009:
C language does not has references, it provides pointers.
2010-05-05 09:29:34 +00:00
Konstantin Belousov
14d447de52 MFC r206893:
Slightly modernize realpath(3).

SUSv4 requires that implementation returns EINVAL if supplied path is NULL,
and ENOENT if path is empty string [1].
Bring prototype in conformance with SUSv4, adding restrict keywords.
Allow the resolved path buffer pointer be NULL, in which case realpath(3)
allocates storage with malloc().

MFC r206898:
Free() is not allowed to modify errno, remove safety brackets around it.
Add small optimization, do not copy a string to the buffer that is
to be freed immediately after.

MFC r206997:
Move realpath(3) prototype to a POSIX section.

MFC r206998:
Add standards section, improve wording, taking into account the handling
of NULL and changed type in declaration.
2010-05-04 05:34:18 +00:00
Marius Strobl
4ee4735187 MFC: r206490, r206492
While SPARC V9 allows tininess to be detected either before or after
rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
UltraSPARC processors defines that in all cases tininess is detected
before rounding therefore rounding up to the smallest normalized number
should set the underflow flag. This change is needed for using SoftFloat
on sparc64 for reference purposes.

PR:		144900
Submitted by:	Peter Jeremy
2010-05-02 16:52:23 +00:00
Jilles Tjoelker
03da203042 MFC r207187: kvm(3): Mention that some of the functions use sysctl(3)
instead of kmem.

Additionally, because of sysctl(3) use (which is generally good), behaviour
for crash dumps differs slightly from behaviour for live kernels and this
will probably never be fixed entirely, so weaken that claim.
2010-05-02 12:38:59 +00:00
Jilles Tjoelker
8b0241c2d4 MFC r206711: fnmatch: Fix bad FNM_PERIOD disabling
if an asterisk has been seen.

Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD)

PR:		116074
2010-04-23 18:01:19 +00:00
Konstantin Belousov
c36c99a99d MFC r206549:
Align the declaration for sa_sigaction with POSIX.

MFC r206649:
Still reference struct __sigaction with clarification when this form
of argument declaration is needed.

MFC r206802:
Revert r206649. Simplify the presented declaration of struct sigaction.
2010-04-21 11:09:13 +00:00
Dag-Erling Smørgrav
124981e16f MFH OpenSSH 5.4p1 2010-04-21 06:33:10 +00:00
Xin LI
2c221f6f88 MFC assembler version of match functions for amd64 and i386(*).
This gives approximately 15% improvement on compression case.

(*) i386 assembler version is enabled ONLY when MACHINE_CPU have
'i686' which is not default on FreeBSD/i386.  One can specify
for instance CPUTYPE=pentium4 in /etc/make.conf to get this
feature.
2010-04-20 22:57:05 +00:00
Hajimu UMEMOTO
4deeadcb9b MFC r206155, r206267: Add capability to use a db version of
services.  It is enabled by specifying `db' as source of
services in /etc/nsswitch.conf.
2010-04-18 04:07:32 +00:00
Hajimu UMEMOTO
b7a43116e9 MFC ir206152, r206153, r206154:
- Stop adding trailing '\n'.  The servent_unpack() doesn't expect
  lines terminated with '\n'.
- Treat '+' as special only when in compat mode, and simplify
  the logic bit.
- Reduce duplicate code.
2010-04-18 03:52:41 +00:00
Fabien Thomas
cc32d5b339 MFC r206089, r206684:
- Support for uncore counting events: one fixed PMC with the uncore
   domain clock, 8 programmable PMC.
- Westmere based CPU (Xeon 5600, Corei7 980X) support.
- New man pages with events list for core and uncore.
- Updated Corei7 events with Intel 253669-033US December 2009 doc.
  There is some removed events in the documentation, they have been
  kept in the code but documented in the man page as obsolete.
- Offcore response events can be setup with rsp token.

Sponsored by: NETASQ
2010-04-16 15:45:09 +00:00
John Baldwin
a9a298a070 MFC 205900:
Use panic() (which the environment is required to provide to libstand) to
implement assert() instead of relying on a non-required exit().  The exit()
invocation also did not match the semantics of the exit() routine that
current boot environments happen to require.
2010-04-14 17:17:06 +00:00
John Baldwin
f70ad5484f MFC 205536:
Reject attempts to create a MAP_ANON mapping with a non-zero offset.
2010-04-14 15:22:58 +00:00
Edward Tomasz Napierala
5b796d064a MFC r205796:
Make acl_to_text_np(3) not crash on long group or user names in NFSv4 ACLs.

PR:		amd64/145091
2010-04-13 06:01:24 +00:00
Andriy Gapon
d1bec90bbe MFC r206178: ibc/db/hash: cap auto-tuned block size 2010-04-12 21:12:03 +00:00
Andriy Gapon
a1a102fb15 MFC r206177: hash.3: fix a factual mistake in the man page 2010-04-08 07:43:15 +00:00
Andrew Thompson
6836afc4c6 MFC r203147
Add a function to check if the usb devices is still connected.

Submitted by:	Hans Petter Selasky
2010-04-07 00:34:05 +00:00
Pietro Cerutti
28f9173691 MFC r205606
Remove const'ness from dlerror(3) prototype, for consistency with POSIX.

Approved by:	cognet
2010-03-31 13:51:31 +00:00
Marius Strobl
aa1750167b MFC: r205410
Avoid aliasing which leads to incorrect results when compiling with the
default strict aliasing rules.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:13:37 +00:00
Marius Strobl
1185606b8c MFC: r205397
- While SPARC V9 allows tininess to be detected either before or after
  rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
  UltraSPARC processors defines that in all cases tinyness is detected
  before rounding, therefore rounding up to the smallest normalised
  number should set the underflow flag.
- If an infinite result is rounded down, the result should have an
  exponent 1 less than the value for infinity.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:08:02 +00:00
Marius Strobl
fa38e6334c MFC: r205396
Division should take both arguments' signs into account when the
the dividend is infinity or zero and the divisor is not the same.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:06:31 +00:00
Marius Strobl
35cbfc2ca0 MFC: r205395
FPU_DEBUG requires <stdio.h>.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:05:08 +00:00
Marius Strobl
3f6c7d0307 MFC: r205394
Ensure that __fpu_ftox() both returns the high bits and res[1] contains
the low bits also in the default case.

PR:		144900
Obtained from:	OpenBSD
2010-03-30 19:03:26 +00:00
Marius Strobl
c3342f6536 MFC: r205393
- Remove a bogus forward declaration.
- Fix whitespace.
2010-03-30 18:58:07 +00:00
Doug Barton
ecb246eba6 Update to 9.6.2-P1, the latest patchfix release which deals with
the problems related to the handling of broken DNSSEC trust chains.

This fix is only relevant for those who have DNSSEC validation
enabled and configure trust anchors from third parties, either
manually, or through a system like DLV.
2010-03-29 06:31:58 +00:00
Jilles Tjoelker
135346b2c1 MFC r205398: Do not create *.gmon files for PIE executables on i386.
Scrt1_c.o was accidentally compiled with -DGCRT (profiling), like gcrt1_c.o.
This problem is i386-specific, the other architectures are OK.

If you have problems with PIE executables such as samba and cups leaving
behind gmon files, rebuild them after installing this change.

PR:		ports/143924
2010-03-23 23:25:17 +00:00
John Baldwin
f5ccef8fd9 MFC 204950,205020:
Use thr_once() with once_t controls to initialize various thread_key_t
objects used to provide per-thread storage in the RPC code.  Almost all
of these used double-checking with a dedicated mutex (tsd_lock) to do this
before.  However, that is not always safe with more relaxed memory orders.
There were also other bugs, such as one in __rpc_createrr() that caused a
new key to be allocated each time __rpc_createrr() was invoked.
2010-03-22 15:52:26 +00:00
Marius Strobl
2181f8f5be MFC: r204974, r205002
- The OPSZ macro actually only does the right thing for int32 and int64
  operands but not for double and extended double ones. Instead of trying
  to fix the macro just nuke it and unroll the loops in the correct way
  though as extended double operands turn out to be the only special case.
- For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded
  after setting type accordingly as it's generally decoded using the low
  2 bits as the type, which are 0 for these three instructions.
- Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be
  re-decoded using not only the operand mask appropriate for int64 but
  also the correct register number encoding.
- Use const where appropriate.
- Wrap long lines.

Submitted by:	Peter Jeremy (partly)
2010-03-15 18:32:57 +00:00
Jaakko Heinonen
324846ecfa MFC r204447:
In _gettemp(), check that the length of the path doesn't exceed
MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
carrybuf causing a buffer overflow.

PR:		bin/140228
2010-03-12 06:56:51 +00:00
Gregory Neil Shapiro
1b0154570e MFC: Enable the use of nanosleep() instead of using pause() and signals.
This Makefile change can be removed when the next version of sendmail
     is imported as it will have this built in to the FreeBSD conf.h section.
2010-03-07 02:02:07 +00:00