Commit 53c92f95 authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

os: document that behavior of Seek on O_APPEND files is not specified

The actual behavior varies across platforms, and due to the inherent
race, we can't do anything better (other than to always return 0).

Fixes #12710.

Change-Id: Icb52f0f1f0a267e0f9f70767cae427f3f0239965
Reviewed-on: https://go-review.googlesource.com/14881Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 604fbab3
......@@ -173,6 +173,7 @@ func (f *File) WriteAt(b []byte, off int64) (n int, err error) {
// according to whence: 0 means relative to the origin of the file, 1 means
// relative to the current offset, and 2 means relative to the end.
// It returns the new offset and an error, if any.
// The behavior of Seek on a file opened with O_APPEND is not specified.
func (f *File) Seek(offset int64, whence int) (ret int64, err error) {
if f == nil {
return 0, ErrInvalid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment