MFC r234616:
Allow for the process information sysctls to accept a thread id in addition
to the process id.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r233507:
Use program exit status as pam_exec return code (optional)

pam_exec(8) now accepts a new option "return_prog_exit_status". When
set, the program exit status is used as the pam_exec return code. It
allows the program to tell why the step failed (eg. user unknown).
However, if it exits with a code not allowed by the calling PAM service
module function (see $PAM_SM_FUNC below), a warning is logged and
PAM_SERVICE_ERR is returned.

The following changes are related to this new feature but they apply no
matter if the "return_prog_exit_status" option is set or not.

The environment passed to the program is extended:
    o  $PAM_SM_FUNC contains the name of the PAM service module function
       (eg. pam_sm_authenticate).
    o  All valid PAM return codes' numerical values are available
       through variables named after the return code name. For instance,
       $PAM_SUCCESS, $PAM_USER_UNKNOWN or $PAM_PERM_DENIED.

pam_exec return code better reflects what went on:
    o  If the program exits with !0, the return code is now
       PAM_PERM_DENIED, not PAM_SYSTEM_ERR.
    o  If the program fails because of a signal (WIFSIGNALED) or doesn't
       terminate normally (!WIFEXITED), the return code is now
       PAM_SERVICE_ERR, not PAM_SYSTEM_ERR.
    o  If a syscall in pam_exec fails, the return code remains
       PAM_SYSTEM_ERR.

waitpid(2) is called in a loop. If it returns because of EINTR, do it
again. Before, it would return PAM_SYSTEM_ERR without waiting for the
child to exit.

Several log messages now include the PAM service module function name.

The man page is updated accordingly.

Reviewed by:	des@
Sponsored by:	Yakaz (http://www.yakaz.com)

MFC r234184:
Fix error messages containing the executed command name

Before, we took the first argument to pam_exec(8). With the addition of
options in front of the command, this could be wrong.

Now, options are parsed before calling _pam_exec() and messages contain
the proper command name.

While here, fix a warning.

Sponsored by:	Yakaz (http://www.yakaz.com)


git-svn-id: svn://svn.freebsd.org/base/stable/9@234842 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r233575:
Make ReiserFS MPSAFE

Most functions seemed to be already fine w.r.t. what's done in msdosfs.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234845 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r233998-r234000 and r234325:

r233998:
Add reserved memory limit sysctl to tmpfs.  Cleanup availble and used
memory functions.  Check if free pages available before allocating new
node.

r233999 (partial):
Add vfs_getopt_size. Support human readable file system options in tmpfs.
Increase maximum tmpfs file system size to 4GB*PAGE_SIZE on 32 bit archs.

NOTE: To preserve KBI add tmpfs_getopt_size function instead of global
vfs_getopt_size.

r234000:
tmpfs supports only INT_MAX nodes due to limitations of unit number
allocator.  Replace UINT32_MAX checks with INT_MAX. Keeping more than 2^31
nodes in memory is not likely to become possible in foreseeable feature
and would require new unit number allocator.

r234325:
Provide better description for vfs.tmpfs.memory_reserved sysctl.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234849 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r234345:

	VMware environment is frequent nowadays.  Add VMFS id.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9