Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: File.Seek does not work past EOF on NaCl #21728

Closed
dsnet opened this issue Sep 1, 2017 · 2 comments
Closed

os: File.Seek does not work past EOF on NaCl #21728

dsnet opened this issue Sep 1, 2017 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-NaCl GOOS=nacl, Native Client, removed in Go 1.14
Milestone

Comments

@dsnet
Copy link
Member

dsnet commented Sep 1, 2017

Consider the following snippet:

f, err := ioutil.TempFile("", "")
if err != nil {
	log.Fatal(err)
}
// f.Truncate(1000)
if _, err := f.Seek(1000, io.SeekCurrent); err != nil {
	log.Fatal(err)
}

On NaCl, this current fails with:

seek /tmp/054003078: Invalid argument

If you uncomment the Truncate, then it works again. This is contrary to every other OS that Go supports, where you can seek past EOF and start writing and everything in-between is implicitly filled with zeros.

@dsnet dsnet added the OS-NaCl GOOS=nacl, Native Client, removed in Go 1.14 label Sep 1, 2017
@dsnet dsnet added this to the Unplanned milestone Sep 1, 2017
@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Dec 7, 2017
@gopherbot
Copy link

Change https://golang.org/cl/82535 mentions this issue: syscall: make Seek use SetFilePointerEx on Windows, allowing large seek offsets

gopherbot pushed a commit that referenced this issue Dec 7, 2017
…ek offsets

Fixes #21681
Updates #21728

Change-Id: I79cf4564c1355ecab891102d4215cbbffd8eb0ce
Reviewed-on: https://go-review.googlesource.com/82535
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@bradfitz
Copy link
Contributor

bradfitz commented Oct 8, 2019

Closing nacl bugs, as we're removing nacl (#30439)

@bradfitz bradfitz closed this as completed Oct 8, 2019
@golang golang locked and limited conversation to collaborators Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-NaCl GOOS=nacl, Native Client, removed in Go 1.14
Projects
None yet
Development

No branches or pull requests

3 participants