mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-28 13:48:49 +08:00
start to use godefs to get C structs.
This commit is contained in:
parent
13cd195a7e
commit
4973aa73f9
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*~
|
*~
|
||||||
#*
|
#*
|
||||||
|
_obj
|
||||||
|
37
mktypes.sh
Normal file
37
mktypes.sh
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
DIRS="cpu disk docker host load mem net process"
|
||||||
|
|
||||||
|
GOOS=`uname | tr '[:upper:]' '[:lower:]'`
|
||||||
|
ARCH=`uname -m`
|
||||||
|
|
||||||
|
case $ARCH in
|
||||||
|
amd64)
|
||||||
|
GOARCH="amd64"
|
||||||
|
;;
|
||||||
|
x86_64)
|
||||||
|
GOARCH="amd64"
|
||||||
|
;;
|
||||||
|
i386)
|
||||||
|
GOARCH="386"
|
||||||
|
;;
|
||||||
|
i686)
|
||||||
|
GOARCH="386"
|
||||||
|
;;
|
||||||
|
arm)
|
||||||
|
GOARCH="arm"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unknown arch: $ARCH"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
for DIR in $DIRS
|
||||||
|
do
|
||||||
|
if [ -e ${DIR}/types_${GOOS}.go ]; then
|
||||||
|
echo "// +build $GOOS" > ${DIR}/${DIR}_${GOOS}_${GOARCH}.go
|
||||||
|
echo "// +build $GOARCH" >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go
|
||||||
|
go tool cgo -godefs ${DIR}/types_${GOOS}.go >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
@ -13,6 +13,16 @@ import (
|
|||||||
net "github.com/shirou/gopsutil/net"
|
net "github.com/shirou/gopsutil/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 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
|
||||||
|
KernProcAll = 0 // everything
|
||||||
|
KernProcPathname = 12 // path to executable
|
||||||
|
)
|
||||||
|
|
||||||
// MemoryInfoExStat is different between OSes
|
// MemoryInfoExStat is different between OSes
|
||||||
type MemoryInfoExStat struct {
|
type MemoryInfoExStat struct {
|
||||||
}
|
}
|
||||||
@ -42,7 +52,7 @@ func (p *Process) Ppid() (int32, error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return k.KiPpid, nil
|
return k.Proc.P_pid, nil
|
||||||
}
|
}
|
||||||
func (p *Process) Name() (string, error) {
|
func (p *Process) Name() (string, error) {
|
||||||
k, err := p.getKProc()
|
k, err := p.getKProc()
|
||||||
@ -50,7 +60,7 @@ func (p *Process) Name() (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(k.KiComm[:]), nil
|
return common.IntToString(k.Proc.P_comm[:]), nil
|
||||||
}
|
}
|
||||||
func (p *Process) Exe() (string, error) {
|
func (p *Process) Exe() (string, error) {
|
||||||
return "", common.NotImplementedError
|
return "", common.NotImplementedError
|
||||||
@ -73,7 +83,7 @@ func (p *Process) Status() (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(k.KiStat[:]), nil
|
return string(k.Proc.P_stat), nil // TODO
|
||||||
}
|
}
|
||||||
func (p *Process) Uids() ([]int32, error) {
|
func (p *Process) Uids() ([]int32, error) {
|
||||||
k, err := p.getKProc()
|
k, err := p.getKProc()
|
||||||
@ -83,7 +93,7 @@ func (p *Process) Uids() ([]int32, error) {
|
|||||||
|
|
||||||
uids := make([]int32, 0, 3)
|
uids := make([]int32, 0, 3)
|
||||||
|
|
||||||
uids = append(uids, int32(k.KiRuid), int32(k.KiUID), int32(k.KiSvuid))
|
uids = append(uids, int32(k.Eproc.Pcred.P_ruid), int32(k.Eproc.Ucred.Uid), int32(k.Eproc.Pcred.P_svuid))
|
||||||
|
|
||||||
return uids, nil
|
return uids, nil
|
||||||
}
|
}
|
||||||
@ -94,7 +104,7 @@ func (p *Process) Gids() ([]int32, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gids := make([]int32, 0, 3)
|
gids := make([]int32, 0, 3)
|
||||||
gids = append(gids, int32(k.KiRgid), int32(k.KiNgroups[0]), int32(k.KiSvuid))
|
gids = append(gids, int32(k.Eproc.Pcred.P_rgid), int32(k.Eproc.Ucred.Ngroups), int32(k.Eproc.Pcred.P_svgid))
|
||||||
|
|
||||||
return gids, nil
|
return gids, nil
|
||||||
}
|
}
|
||||||
@ -104,7 +114,7 @@ func (p *Process) Terminal() (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
ttyNr := uint64(k.KiTdev)
|
ttyNr := uint64(k.Eproc.Tdev)
|
||||||
|
|
||||||
termmap, err := getTerminalMap()
|
termmap, err := getTerminalMap()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -133,12 +143,16 @@ func (p *Process) NumFDs() (int32, error) {
|
|||||||
return 0, common.NotImplementedError
|
return 0, common.NotImplementedError
|
||||||
}
|
}
|
||||||
func (p *Process) NumThreads() (int32, error) {
|
func (p *Process) NumThreads() (int32, error) {
|
||||||
|
return 0, common.NotImplementedError
|
||||||
|
|
||||||
|
/*
|
||||||
k, err := p.getKProc()
|
k, err := p.getKProc()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return k.KiNumthreads, nil
|
return k.KiNumthreads, nil
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
func (p *Process) Threads() (map[string]string, error) {
|
func (p *Process) Threads() (map[string]string, error) {
|
||||||
ret := make(map[string]string, 0)
|
ret := make(map[string]string, 0)
|
||||||
@ -160,8 +174,8 @@ func (p *Process) MemoryInfo() (*MemoryInfoStat, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret := &MemoryInfoStat{
|
ret := &MemoryInfoStat{
|
||||||
RSS: uint64(k.KiRssize),
|
RSS: uint64(k.Eproc.Xrssize),
|
||||||
VMS: uint64(k.KiSize),
|
VMS: uint64(k.Eproc.Xsize),
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret, nil
|
return ret, nil
|
||||||
@ -220,7 +234,7 @@ func processes() ([]Process, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p, err := NewProcess(int32(k.KiPid))
|
p, err := NewProcess(int32(k.Proc.P_pid))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -235,6 +249,7 @@ func processes() ([]Process, error) {
|
|||||||
func parseKinfoProc(buf []byte) (KinfoProc, error) {
|
func parseKinfoProc(buf []byte) (KinfoProc, error) {
|
||||||
var k KinfoProc
|
var k KinfoProc
|
||||||
br := bytes.NewReader(buf)
|
br := bytes.NewReader(buf)
|
||||||
|
|
||||||
err := binary.Read(br, binary.LittleEndian, &k)
|
err := binary.Read(br, binary.LittleEndian, &k)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return k, err
|
return k, err
|
||||||
|
@ -1,97 +1,236 @@
|
|||||||
// +build darwin
|
// +build darwin
|
||||||
// +build amd64
|
// +build amd64
|
||||||
|
// Created by cgo -godefs - DO NOT EDIT
|
||||||
|
// cgo -godefs process/types_darwin.go
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
||||||
// copied from sys/sysctl.h
|
|
||||||
const (
|
const (
|
||||||
CTLKern = 1 // "high kernel": proc, limits
|
sizeofPtr = 0x8
|
||||||
KernProc = 14 // struct: process entries
|
sizeofShort = 0x2
|
||||||
KernProcPID = 1 // by process id
|
sizeofInt = 0x4
|
||||||
KernProcProc = 8 // only return procs
|
sizeofLong = 0x8
|
||||||
KernProcAll = 0 // everything
|
sizeofLongLong = 0x8
|
||||||
KernProcPathname = 12 // path to executable
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// copied from sys/user.h
|
type (
|
||||||
type KinfoProc struct {
|
_C_short int16
|
||||||
KiStructsize int32
|
_C_int int32
|
||||||
KiLayout int32
|
_C_long int64
|
||||||
KiArgs int64
|
_C_long_long int64
|
||||||
KiPaddr int64
|
)
|
||||||
KiAddr int64
|
|
||||||
KiTracep int64
|
type Timespec struct {
|
||||||
KiTextvp int64
|
Sec int64
|
||||||
KiFd int64
|
Nsec int64
|
||||||
KiVmspace int64
|
}
|
||||||
KiWchan int64
|
|
||||||
KiPid int32
|
type Timeval struct {
|
||||||
KiPpid int32
|
Sec int64
|
||||||
KiPgid int32
|
Usec int32
|
||||||
KiTpgid int32
|
Pad_cgo_0 [4]byte
|
||||||
KiSid int32
|
}
|
||||||
KiTsid int32
|
|
||||||
KiJobc [2]byte
|
type Rusage struct {
|
||||||
KiSpareShort1 [2]byte
|
Utime Timeval
|
||||||
KiTdev int32
|
Stime Timeval
|
||||||
KiSiglist [16]byte
|
Maxrss int64
|
||||||
KiSigmask [16]byte
|
Ixrss int64
|
||||||
KiSigignore [16]byte
|
Idrss int64
|
||||||
KiSigcatch [16]byte
|
Isrss int64
|
||||||
KiUID int32
|
Minflt int64
|
||||||
KiRuid int32
|
Majflt int64
|
||||||
KiSvuid int32
|
Nswap int64
|
||||||
KiRgid int32
|
Inblock int64
|
||||||
KiSvgid int32
|
Oublock int64
|
||||||
KiNgroups [2]byte
|
Msgsnd int64
|
||||||
KiSpareShort2 [2]byte
|
Msgrcv int64
|
||||||
KiGroups [64]byte
|
Nsignals int64
|
||||||
KiSize int64
|
Nvcsw int64
|
||||||
KiRssize int64
|
Nivcsw int64
|
||||||
KiSwrss int64
|
}
|
||||||
KiTsize int64
|
|
||||||
KiDsize int64
|
type Rlimit struct {
|
||||||
KiSsize int64
|
Cur uint64
|
||||||
KiXstat [2]byte
|
Max uint64
|
||||||
KiAcflag [2]byte
|
}
|
||||||
KiPctcpu int32
|
|
||||||
KiEstcpu int32
|
type UGid_t uint32
|
||||||
KiSlptime int32
|
|
||||||
KiSwtime int32
|
type KinfoProc struct {
|
||||||
KiCow int32
|
Proc ExternProc
|
||||||
KiRuntime int64
|
Eproc Eproc
|
||||||
KiStart [16]byte
|
}
|
||||||
KiChildtime [16]byte
|
|
||||||
KiFlag int64
|
type Eproc struct {
|
||||||
KiKflag int64
|
Paddr *Proc
|
||||||
KiTraceflag int32
|
Sess *Session
|
||||||
KiStat [1]byte
|
Pcred Upcred
|
||||||
KiNice [1]byte
|
Ucred Uucred
|
||||||
KiLock [1]byte
|
Pad_cgo_0 [4]byte
|
||||||
KiRqindex [1]byte
|
Vm Vmspace
|
||||||
KiOncpu [1]byte
|
Ppid int32
|
||||||
KiLastcpu [1]byte
|
Pgid int32
|
||||||
KiOcomm [17]byte
|
Jobc int16
|
||||||
KiWmesg [9]byte
|
Pad_cgo_1 [2]byte
|
||||||
KiLogin [18]byte
|
Tdev int32
|
||||||
KiLockname [9]byte
|
Tpgid int32
|
||||||
KiComm [20]byte
|
Pad_cgo_2 [4]byte
|
||||||
KiEmul [17]byte
|
Tsess *Session
|
||||||
KiSparestrings [68]byte
|
Wmesg [8]int8
|
||||||
KiSpareints [36]byte
|
Xsize int32
|
||||||
KiCrFlags int32
|
Xrssize int16
|
||||||
KiJid int32
|
Xccount int16
|
||||||
KiNumthreads int32
|
Xswrss int16
|
||||||
KiTid int32
|
Pad_cgo_3 [2]byte
|
||||||
KiPri int32
|
Flag int32
|
||||||
KiRusage [144]byte
|
Login [12]int8
|
||||||
KiRusageCh [144]byte
|
Spare [4]int32
|
||||||
KiPcb int64
|
Pad_cgo_4 [4]byte
|
||||||
KiKstack int64
|
}
|
||||||
KiUdata int64
|
|
||||||
KiTdaddr int64
|
type Proc struct{}
|
||||||
KiSpareptrs [48]byte
|
|
||||||
KiSpareint64s [96]byte
|
type Session struct{}
|
||||||
KiSflag int64
|
|
||||||
KiTdflags int64
|
type ucred struct {
|
||||||
|
Link UcredQueue
|
||||||
|
Ref uint64
|
||||||
|
Posix Posix_cred
|
||||||
|
Label *Label
|
||||||
|
Audit Au_session
|
||||||
|
}
|
||||||
|
|
||||||
|
type Uucred struct {
|
||||||
|
Ref int32
|
||||||
|
Uid uint32
|
||||||
|
Ngroups int16
|
||||||
|
Pad_cgo_0 [2]byte
|
||||||
|
Groups [16]uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Upcred struct {
|
||||||
|
Pc_lock [72]int8
|
||||||
|
Pc_ucred *ucred
|
||||||
|
P_ruid uint32
|
||||||
|
P_svuid uint32
|
||||||
|
P_rgid uint32
|
||||||
|
P_svgid uint32
|
||||||
|
P_refcnt int32
|
||||||
|
Pad_cgo_0 [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type Vmspace struct {
|
||||||
|
Dummy int32
|
||||||
|
Pad_cgo_0 [4]byte
|
||||||
|
Dummy2 *int8
|
||||||
|
Dummy3 [5]int32
|
||||||
|
Pad_cgo_1 [4]byte
|
||||||
|
Dummy4 [3]*int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type Sigacts struct{}
|
||||||
|
|
||||||
|
type ExternProc struct {
|
||||||
|
P_un [16]byte
|
||||||
|
P_vmspace *Vmspace
|
||||||
|
P_sigacts *Sigacts
|
||||||
|
P_flag int32
|
||||||
|
P_stat int8
|
||||||
|
Pad_cgo_0 [3]byte
|
||||||
|
P_pid int32
|
||||||
|
P_oppid int32
|
||||||
|
P_dupfd int32
|
||||||
|
Pad_cgo_1 [4]byte
|
||||||
|
User_stack *int8
|
||||||
|
Exit_thread *byte
|
||||||
|
P_debugger int32
|
||||||
|
Sigwait int32
|
||||||
|
P_estcpu uint32
|
||||||
|
P_cpticks int32
|
||||||
|
P_pctcpu uint32
|
||||||
|
Pad_cgo_2 [4]byte
|
||||||
|
P_wchan *byte
|
||||||
|
P_wmesg *int8
|
||||||
|
P_swtime uint32
|
||||||
|
P_slptime uint32
|
||||||
|
P_realtimer Itimerval
|
||||||
|
P_rtime Timeval
|
||||||
|
P_uticks uint64
|
||||||
|
P_sticks uint64
|
||||||
|
P_iticks uint64
|
||||||
|
P_traceflag int32
|
||||||
|
Pad_cgo_3 [4]byte
|
||||||
|
P_tracep *Vnode
|
||||||
|
P_siglist int32
|
||||||
|
Pad_cgo_4 [4]byte
|
||||||
|
P_textvp *Vnode
|
||||||
|
P_holdcnt int32
|
||||||
|
P_sigmask uint32
|
||||||
|
P_sigignore uint32
|
||||||
|
P_sigcatch uint32
|
||||||
|
P_priority uint8
|
||||||
|
P_usrpri uint8
|
||||||
|
P_nice int8
|
||||||
|
P_comm [17]int8
|
||||||
|
Pad_cgo_5 [4]byte
|
||||||
|
P_pgrp *Pgrp
|
||||||
|
P_addr *UserStruct
|
||||||
|
P_xstat uint16
|
||||||
|
P_acflag uint16
|
||||||
|
Pad_cgo_6 [4]byte
|
||||||
|
P_ru *Rusage
|
||||||
|
}
|
||||||
|
|
||||||
|
type Itimerval struct {
|
||||||
|
Interval Timeval
|
||||||
|
Value Timeval
|
||||||
|
}
|
||||||
|
|
||||||
|
type Vnode struct{}
|
||||||
|
|
||||||
|
type Pgrp struct{}
|
||||||
|
|
||||||
|
type UserStruct struct{}
|
||||||
|
|
||||||
|
type Au_session struct {
|
||||||
|
Aia_p *AuditinfoAddr
|
||||||
|
Mask AuMask
|
||||||
|
}
|
||||||
|
|
||||||
|
type Posix_cred struct {
|
||||||
|
Uid uint32
|
||||||
|
Ruid uint32
|
||||||
|
Svuid uint32
|
||||||
|
Ngroups int16
|
||||||
|
Pad_cgo_0 [2]byte
|
||||||
|
Groups [16]uint32
|
||||||
|
Rgid uint32
|
||||||
|
Svgid uint32
|
||||||
|
Gmuid uint32
|
||||||
|
Flags int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Label struct{}
|
||||||
|
|
||||||
|
type AuditinfoAddr struct {
|
||||||
|
Auid uint32
|
||||||
|
Mask AuMask
|
||||||
|
Termid AuTidAddr
|
||||||
|
Asid int32
|
||||||
|
Flags uint64
|
||||||
|
}
|
||||||
|
type AuMask struct {
|
||||||
|
Success uint32
|
||||||
|
Failure uint32
|
||||||
|
}
|
||||||
|
type AuTidAddr struct {
|
||||||
|
Port int32
|
||||||
|
Type uint32
|
||||||
|
Addr [4]uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type UcredQueue struct {
|
||||||
|
Next *ucred
|
||||||
|
Prev **ucred
|
||||||
}
|
}
|
||||||
|
157
process/types_darwin.go
Normal file
157
process/types_darwin.go
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
/*
|
||||||
|
Input to cgo -godefs.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
|
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||||
|
// +godefs map struct_ [16]byte /* in6_addr */
|
||||||
|
|
||||||
|
package process
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define __DARWIN_UNIX03 0
|
||||||
|
#define KERNEL
|
||||||
|
#define _DARWIN_USE_64_BIT_INODE
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <termios.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <mach/mach.h>
|
||||||
|
#include <mach/message.h>
|
||||||
|
#include <sys/event.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/ptrace.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#include <sys/select.h>
|
||||||
|
#include <sys/signal.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/uio.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
#include <net/bpf.h>
|
||||||
|
#include <net/if_dl.h>
|
||||||
|
#include <net/if_var.h>
|
||||||
|
#include <net/route.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#include <sys/ucred.h>
|
||||||
|
#include <sys/proc.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/_types/_timeval.h>
|
||||||
|
#include <sys/appleapiopts.h>
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <bsm/audit.h>
|
||||||
|
#include <sys/queue.h>
|
||||||
|
|
||||||
|
enum {
|
||||||
|
sizeofPtr = sizeof(void*),
|
||||||
|
};
|
||||||
|
|
||||||
|
union sockaddr_all {
|
||||||
|
struct sockaddr s1; // this one gets used for fields
|
||||||
|
struct sockaddr_in s2; // these pad it out
|
||||||
|
struct sockaddr_in6 s3;
|
||||||
|
struct sockaddr_un s4;
|
||||||
|
struct sockaddr_dl s5;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct sockaddr_any {
|
||||||
|
struct sockaddr addr;
|
||||||
|
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ucred_queue {
|
||||||
|
struct ucred *tqe_next;
|
||||||
|
struct ucred **tqe_prev;
|
||||||
|
TRACEBUF
|
||||||
|
};
|
||||||
|
|
||||||
|
*/
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
|
// Time
|
||||||
|
|
||||||
|
type Timespec C.struct_timespec
|
||||||
|
|
||||||
|
type Timeval C.struct_timeval
|
||||||
|
|
||||||
|
// Processes
|
||||||
|
|
||||||
|
type Rusage C.struct_rusage
|
||||||
|
|
||||||
|
type Rlimit C.struct_rlimit
|
||||||
|
|
||||||
|
type UGid_t C.gid_t
|
||||||
|
|
||||||
|
type KinfoProc C.struct_kinfo_proc
|
||||||
|
|
||||||
|
type Eproc C.struct_eproc
|
||||||
|
|
||||||
|
type Proc C.struct_proc
|
||||||
|
|
||||||
|
type Session C.struct_session
|
||||||
|
|
||||||
|
type ucred C.struct_ucred
|
||||||
|
|
||||||
|
type Uucred C.struct__ucred
|
||||||
|
|
||||||
|
type Upcred C.struct__pcred
|
||||||
|
|
||||||
|
type Vmspace C.struct_vmspace
|
||||||
|
|
||||||
|
type Sigacts C.struct_sigacts
|
||||||
|
|
||||||
|
type ExternProc C.struct_extern_proc
|
||||||
|
|
||||||
|
type Itimerval C.struct_itimerval
|
||||||
|
|
||||||
|
type Vnode C.struct_vnode
|
||||||
|
|
||||||
|
type Pgrp C.struct_pgrp
|
||||||
|
|
||||||
|
type UserStruct C.struct_user
|
||||||
|
|
||||||
|
type Au_session C.struct_au_session
|
||||||
|
|
||||||
|
type Posix_cred C.struct_posix_cred
|
||||||
|
|
||||||
|
type Label C.struct_label
|
||||||
|
|
||||||
|
type AuditinfoAddr C.struct_auditinfo_addr
|
||||||
|
type AuMask C.struct_au_mask
|
||||||
|
type AuTidAddr C.struct_au_tid_addr
|
||||||
|
|
||||||
|
// TAILQ(ucred)
|
||||||
|
type UcredQueue C.struct_ucred_queue
|
Loading…
x
Reference in New Issue
Block a user