unix: add taskstats type and constants on Linux

Taskstats is a netlink-based interface for sending per-task and
per-process statistics from the kernel to userspace.

For more information, please see:
https://www.kernel.org/doc/Documentation/accounting/taskstats.txt.

Fixes golang/go#21616.

Change-Id: I7d4b8035aa8e993074d61911d9a8c3a3e61c9b2e
Reviewed-on: https://go-review.googlesource.com/59050
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Matt Layher
2017-08-25 17:12:00 +00:00
parent 07c182904d
commit 22e23b7432
24 changed files with 634 additions and 0 deletions
+5
View File
@@ -62,6 +62,7 @@ package unix
#include <linux/fs.h>
#include <linux/vm_sockets.h>
#include <linux/random.h>
#include <linux/taskstats.h>
// On mips64, the glibc stat and kernel stat do not agree
#if (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64)
@@ -550,3 +551,7 @@ const _SC_PAGESIZE = C._SC_PAGESIZE
type Termios C.termios_t
type Winsize C.struct_winsize
// Taskstats
type Taskstats C.struct_taskstats