Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed Apr 22, 2014
1 parent ccc1530 commit 3d702e6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
10 changes: 5 additions & 5 deletions disk_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var (
FILE_READ_ONLY_VOLUME = int64(524288) // 0x00080000
)

func (d Disk) Disk_usage(path string) (Disk_usage, error) {
ret := Disk_usage{}
func Disk_usage(path string) (Disk_usageStat, error) {
ret := Disk_usageStat{}

ret.Path = path
lpFreeBytesAvailable := int64(0)
Expand All @@ -44,8 +44,8 @@ func (d Disk) Disk_usage(path string) (Disk_usage, error) {
return ret, nil
}

func (d Disk) Disk_partitions() ([]Disk_partition, error) {
ret := make([]Disk_partition, 0)
func Disk_partitions() ([]Disk_partitionStat, error) {
ret := make([]Disk_partitionStat, 0)
lpBuffer := make([]byte, 254)
diskret, _, err := procGetLogicalDriveStringsW.Call(
uintptr(len(lpBuffer)),
Expand Down Expand Up @@ -93,7 +93,7 @@ func (d Disk) Disk_partitions() ([]Disk_partition, error) {
opts += ".compress"
}

d := Disk_partition{
d := Disk_partitionStat{
Mountpoint: path,
Device: path,
Fstype: string(bytes.Replace(lpFileSystemNameBuffer, []byte("\x00"), []byte(""), -1)),
Expand Down
11 changes: 11 additions & 0 deletions host_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ func HostInfo() (HostInfoStat, error) {

return ret, nil
}

func Boot_time() (int64, error) {

return 0, nil
}
func Users() ([]UserStat, error) {

ret := make([]UserStat, 0)

return ret, nil
}
4 changes: 2 additions & 2 deletions load_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

package gopsutil

func (l Load) LoadAvg() (LoadAvg, error) {
ret := LoadAvg{}
func LoadAvg() (LoadAvgStat, error) {
ret := LoadAvgStat{}

return ret, nil
}
8 changes: 4 additions & 4 deletions mem_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type MEMORYSTATUSEX struct {
ullAvailExtendedVirtual uint64
}

func Virtual_memory() (Virtual_memory, error) {
ret := Virtual_memory{}
func Virtual_memory() (Virtual_memoryStat, error) {
ret := Virtual_memoryStat{}

var memInfo MEMORYSTATUSEX
memInfo.cbSize = uint32(unsafe.Sizeof(memInfo))
Expand All @@ -40,8 +40,8 @@ func Virtual_memory() (Virtual_memory, error) {
return ret, nil
}

func Swap_memory() (Swap_memory, error) {
ret := Swap_memory{}
func Swap_memory() (Swap_memoryStat, error) {
ret := Swap_memoryStat{}

return ret, nil
}

0 comments on commit 3d702e6

Please sign in to comment.