From 53c92f95a888837571eda1cf356425010f92edde Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Wed, 23 Sep 2015 11:49:44 -0400 Subject: [PATCH] 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/14881 Reviewed-by: Brad Fitzpatrick --- src/os/file.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/file.go b/src/os/file.go index 69338ce09a..a662197ceb 100644 --- a/src/os/file.go +++ b/src/os/file.go @@ -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 -- 2.48.1