]> Cypherpunks repositories - gostls13.git/commitdiff
os: document that behavior of Seek on O_APPEND files is not specified
authorShenghou Ma <minux@golang.org>
Wed, 23 Sep 2015 15:49:44 +0000 (11:49 -0400)
committerMinux Ma <minux@golang.org>
Wed, 23 Sep 2015 17:06:02 +0000 (17:06 +0000)
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 <bradfitz@golang.org>
src/os/file.go

index 69338ce09a965bba0ae867eead7bacabd149a12f..a662197ceb29fe516d96dac9a4b63f9974ed86f9 100644 (file)
@@ -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