mirror of https://github.com/shirou/gopsutil
host linux now use godefs.
parent
64f1a93c00
commit
cfb473f810
@ -1,27 +1,42 @@
|
|||||||
// +build linux
|
// Created by cgo -godefs - DO NOT EDIT
|
||||||
// +build amd64
|
// cgo -godefs types_linux.go
|
||||||
|
|
||||||
package host
|
package host
|
||||||
|
|
||||||
type exitStatus struct {
|
const (
|
||||||
Etermination int16 // Process termination status.
|
sizeofPtr = 0x8
|
||||||
Eexit int16 // Process exit status.
|
sizeofShort = 0x2
|
||||||
}
|
sizeofInt = 0x4
|
||||||
type timeval struct {
|
sizeofLong = 0x8
|
||||||
TvSec uint32 // Seconds.
|
sizeofLongLong = 0x8
|
||||||
TvUsec uint32 // Microseconds.
|
)
|
||||||
}
|
|
||||||
|
type (
|
||||||
|
_C_short int16
|
||||||
|
_C_int int32
|
||||||
|
_C_long int64
|
||||||
|
_C_long_long int64
|
||||||
|
)
|
||||||
|
|
||||||
type utmp struct {
|
type utmp struct {
|
||||||
UtType int16 // Type of login.
|
Type int16
|
||||||
UtPid int32 // Process ID of login process.
|
Pad_cgo_0 [2]byte
|
||||||
UtLine [32]byte // Devicename.
|
Pid int32
|
||||||
UtID [4]byte // Inittab ID.
|
Line [32]int8
|
||||||
UtUser [32]byte // Username.
|
Id [4]int8
|
||||||
UtHost [256]byte // Hostname for remote login.
|
User [32]int8
|
||||||
UtExit exitStatus // Exit status of a process marked
|
Host [256]int8
|
||||||
UtSession int32 // Session ID, used for windowing.
|
Exit exit_status
|
||||||
UtTv timeval // Time entry was made.
|
Session int32
|
||||||
UtAddrV6 [16]byte // Internet address of remote host.
|
Tv UtTv
|
||||||
Unused [20]byte // Reserved for future use. // original is 20
|
Addr_v6 [4]int32
|
||||||
|
X__glibc_reserved [20]int8
|
||||||
|
}
|
||||||
|
type exit_status struct {
|
||||||
|
Termination int16
|
||||||
|
Exit int16
|
||||||
|
}
|
||||||
|
type UtTv struct {
|
||||||
|
TvSec int32
|
||||||
|
TvUsec int32
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
// +build ignore
|
||||||
|
|
||||||
|
/*
|
||||||
|
Input to cgo -godefs.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package host
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define KERNEL
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <utmp.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
sizeofPtr = sizeof(void*),
|
||||||
|
};
|
||||||
|
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
// Machine characteristics; for internal use.
|
||||||
|
|
||||||
|
const (
|
||||||
|
sizeofPtr = C.sizeofPtr
|
||||||
|
sizeofShort = C.sizeof_short
|
||||||
|
sizeofInt = C.sizeof_int
|
||||||
|
sizeofLong = C.sizeof_long
|
||||||
|
sizeofLongLong = C.sizeof_longlong
|
||||||
|
)
|
||||||
|
|
||||||
|
// Basic types
|
||||||
|
|
||||||
|
type (
|
||||||
|
_C_short C.short
|
||||||
|
_C_int C.int
|
||||||
|
_C_long C.long
|
||||||
|
_C_long_long C.longlong
|
||||||
|
)
|
||||||
|
|
||||||
|
type utmp C.struct_utmp
|
||||||
|
type exit_status C.struct_exit_status
|
||||||
|
type UtTv struct {
|
||||||
|
TvSec int32
|
||||||
|
TvUsec int32
|
||||||
|
}
|
Loading…
Reference in New Issue