...

Source file src/github.com/shirou/gopsutil/process/types_freebsd.go

Documentation: github.com/shirou/gopsutil/process

     1  // +build ignore
     2  
     3  // We still need editing by hands.
     4  // go tool cgo -godefs types_freebsd.go | sed 's/\*int64/int64/' | sed 's/\*byte/int64/'  > process_freebsd_amd64.go
     5  
     6  /*
     7  Input to cgo -godefs.
     8  */
     9  
    10  // +godefs map struct_pargs int64 /* pargs */
    11  // +godefs map struct_proc int64 /* proc */
    12  // +godefs map struct_user int64 /* user */
    13  // +godefs map struct_vnode int64 /* vnode */
    14  // +godefs map struct_vnode int64 /* vnode */
    15  // +godefs map struct_filedesc int64 /* filedesc */
    16  // +godefs map struct_vmspace int64 /* vmspace */
    17  // +godefs map struct_pcb int64 /* pcb */
    18  // +godefs map struct_thread int64 /* thread */
    19  // +godefs map struct___sigset [16]byte /* sigset */
    20  
    21  package process
    22  
    23  /*
    24  #include <sys/types.h>
    25  #include <sys/user.h>
    26  
    27  enum {
    28  	sizeofPtr = sizeof(void*),
    29  };
    30  
    31  
    32  */
    33  import "C"
    34  
    35  // Machine characteristics; for internal use.
    36  
    37  const (
    38  	CTLKern          = 1  // "high kernel": proc, limits
    39  	KernProc         = 14 // struct: process entries
    40  	KernProcPID      = 1  // by process id
    41  	KernProcProc     = 8  // only return procs
    42  	KernProcPathname = 12 // path to executable
    43  	KernProcArgs     = 7  // get/set arguments/proctitle
    44  )
    45  
    46  const (
    47  	sizeofPtr      = C.sizeofPtr
    48  	sizeofShort    = C.sizeof_short
    49  	sizeofInt      = C.sizeof_int
    50  	sizeofLong     = C.sizeof_long
    51  	sizeofLongLong = C.sizeof_longlong
    52  )
    53  
    54  const (
    55  	sizeOfKinfoVmentry = C.sizeof_struct_kinfo_vmentry
    56  	sizeOfKinfoProc    = C.sizeof_struct_kinfo_proc
    57  )
    58  
    59  // from sys/proc.h
    60  const (
    61  	SIDL   = 1 /* Process being created by fork. */
    62  	SRUN   = 2 /* Currently runnable. */
    63  	SSLEEP = 3 /* Sleeping on an address. */
    64  	SSTOP  = 4 /* Process debugging or suspension. */
    65  	SZOMB  = 5 /* Awaiting collection by parent. */
    66  	SWAIT  = 6 /* Waiting for interrupt. */
    67  	SLOCK  = 7 /* Blocked on a lock. */
    68  )
    69  
    70  // Basic types
    71  
    72  type (
    73  	_C_short     C.short
    74  	_C_int       C.int
    75  	_C_long      C.long
    76  	_C_long_long C.longlong
    77  )
    78  
    79  // Time
    80  
    81  type Timespec C.struct_timespec
    82  
    83  type Timeval C.struct_timeval
    84  
    85  // Processes
    86  
    87  type Rusage C.struct_rusage
    88  
    89  type Rlimit C.struct_rlimit
    90  
    91  type KinfoProc C.struct_kinfo_proc
    92  
    93  type Priority C.struct_priority
    94  
    95  type KinfoVmentry C.struct_kinfo_vmentry
    96  

View as plain text