Commit a8c6c483 authored by Ian Lance Taylor's avatar Ian Lance Taylor

os: document that the runtime can write to standard error

Fixes #15970.

Change-Id: I3f7d8316069a69d0e3859aaa96bc1414487fead0
Reviewed-on: https://go-review.googlesource.com/23921
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
parent 76388363
...@@ -46,6 +46,10 @@ func (f *File) Name() string { return f.name } ...@@ -46,6 +46,10 @@ func (f *File) Name() string { return f.name }
// Stdin, Stdout, and Stderr are open Files pointing to the standard input, // Stdin, Stdout, and Stderr are open Files pointing to the standard input,
// standard output, and standard error file descriptors. // standard output, and standard error file descriptors.
//
// Note that the Go runtime writes to standard error for panics and crashes;
// closing Stderr may cause those messages to go elsewhere, perhaps
// to a file opened later.
var ( var (
Stdin = NewFile(uintptr(syscall.Stdin), "/dev/stdin") Stdin = NewFile(uintptr(syscall.Stdin), "/dev/stdin")
Stdout = NewFile(uintptr(syscall.Stdout), "/dev/stdout") Stdout = NewFile(uintptr(syscall.Stdout), "/dev/stdout")
......
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