]> Cypherpunks repositories - gostls13.git/commitdiff
syscall package: document that errno is zeroed on success
authorGiles Lean <giles.lean@pobox.com>
Tue, 6 Apr 2010 17:28:55 +0000 (10:28 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 6 Apr 2010 17:28:55 +0000 (10:28 -0700)
This is a documentation enhancement only, without any code
change.

The rationale for documenting this precisely is that Unix
programmers who "know" that errno's value is undefined after
a successful system call may be surprised otherwise and
search to be sure that a zero errno may be relied upon after
successful calls.

R=r, rsc1, rsc
CC=golang-dev
https://golang.org/cl/812044

src/pkg/syscall/syscall.go

index 372149bf2cb8a375f97b8c6f55f136e0969f27ea..46f5c98764de7bb37ff0d79888859432a2ae0567 100644 (file)
@@ -9,6 +9,8 @@
 // packages rather than this one if you can.
 // For details of the functions and data types in this package consult
 // the manuals for the appropriate operating system.
+// These calls return errno == 0 to indicate success; otherwise
+// errno is an operating system error number describing the failure.
 package syscall
 
 func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)