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

Comments

@dsnet
Copy link
Member

@dsnet 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.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 7, 2017

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

This comment has been minimized.

Copy link
Contributor

@bradfitz bradfitz commented Oct 8, 2019

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

@bradfitz bradfitz closed this Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.