madcowfred / GoPostStuff

Multiple connection USENET binary poster written in Go
MIT License
32 stars 24 forks source link

install - undefined syscall #11

Closed thezoggy closed 9 years ago

thezoggy commented 9 years ago

trying to get this going on windows 7. fresh copy of GO installed. gopath set.

D:\_apps\go>go get github.com/madcowfred/GoPostStuff
# github.com/madcowfred/GoPostStuff
src\github.com\madcowfred\GoPostStuff\mmapcache.go:62: undefined: syscall.Mmap
src\github.com\madcowfred\GoPostStuff\mmapcache.go:62: undefined: syscall.PROT_READ
src\github.com\madcowfred\GoPostStuff\mmapcache.go:62: undefined: syscall.MAP_SHARED
src\github.com\madcowfred\GoPostStuff\mmapcache.go:89: undefined: syscall.Munmap
thezoggy commented 9 years ago

looking at line #62 data, err := syscall.Mmap(int(file.Fd()), 0, (size+4095) & ^4095, syscall.PROT_READ, syscall.MAP_SHARED)

its because PROT_READ and MAP_SHARED are missing for windows...

C:\Go\src\pkg\syscall>grep PROT_READ *.go
zerrors_darwin_386.go:  PROT_READ                         = 0x1
zerrors_darwin_amd64.go:        PROT_READ                         = 0x1
zerrors_dragonfly_386.go:       PROT_READ                         = 0x1
zerrors_dragonfly_amd64.go:     PROT_READ                         = 0x1
zerrors_freebsd_386.go: PROT_READ                         = 0x1
zerrors_freebsd_amd64.go:       PROT_READ                         = 0x1
zerrors_freebsd_arm.go: PROT_READ                         = 0x1
zerrors_linux_386.go:   PROT_READ                        = 0x1
zerrors_linux_amd64.go: PROT_READ                        = 0x1
zerrors_linux_arm.go:   PROT_READ                        = 0x1
zerrors_netbsd_386.go:  PROT_READ                         = 0x1
zerrors_netbsd_amd64.go:        PROT_READ                         = 0x1
zerrors_netbsd_arm.go:  PROT_READ                         = 0x1
zerrors_openbsd_386.go: PROT_READ                         = 0x1
zerrors_openbsd_amd64.go:       PROT_READ                         = 0x1
zerrors_solaris_amd64.go:       PROT_READ                     = 0x1
thezoggy commented 9 years ago

other apps have ran into this problem, one solution: https://github.com/HouzuoGuo/tiedot/issues/7

https://github.com/edsrzf/mmap-go

this is my first time trying go..so not sure how i'm suppose to install mmap-go to see if this fixes the issue.

tried this but no change:

D:\_apps\go>go get github.com/edsrzf/mmap-go
D:\_apps\go>go install github.com/edsrzf/mmap-go
madcowfred commented 9 years ago

I'm curious as to why you'd try running this on Windows - I was under the impression it already had halfway decent binary posting apps, never even thought to test it :cow:

The proper solution to this is probably to make a separate 'simple' file opener (open file, read from file vs mmap file into memory) and default to using that.

madcowfred commented 9 years ago

I kind of got sidetracked by finishing my degree - did you close this because it's no longer a problem? I still have vague plans about fixing it properly.

thezoggy commented 9 years ago

I gave up on trying to get this to work, I ended up just modifying newsmangler for my purposes.