You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
The program at https://gist.github.com/6587a615cea63183676e2f2887d59d62 uses Fadvise from the unix package to purge data written to a file from the OS cache. The constants for this function (FADV_*) are defined in types_linux.go, but cannot be accessed from the outside of the unix package. This makes using Fadvise() awkward because I need to define the constants myself.
Add the constants to x/sys/unix/types_*.go, run mkall.sh, revert the unrelated changes. Some day we will clean up mkall.sh, and if you want to tackle that that would be great, but you don't have to.
go version
)?go version go1.6 linux/amd64
go env
)?Archlinux on amd64:
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
The program at https://gist.github.com/6587a615cea63183676e2f2887d59d62 uses
Fadvise
from theunix
package to purge data written to a file from the OS cache. The constants for this function (FADV_*
) are defined intypes_linux.go
, but cannot be accessed from the outside of theunix
package. This makes usingFadvise()
awkward because I need to define the constants myself.For the reference, here are the constants I'm missing:
https://github.com/golang/sys/blob/master/unix/types_linux.go#L175-L185
Running
GOOS=linux GOARCH=amd64 mkall.sh
inserts the constants intoztypes_linux_amd64.go
.I'm happy to submit a CL if someone gives me a hint on how to fix this.
The
FADV_*
constants (e.g.FADV_DONTNEED
) exported in the packageunix
.FADV_DONTNEED
is either not defined or not exported in the package, so users need to define that themselves.The text was updated successfully, but these errors were encountered: