Fix spelling of the function name in two assertion messages.


git-svn-id: svn://svn.freebsd.org/base/head@241140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
RPC: Convert all uid and gid variables of the type uid_t and gid_t.

This matches what upstream (OpenSolaris) does.

Tested by:	David Wolfskill
Obtained from:	Bull GNU/Linux NFSv4 project (libtirpc)
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241141 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix __rpc_getconfip

__rpc_getconfip is supposed to return the first netconf
entry supporting tcp or udp, respectively. The code will
currently return the *last* entry, plus it will leak
memory when there is more than one such entry.

This change matches the reference (OpenSolaris)
implementation.

Tested by:	David Wolfskill
Obtained from:	Bull GNU/linux NFSv4 Project (libtirpc)
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@241142 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
libtirpc: be sure to free cl_netid and cl_tp

When creating a client with clnt_tli_create, it uses strdup to copy
strings for these fields if nconf is passed in. clnt_dg_destroy frees
these strings already. Make sure clnt_vc_destroy frees them in the same
way.

This change matches the reference (OpenSolaris) implementation.

Tested by:	David Wolfskill
Obtained from:	Bull GNU/Linux NFSv4 Project (libtirpc)
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@241143 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement SATA revision (speed) control for legacy SATA controller for
both boot (via loader tunables) and run-time (via `camcontrol negotiate`).
Tested to work at least on NVIDIA MCP55 chipset.

H/w provided by:	glebius


git-svn-id: svn://svn.freebsd.org/base/head@241144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add casts to unbreak the i386 PAE build for the mps(4) driver.

MFC after:	3 days
Prompted by:	Garrett Cooper


git-svn-id: svn://svn.freebsd.org/base/head@241145 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge bmake-20120831 from vendor/NetBSD/bmake/dist.

Provenance: ftp://ftp.netbsd.org/pub/NetBSD/misc/sjg


git-svn-id: svn://svn.freebsd.org/base/head@241146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Import sysutils/sysrc from the ports tree (current version 5.1). Importing
disconnected under the WITH_BSDCONFIG flag (a good idea since this version of
sysrc(8) indeed requires the `sysrc.subr' module installed by bsdconfig(8)).

Multiple reasons sysrc should not simply continue to live in ports. The most
important being that it is tightly coupled with the base.

Approved by:	adrian (co-mentor)


git-svn-id: svn://svn.freebsd.org/base/head@241149 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
rpc: convert all uid and gid variables of the type uid_t and gid_t.

As part of the previous commit, uses of xdr_int() were replaced
with xdr_u_int(). This has undesired effects as the second
argument doesn't match exactly uid_t or gid_t. It also breaks
assumptions in the size of the provided types.

To work around those issues we revert back to the use of xdr_int()
but provide proper casting so the behaviour doesn't change.

While here fix a style issue in the affected lines.

Reported by:	bde


git-svn-id: svn://svn.freebsd.org/base/head@241152 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Optimize prev. commit for speed.
1) Don't iterate the loop from the environment array beginning each time,
iterate it under the last place we deactivate instead.
2) Call __rebuild_environ() not on each iteration but once, only at the end
of whole loop (of course, only in case if something is changed).

MFC after:      1 week


git-svn-id: svn://svn.freebsd.org/base/head@241154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Tidy up a bit:

Update some of the comments.  In particular, use "sleep" in preference to
"block" where appropriate.

Eliminate some unnecessary casts.

Make a few whitespace changes for consistency.

Reviewed by:	kib
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Reimplement pmap_qremove() using the new TLB invalidation function for
efficiently invalidating address ranges.


git-svn-id: svn://svn.freebsd.org/base/head@241156 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct detection of a superblock.

Obtained from:	Smartcom Bulgaria AD


git-svn-id: svn://svn.freebsd.org/base/head@241157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix build without `options ATA_CAM`, broken by r241144.


git-svn-id: svn://svn.freebsd.org/base/head@241160 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix faulty error code handling in read(2) on TTYs.

When performing a non-blocking read(2), on a TTY while no data is
available, we should return EAGAIN. But if there's a modem disconnect,
we should return 0. Right now we only return 0 when doing a blocking
read, which is wrong.

MFC after:	1 month


git-svn-id: svn://svn.freebsd.org/base/head@241161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Pull in r164717 from upstream clang trunk:

  Allow -MF to be used in combination with -E -M or -E -MM.

This should help with building the lang/ghc port.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@241163 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Replace all references to loader_callbacks_v1 with loader_callbacks.

Suggested by:	grehan@


git-svn-id: svn://svn.freebsd.org/base/head@241164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
rpc: convert all uid and gid variables of the type uid_t and gid_t.

The previous change (based on Solaris) doesn't work properly either
as the casting only has the effect of quieting the compiler.

Move back to the previous solution but adjust the sizeof()
type in xdr_array(). This should mostly work (by accident).

Reported by:	bde


git-svn-id: svn://svn.freebsd.org/base/head@241165 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Cast through void * to silence compiler warning

The base netmap pointer and offsets involved are provided by the kernel
side of the netmap interface and will have appropriate alignment.

Sponsored by: ADARA Networks
MFC After: 2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@241166 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove whitespace at EOL

Approved by:	joel (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@241167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f