Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(778)

Side by Side Diff: src/pkg/syscall/syscall_unix.go

Issue 6813046: code review 6813046: net: use WriteNB on non-blocking sockets (Closed)
Patch Set: diff -r 8e87cb8dca7d https://code.google.com/p/go Created 11 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/syscall/syscall_openbsd.go ('k') | src/pkg/syscall/zsyscall_darwin_386.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build darwin freebsd linux netbsd openbsd 5 // +build darwin freebsd linux netbsd openbsd
6 6
7 package syscall 7 package syscall
8 8
9 import ( 9 import (
10 "runtime" 10 "runtime"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return 136 return
137 } 137 }
138 138
139 func Write(fd int, p []byte) (n int, err error) { 139 func Write(fd int, p []byte) (n int, err error) {
140 if raceenabled { 140 if raceenabled {
141 raceReleaseMerge(unsafe.Pointer(&ioSync)) 141 raceReleaseMerge(unsafe.Pointer(&ioSync))
142 } 142 }
143 return write(fd, p) 143 return write(fd, p)
144 } 144 }
145 145
146 // WriteNB does a write system call to a descriptor that has been set to
147 // non-blocking mode. Do not call this with a descriptor in blocking mode.·
148 // Blocking mode is the default for all descriptors other than sockets·
149 // opened by the net package.
150 func WriteNB(fd int, p []byte) (n int, err error) {
mikio 2012/10/30 06:36:38 WriteNB or WriteNonblock; we already have SetNonbl
151 if raceenabled {
152 raceReleaseMerge(unsafe.Pointer(&ioSync))
153 }
154 return writeNB(fd, p)
155 }
156
146 var ioSync int64 157 var ioSync int64
OLDNEW
« no previous file with comments | « src/pkg/syscall/syscall_openbsd.go ('k') | src/pkg/syscall/zsyscall_darwin_386.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b