mirror of https://github.com/shirou/gopsutil
[process]freebsd: process_freebsd_amd64.go is now generated by cgo godefs.
parent
e5c53aa342
commit
37b6b4051f
@ -1,125 +1,192 @@
|
||||
// +build freebsd
|
||||
// +build amd64
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs types_freebsd.go
|
||||
|
||||
package process
|
||||
|
||||
// copied from sys/sysctl.h
|
||||
const (
|
||||
CTLKern = 1 // "high kernel": proc, limits
|
||||
KernProc = 14 // struct: process entries
|
||||
KernProcPID = 1 // by process id
|
||||
KernProcProc = 8 // only return procs
|
||||
KernProcPathname = 12 // path to executable
|
||||
KernProcArgs = 7 // get/set arguments/proctitle
|
||||
CTLKern = 1
|
||||
KernProc = 14
|
||||
KernProcPID = 1
|
||||
KernProcProc = 8
|
||||
KernProcPathname = 12
|
||||
KernProcArgs = 7
|
||||
)
|
||||
|
||||
const (
|
||||
sizeofPtr = 0x8
|
||||
sizeofShort = 0x2
|
||||
sizeofInt = 0x4
|
||||
sizeofLong = 0x8
|
||||
sizeofLongLong = 0x8
|
||||
)
|
||||
|
||||
const (
|
||||
sizeOfKinfoVmentry = 0x488
|
||||
sizeOfKinfoProc = 0x440
|
||||
)
|
||||
|
||||
const (
|
||||
SIDL = 1
|
||||
SRUN = 2
|
||||
SSLEEP = 3
|
||||
SSTOP = 4
|
||||
SZOMB = 5
|
||||
SWAIT = 6
|
||||
SLOCK = 7
|
||||
)
|
||||
|
||||
type (
|
||||
_C_short int16
|
||||
_C_int int32
|
||||
_C_long int64
|
||||
_C_long_long int64
|
||||
)
|
||||
|
||||
type Timespec struct {
|
||||
Sec int64
|
||||
Nsec int64
|
||||
Sec int64
|
||||
Nsec int64
|
||||
}
|
||||
|
||||
type Timeval struct {
|
||||
Sec int64
|
||||
Usec int64
|
||||
Sec int64
|
||||
Usec int64
|
||||
}
|
||||
|
||||
type Rusage struct {
|
||||
Utime Timeval
|
||||
Stime Timeval
|
||||
Maxrss int64
|
||||
Ixrss int64
|
||||
Idrss int64
|
||||
Isrss int64
|
||||
Minflt int64
|
||||
Majflt int64
|
||||
Nswap int64
|
||||
Inblock int64
|
||||
Oublock int64
|
||||
Msgsnd int64
|
||||
Msgrcv int64
|
||||
Nsignals int64
|
||||
Nvcsw int64
|
||||
Nivcsw int64
|
||||
Utime Timeval
|
||||
Stime Timeval
|
||||
Maxrss int64
|
||||
Ixrss int64
|
||||
Idrss int64
|
||||
Isrss int64
|
||||
Minflt int64
|
||||
Majflt int64
|
||||
Nswap int64
|
||||
Inblock int64
|
||||
Oublock int64
|
||||
Msgsnd int64
|
||||
Msgrcv int64
|
||||
Nsignals int64
|
||||
Nvcsw int64
|
||||
Nivcsw int64
|
||||
}
|
||||
|
||||
type Rlimit struct {
|
||||
Cur int64
|
||||
Max int64
|
||||
}
|
||||
|
||||
// copied from sys/user.h
|
||||
type KinfoProc struct {
|
||||
KiStructsize int32
|
||||
KiLayout int32
|
||||
KiArgs int64
|
||||
KiPaddr int64
|
||||
KiAddr int64
|
||||
KiTracep int64
|
||||
KiTextvp int64
|
||||
KiFd int64
|
||||
KiVmspace int64
|
||||
KiWchan int64
|
||||
KiPid int32
|
||||
KiPpid int32
|
||||
KiPgid int32
|
||||
KiTpgid int32
|
||||
KiSid int32
|
||||
KiTsid int32
|
||||
KiJobc [2]byte
|
||||
KiSpareShort1 [2]byte
|
||||
KiTdev int32
|
||||
KiSiglist [16]byte
|
||||
KiSigmask [16]byte
|
||||
KiSigignore [16]byte
|
||||
KiSigcatch [16]byte
|
||||
KiUID int32
|
||||
KiRuid int32
|
||||
KiSvuid int32
|
||||
KiRgid int32
|
||||
KiSvgid int32
|
||||
KiNgroups [2]byte
|
||||
KiSpareShort2 [2]byte
|
||||
KiGroups [64]byte
|
||||
KiSize int64
|
||||
KiRssize int64
|
||||
KiSwrss int64
|
||||
KiTsize int64
|
||||
KiDsize int64
|
||||
KiSsize int64
|
||||
KiXstat [2]byte
|
||||
KiAcflag [2]byte
|
||||
KiPctcpu int32
|
||||
KiEstcpu int32
|
||||
KiSlptime int32
|
||||
KiSwtime int32
|
||||
KiCow int32
|
||||
KiRuntime int64
|
||||
KiStart [16]byte
|
||||
KiChildtime [16]byte
|
||||
KiFlag int64
|
||||
KiKflag int64
|
||||
KiTraceflag int32
|
||||
KiStat [1]byte
|
||||
KiNice [1]byte
|
||||
KiLock [1]byte
|
||||
KiRqindex [1]byte
|
||||
KiOncpu [1]byte
|
||||
KiLastcpu [1]byte
|
||||
KiOcomm [17]byte
|
||||
KiWmesg [9]byte
|
||||
KiLogin [18]byte
|
||||
KiLockname [9]byte
|
||||
KiComm [20]byte
|
||||
KiEmul [17]byte
|
||||
KiSparestrings [68]byte
|
||||
KiSpareints [36]byte
|
||||
KiCrFlags int32
|
||||
KiJid int32
|
||||
KiNumthreads int32
|
||||
KiTid int32
|
||||
KiPri int32
|
||||
KiRusage Rusage
|
||||
KiRusageCh [144]byte
|
||||
KiPcb int64
|
||||
KiKstack int64
|
||||
KiUdata int64
|
||||
KiTdaddr int64
|
||||
KiSpareptrs [48]byte
|
||||
KiSpareint64s [96]byte
|
||||
KiSflag int64
|
||||
KiTdflags int64
|
||||
Structsize int32
|
||||
Layout int32
|
||||
Args int64 /* pargs */
|
||||
Paddr int64 /* proc */
|
||||
Addr int64 /* user */
|
||||
Tracep int64 /* vnode */
|
||||
Textvp int64 /* vnode */
|
||||
Fd int64 /* filedesc */
|
||||
Vmspace int64 /* vmspace */
|
||||
Wchan int64
|
||||
Pid int32
|
||||
Ppid int32
|
||||
Pgid int32
|
||||
Tpgid int32
|
||||
Sid int32
|
||||
Tsid int32
|
||||
Jobc int16
|
||||
Spare_short1 int16
|
||||
Tdev uint32
|
||||
Siglist [16]byte /* sigset */
|
||||
Sigmask [16]byte /* sigset */
|
||||
Sigignore [16]byte /* sigset */
|
||||
Sigcatch [16]byte /* sigset */
|
||||
Uid uint32
|
||||
Ruid uint32
|
||||
Svuid uint32
|
||||
Rgid uint32
|
||||
Svgid uint32
|
||||
Ngroups int16
|
||||
Spare_short2 int16
|
||||
Groups [16]uint32
|
||||
Size uint64
|
||||
Rssize int64
|
||||
Swrss int64
|
||||
Tsize int64
|
||||
Dsize int64
|
||||
Ssize int64
|
||||
Xstat uint16
|
||||
Acflag uint16
|
||||
Pctcpu uint32
|
||||
Estcpu uint32
|
||||
Slptime uint32
|
||||
Swtime uint32
|
||||
Cow uint32
|
||||
Runtime uint64
|
||||
Start Timeval
|
||||
Childtime Timeval
|
||||
Flag int64
|
||||
Kiflag int64
|
||||
Traceflag int32
|
||||
Stat int8
|
||||
Nice int8
|
||||
Lock int8
|
||||
Rqindex int8
|
||||
Oncpu uint8
|
||||
Lastcpu uint8
|
||||
Tdname [17]int8
|
||||
Wmesg [9]int8
|
||||
Login [18]int8
|
||||
Lockname [9]int8
|
||||
Comm [20]int8
|
||||
Emul [17]int8
|
||||
Loginclass [18]int8
|
||||
Sparestrings [50]int8
|
||||
Spareints [7]int32
|
||||
Flag2 int32
|
||||
Fibnum int32
|
||||
Cr_flags uint32
|
||||
Jid int32
|
||||
Numthreads int32
|
||||
Tid int32
|
||||
Pri Priority
|
||||
Rusage Rusage
|
||||
Rusage_ch Rusage
|
||||
Pcb int64 /* pcb */
|
||||
Kstack int64
|
||||
Udata int64
|
||||
Tdaddr int64 /* thread */
|
||||
Spareptrs [6]int64
|
||||
Sparelongs [12]int64
|
||||
Sflag int64
|
||||
Tdflags int64
|
||||
}
|
||||
|
||||
type Priority struct {
|
||||
Class uint8
|
||||
Level uint8
|
||||
Native uint8
|
||||
User uint8
|
||||
}
|
||||
|
||||
type KinfoVmentry struct {
|
||||
Structsize int32
|
||||
Type int32
|
||||
Start uint64
|
||||
End uint64
|
||||
Offset uint64
|
||||
Vn_fileid uint64
|
||||
Vn_fsid uint32
|
||||
Flags int32
|
||||
Resident int32
|
||||
Private_resident int32
|
||||
Protection int32
|
||||
Ref_count int32
|
||||
Shadow_count int32
|
||||
Vn_type int32
|
||||
Vn_size uint64
|
||||
Vn_rdev uint32
|
||||
Vn_mode uint16
|
||||
Status uint16
|
||||
X_kve_ispare [12]int32
|
||||
Path [1024]int8
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
// +build ignore
|
||||
|
||||
// We still need editing by hands.
|
||||
// go tool cgo -godefs types_freebsd.go | sed 's/\*int64/int64/' | sed 's/\*byte/int64/' > process_freebsd_amd64.go
|
||||
|
||||
/*
|
||||
Input to cgo -godefs.
|
||||
*/
|
||||
|
||||
// +godefs map struct_pargs int64 /* pargs */
|
||||
// +godefs map struct_proc int64 /* proc */
|
||||
// +godefs map struct_user int64 /* user */
|
||||
// +godefs map struct_vnode int64 /* vnode */
|
||||
// +godefs map struct_vnode int64 /* vnode */
|
||||
// +godefs map struct_filedesc int64 /* filedesc */
|
||||
// +godefs map struct_vmspace int64 /* vmspace */
|
||||
// +godefs map struct_pcb int64 /* pcb */
|
||||
// +godefs map struct_thread int64 /* thread */
|
||||
// +godefs map struct___sigset [16]byte /* sigset */
|
||||
|
||||
package process
|
||||
|
||||
/*
|
||||
#include <sys/types.h>
|
||||
#include <sys/user.h>
|
||||
|
||||
enum {
|
||||
sizeofPtr = sizeof(void*),
|
||||
};
|
||||
|
||||
|
||||
*/
|
||||
import "C"
|
||||
|
||||
// Machine characteristics; for internal use.
|
||||
|
||||
const (
|
||||
CTLKern = 1 // "high kernel": proc, limits
|
||||
KernProc = 14 // struct: process entries
|
||||
KernProcPID = 1 // by process id
|
||||
KernProcProc = 8 // only return procs
|
||||
KernProcPathname = 12 // path to executable
|
||||
KernProcArgs = 7 // get/set arguments/proctitle
|
||||
)
|
||||
|
||||
const (
|
||||
sizeofPtr = C.sizeofPtr
|
||||
sizeofShort = C.sizeof_short
|
||||
sizeofInt = C.sizeof_int
|
||||
sizeofLong = C.sizeof_long
|
||||
sizeofLongLong = C.sizeof_longlong
|
||||
)
|
||||
|
||||
const (
|
||||
sizeOfKinfoVmentry = C.sizeof_struct_kinfo_vmentry
|
||||
sizeOfKinfoProc = C.sizeof_struct_kinfo_proc
|
||||
)
|
||||
|
||||
// from sys/proc.h
|
||||
const (
|
||||
SIDL = 1 /* Process being created by fork. */
|
||||
SRUN = 2 /* Currently runnable. */
|
||||
SSLEEP = 3 /* Sleeping on an address. */
|
||||
SSTOP = 4 /* Process debugging or suspension. */
|
||||
SZOMB = 5 /* Awaiting collection by parent. */
|
||||
SWAIT = 6 /* Waiting for interrupt. */
|
||||
SLOCK = 7 /* Blocked on a lock. */
|
||||
)
|
||||
|
||||
// Basic types
|
||||
|
||||
type (
|
||||
_C_short C.short
|
||||
_C_int C.int
|
||||
_C_long C.long
|
||||
_C_long_long C.longlong
|
||||
)
|
||||
|
||||
// Time
|
||||
|
||||
type Timespec C.struct_timespec
|
||||
|
||||
type Timeval C.struct_timeval
|
||||
|
||||
// Processes
|
||||
|
||||
type Rusage C.struct_rusage
|
||||
|
||||
type Rlimit C.struct_rlimit
|
||||
|
||||
type KinfoProc C.struct_kinfo_proc
|
||||
|
||||
type Priority C.struct_priority
|
||||
|
||||
type KinfoVmentry C.struct_kinfo_vmentry
|
Loading…
Reference in New Issue