MFC r249666, r249667, r249670, r249672, r249674, r249676, r249677, r249679,
    r249681, r249684, r249688, r249711, r249731, r250146

r249666, r249682:

Make libprocstat(3) extract procstat notes from a process core file.

PR:		kern/173723
Suggested by:	jhb
Glanced by:	kib

r249667:

Add procstat_getvmmap function to get VM layout of a process.

r249670:

Add procstat_getgroups function to retrieve process groups.

r249672:

Add procstat_getumask function to retrieve a process umask.

r249674:

Add procstat_getrlimit function to retrieve a process resource limits info.

r249676:

Add procstat_getpathname function to retrieve a process executable.

r249677:

Add procstat_getosrel function to retrieve a process osrel info.

r249679:

Extend libprocstat with functions to retrieve process command line
arguments and environment variables.

Suggested by:	stas
Reviewed by:	jhb and stas (initial version)

r249681:

Add procstat_getauxv function to retrieve a process auxiliary vector.

r249684:

Add procstat_getkstack function to dump kernel stacks of a process.

r249688:

Bump date.

r249711 (joel):

mdoc: end function context properly.

r249731:

Embed revision id in the library.

r250146:

KVM method support for procstat_getgroups, procstat_getumask,
procstat_getrlimit, and procstat_getosrel.
MFC r249668, r249669, r249671, r249673, r249675, r249678, r249680, r249683,
    r249685, r249686:

r249668:

Use procstat_getprocs(3) for retrieving thread information instead of
direct sysctl calls.

r249669:

Use more generic procstat_getvmmap(3) for retrieving VM layout of a process.

r249671:

Use procstat_getgroups(3) for retrieving groups information instead of
direct sysctl.

r249673:

Use procstat_getumask(3) for retrieving umaks information instead of
direct sysctl.

r249675:

Use procstat_getrlimit(3) for retrieving rlimit information instead of
direct sysctl calls.

r249678:

Use libprocstat(3) when retrieving binary information for a process.

r249680:

Use libprocstat(3) to retrieve process command line arguments and
environment variables.

r249683:

Use libprocstat(3) to retrieve ELF auxiliary vector.

r249685:

Use procstat_getkstack(3) for retrieving process kernel stacks
instead of direct sysctl calls.

r249686:

Make use of newly added libprocstat(3) ability to extract procstat
info from a process core file.

So now one can run procstat(1) on a process core e.g. to get a list of
files opened by a process when it crashed:

root@lisa:/ # procstat -f /root/vi.core
  PID COMM               FD T V FLAGS     REF  OFFSET PRO NAME
  658 vi               text v r r--------   -       - -   /usr/bin/vi
  658 vi               ctty v c rw-------   -       - -   /dev/pts/0
  658 vi                cwd v d r--------   -       - -   /root
  658 vi               root v d r--------   -       - -   /
  658 vi                  0 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  1 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  2 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  3 v r r----n-l-   1       0 -   /tmp/vi.0AYKz3Lps7
  658 vi                  4 v r rw-------   1       0 -   /var/tmp/vi.recover/vi.GaGYsz
  658 vi                  5 v r rw-------   1       0 -   -

PR:		kern/173723
Suggested by:	jhb
MFC r249687, r249704, r250511:

r249687, r249704:

Sync gcore(1) with the recent changes in kernel code aimed at adding
procstat notes to a process core file.

Suggested by:	jhb

r250511 (antoine):

Add some missing DPADD.