Skip to content

Commit 2a75662

Browse files
doc: mention new SIGPIPE behavior in 1.6 release notes
Update #11845. Change-Id: I1c248dc48abc62e51836b9ba50d6deb89706c730 Reviewed-on: https://go-review.googlesource.com/18226 Reviewed-by: Russ Cox <[email protected]>
1 parent 934e055 commit 2a75662

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/go1.6.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,26 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
747747
<a href="/pkg/os/#SyscallError"><code>SyscallError</code></a>.
748748
</li>
749749

750+
<li>
751+
On Unix-like systems, when a write
752+
to <a href="/pkg/os/#pkg-variables"><code>os.Stdout</code>
753+
or <code>os.Stderr</code></a> (more precisely, an <code>os.File</code>
754+
opened for file descriptor 1 or 2) fails due to a broken pipe error,
755+
the program will raise a <code>SIGPIPE</code> signal.
756+
By default this will cause the program to exit; this may be changed by
757+
calling the
758+
<a href="/pkg/os/signal"><code>os/signal</code></a>
759+
<a href="/pkg/os/signal/#Notify"><code>Notify</code></a> function
760+
for <code>syscall.SIGPIPE</code>.
761+
A write to a broken pipe on a file descriptor other 1 or 2 will simply
762+
return <code>syscall.EPIPE</code> (possibly wrapped in
763+
<a href="/pkg/os#PathError"><code>os.PathError</code></a>
764+
and/or <a href="/pkg/os#SyscallError"><code>os.SyscallError</code></a>)
765+
to the caller.
766+
The old behavior of raising an uncatchable <code>SIGPIPE</code> signal
767+
after 10 consecutive writes to a broken pipe no longer occurs.
768+
</li>
769+
750770
<li>
751771
In the <a href="/pkg/os/exec/"><code>os/exec</code></a> package,
752772
<a href="/pkg/os/exec/#Cmd"><code>Cmd</code></a>'s

0 commit comments

Comments
 (0)