1
0
mirror of https://github.com/golang/go synced 2024-10-04 14:31:21 -06:00
Commit Graph

4382 Commits

Author SHA1 Message Date
Ian Lance Taylor
7959aeb0f9 syscall: correct name of mksyscall script in comment
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5310055
2011-10-25 12:49:51 -07:00
Hector Chu
2572ca2ff2 runtime: include bootstrap m in mcpu accounting
R=rsc, dvyukov
CC=golang-dev
https://golang.org/cl/5307052
2011-10-25 08:35:20 +01:00
Brad Fitzpatrick
d72267ae23 http: doc typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5303067
2011-10-24 19:29:44 -07:00
David Anderson
85b9f3573e syscall: use uintptr for Mount flags.
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5308044
2011-10-24 19:28:50 -07:00
Nigel Tao
18b025d530 html: remove the Tokenizer.ReturnComments option.
The original intention was to simplify the parser, in making it skip
all comment tokens. However, checking that the Go html package is
100% compatible with the WebKit HTML test suite requires parsing the
comments. There is no longer any real benefit for the option.

R=gri, andybalholm
CC=golang-dev
https://golang.org/cl/5321043
2011-10-25 11:28:07 +11:00
Dave Cheney
5791233461 exp/ssh: introduce Session to replace Cmd for interactive commands
This CL replaces the Cmd type with a Session type representing
interactive channels. This lays the foundation for supporting
other kinds of channels like direct-tcpip or x11.

client.go:
* replace chanlist map with slice.
* generalize stdout and stderr into a single type.
* unexport ClientChan to clientChan.

doc.go:
* update ServerConfig/ServerConn documentation.
* update Client example for Session.

message.go:
* make channelExtendedData more like channelData.

session.go:
* added Session which replaces Cmd.

R=agl, rsc, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5302054
2011-10-24 19:13:55 -04:00
Andrew Balholm
2f3f3aa2ed html: dump attributes when running parser tests.
The WebKit test data shows attributes as though they were child nodes:

<a X>0<b>1<a Y>2
dumps as:
| <html>
|   <head>
|   <body>
|     <a>
|       x=""
|       "0"
|       <b>
|         "1"
|     <b>
|       <a>
|         y=""
|         "2"

So we need to do the same when dumping a tree to compare with it.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5322044
2011-10-25 09:33:15 +11:00
Brad Fitzpatrick
2b5aa28383 http: add package comment
Fixes #2378

R=rsc
CC=golang-dev
https://golang.org/cl/5312052
2011-10-24 13:59:31 -07:00
Alex Brainman
c1d0f0e76c net: do not set SO_REUSEADDR for windows
Fixes #2307.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5306049
2011-10-24 09:11:01 +11:00
Andrew Balholm
2aa589c843 html: implement foster parenting
Implement the foster-parenting algorithm for content that is inside a table
but not in a cell.

Also fix a bug in reconstructing the active formatting elements.

Pass test 30 in tests1.dat:
<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y

R=nigeltao
CC=golang-dev
https://golang.org/cl/5309052
2011-10-23 18:36:01 +11:00
Nigel Tao
2f352ae48a html: parse <select> tags.
The additional test case in parse_test.go is:
<select><b><option><select><option></b></select>X

R=andybalholm
CC=golang-dev
https://golang.org/cl/5293051
2011-10-22 20:18:12 +11:00
Robert Griesemer
696ced50fe big: usable zero Rat values without need for explicit initialization
- no explicit API change, but new(big.Rat) now creates a big.Rat value
  of 0 that is immediately usable, in sync. w/ the conventions elsewhere
- various cleanups along the way

R=r
CC=golang-dev
https://golang.org/cl/5301056
2011-10-21 14:11:36 -07:00
Rob Pike
d481d7c854 fmt: simplify the code some more by storing the field in the pp structure.
R=rsc
CC=golang-dev
https://golang.org/cl/5293058
2011-10-21 13:59:27 -07:00
Robert Griesemer
4854bd9ced big: implemented Rat.Inv
Also:
- changed semantics of return values for [Int|Rat].SetString
  if an error occured (returned value is nil); will expose
  hidden errors where return values are not checked
- added more tests
- various cleanups throughout

Fixes #2384.

R=r
CC=golang-dev
https://golang.org/cl/5312044
2011-10-21 13:26:00 -07:00
Brad Fitzpatrick
2cab897ce0 http: Transport: with TLS InsecureSkipVerify, skip hostname check
Fixes #2386

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5312045
2011-10-21 08:14:38 -07:00
Dave Cheney
8bfb217123 exp/ssh: server cleanups
server.go/channel.go:
* rename Server to ServerConfig to match Client.
* rename ServerConnection to ServeConn to match Client.
* add Listen/Listener.
* ServerConn.Handshake(), general cleanups.

client.go:
* fix bug where fmt.Error was not assigned to err

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5265049
2011-10-21 11:04:28 -04:00
Dave Cheney
792a55f5db exp/ssh: add experimental ssh client
Requires CL 5285044

client.go:
* add Dial, ClientConn, ClientChan, ClientConfig and Cmd.

doc.go:
* add Client documentation.

server.go:
* adjust for readVersion change.

transport.go:
* return an os.Error not a bool from readVersion.

R=rsc, agl, n13m3y3r
CC=golang-dev
https://golang.org/cl/5162047
2011-10-20 15:44:45 -04:00
Robert Griesemer
e8a426aebe go/ast: use single-element map in test
Avoids test failure due to undefined map iteration order.

R=rsc, iant, iant
CC=golang-dev
https://golang.org/cl/5297048
2011-10-20 12:37:13 -07:00
Ian Lance Taylor
22dd0ba90d go/ast, go/token: actually run tests; fix go/ast test
R=gri
CC=golang-dev
https://golang.org/cl/5292048
2011-10-20 10:30:01 -07:00
Hector Chu
9e1a2adf07 exp/winfsnotify: fix test
R=alex.brainman, mattn.jp
CC=golang-dev
https://golang.org/cl/5311047
2011-10-20 08:10:58 +01:00
Nigel Tao
64306c9fd0 html: parse and render comment nodes.
The first additional test case in parse_test.go is:
<!--><div>--<!-->

The second one is unrelated to the comment change, but also passes:
<p><hr></p>

R=andybalholm
CC=golang-dev
https://golang.org/cl/5299047
2011-10-20 11:45:30 +11:00
Gustavo Niemeyer
526d0818cc fmt: don't panic formatting nil interfaces
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5296044
2011-10-19 18:26:08 -02:00
Russ Cox
b4d6b71e16 unicode: sort tables.go
Makes tables.go output consistent across maketable runs.
(It was already inconsistent across architectures; the new
map iteration order just make it inconsistent across runs.)

R=r
CC=golang-dev
https://golang.org/cl/5303046
2011-10-19 16:02:22 -04:00
Russ Cox
bb8c4ed22a exp/types: fix crash in parseBasicType on unknown type
R=gri
CC=golang-dev
https://golang.org/cl/5302044
2011-10-19 12:49:01 -04:00
Adam Langley
ec0b5533c9 crypto/x509: fix names in certificate generation.
I had a brain fart in af84b15fbae2 and messed up the names in
generated certificates.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5315046
2011-10-19 12:19:13 -04:00
Brad Fitzpatrick
314afb417a http: comment tweaks
It hasn't been primitive in a while.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5287041
2011-10-19 08:48:26 -07:00
Brad Fitzpatrick
cf0952d352 syscall: update ztypes_linux_386 for terminal changes
R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/5299045
2011-10-19 08:45:38 -07:00
Dave Cheney
ec80beb9f0 syscall: update ztypes_linux_arm for terminal changes
regenerated on a debian sid arm5 host.

R=bradfitz, iant
CC=golang-dev
https://golang.org/cl/5298046
2011-10-19 07:38:32 -07:00
Mikio Hara
e13635c1e0 os/inotify: move to exp/inotify
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5295044
2011-10-19 10:54:45 +09:00
Nigel Tao
98e723ed09 html: fix escape_test.go for CSS escaper change 5306042.
R=mikesamuel
CC=golang-dev
https://golang.org/cl/5313044
2011-10-19 10:54:04 +11:00
Rob Pike
811d334a65 fmt: clean up after reflect.Interface change.
Store the reflect.Value in the internal print state. Code is simpler, cleaner,
and a little faster - back to what it was before the change.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5299046
2011-10-18 16:23:07 -07:00
Rob Pike
4c56c30b78 rpc: don't panic on write error.
The mechanism to record the error in the call is already in place.
Fixes #2382.

R=golang-dev, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/5307043
2011-10-18 15:52:49 -07:00
Mike Samuel
fc3ce34903 exp/template/html: fix bug in cssEscaper
cssEscaper escapes using the CSS convention: `\` + hex + optional-space

It outputs the space when the escape could be followed by
a hex digit to distinguish a "\na" from "\u00aa".

It did not output a space when the escape is followed by a space
character so did not distinguish "\n " from "\n".

Currently when doing lookahead, it does not distinguish spaces that
will be escaped later by the same function from ones that will not.
This is correct but suboptimal.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5306042
2011-10-18 17:01:42 -05:00
Andrew Gerrand
aa42881ed0 http: add test for panic inside hijacked request
R=golang-dev, rsc, rsc
CC=golang-dev
https://golang.org/cl/5283052
2011-10-19 08:23:13 +11:00
Nigel Tao
b1fd528db5 html: parse raw text and RCDATA elements, such as <script> and <title>.
Pass tests1.dat, test 26:
#data
<script><div></script></div><title><p></title><p><p>
#document
| <html>
|   <head>
|     <script>
|       "<div>"
|     <title>
|       "<p>"
|   <body>
|     <p>
|     <p>

Thanks to Andy Balholm for driving this change.

R=andybalholm
CC=golang-dev
https://golang.org/cl/5301042
2011-10-19 08:03:30 +11:00
Hector Chu
7ecf6c997e exp/winfsnotify: filesystem watcher for Windows
R=rsc, alex.brainman, bradfitz
CC=bsiegert, go.peter.90, golang-dev
https://golang.org/cl/4188047
2011-10-18 21:09:58 +01:00
Robert Griesemer
c7cf56bec9 big: handle aliasing correctly for Rat.SetFrac.
Fixes #2379.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5305043
2011-10-18 12:40:41 -07:00
Andrey Mirtchovski
565793996c net: remove duplicate error information in Dial
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5293045
2011-10-18 14:51:40 -04:00
Russ Cox
48bb3e8f28 net: allow LookupSRV on non-standard DNS names
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5313043
2011-10-18 13:57:04 -04:00
Adam Langley
9d99d52fcb http, crypto/tls: fix read timeouts and closing.
tls.Conn.Close() didn't close the underlying connection and tried to
do a handshake in order to send the close notify alert.

http didn't look for errors from the TLS handshake.

Fixes #2281.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5283045
2011-10-18 12:59:32 -04:00
Adam Langley
7bc4f8de0f exp/terminal: split terminal handling from exp/ssh
This change splits terminal handling from exp/ssh, as suggested
several times in the ssh code review.

shell.go and shell_test.go are copies from exp/ssh with minimal
changes, so don't need another full review. A future CL will remove
that code from exp/ssh.

R=bradfitz, r, dave, rsc
CC=golang-dev
https://golang.org/cl/5278049
2011-10-18 12:58:57 -04:00
Dave Cheney
ec158f77bd exp/ssh: general cleanups for client support
common.go:
* simplify findAgreedAlgorithms.
* add channelExtendedData support.

messages.go:
* add clientExtendedData.

server.go:
*  use simplified findAgreedAlgorithms.

server_shell.go:
* fix shadowed err return value.

transport.go:
* introduce separate cipher, mac and compression for each direction.
* added filteredConn and packetWriter interfaces.
* newTransport requires a source of randomness.

R=golang-dev, agl, rsc
CC=golang-dev
https://golang.org/cl/5285044
2011-10-18 12:54:48 -04:00
Robert Griesemer
1db31f8933 big: more explicit documentation for div/mod/quo/rem
Fixes #2380.

R=rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5313041
2011-10-18 09:45:38 -07:00
Russ Cox
4e7aac5413 reflect: make unsafe use of SliceHeader gc-friendly
Revert workaround in compiler and
revert test for compiler workaround.

Tested that the 386 build continues to fail if
the gc change is made without the reflect change.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5312041
2011-10-18 10:03:37 -04:00
Russ Cox
313c8224d5 gofix -r mapdelete
R=golang-dev, r, adg, r, cw
CC=golang-dev
https://golang.org/cl/5266045
2011-10-18 09:56:34 -04:00
Russ Cox
1d687c742d gc: add delete(m, x) but leave in m[x] = 0, false.
The old m[x] = 0, false syntax will be deleted
in a month or so, once people have had time to
change their code (there is a gofix in a separate CL).

R=ken2
CC=golang-dev
https://golang.org/cl/5265048
2011-10-18 09:41:32 -04:00
David Symonds
9049abbd2d reflect: make map test independent of map iteration order.
This should fix the 386 builds.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5298042
2011-10-18 12:47:34 +11:00
David Symonds
fdc6376c00 reflect: fix test failure reporting.
There's a problem that is manifesting on the 386 builders,
but this test bug is masking it.

R=adg
CC=golang-dev
https://golang.org/cl/5295042
2011-10-18 12:26:09 +11:00
David Symonds
e45e324420 fmt: fix test relying on map iteration order.
This fixes the 386 builds.

R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/5293043
2011-10-18 11:47:11 +11:00
Robert Griesemer
df219d5197 scanner: invalidate scanner.Position when no token is present
scanner.Position is the position of the most recently
scanned token. Make sure it is invalid if there is no
token scanned and update corresponding comment. This
is particularly important when reporting errors.

Fixes #2371.

R=r
CC=golang-dev
https://golang.org/cl/5294041
2011-10-17 16:35:12 -07:00
Russ Cox
e40d6e066a runtime: random offset for map iteration
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5285042
2011-10-17 18:49:02 -04:00
Russ Cox
304cf4dc9b reflect: disallow Interface method on Value obtained via unexported name
Had been allowing it for use by fmt, but it is too hard to lock down.
Fix other packages not to depend on it.

R=r, r
CC=golang-dev
https://golang.org/cl/5266054
2011-10-17 18:48:45 -04:00
Nigel Tao
e5f3dc8bc5 html: refactor the tokenizer; parse "</>" correctly.
Previously, Next would call either nextText or nextTag, but nextTag
could also call nextText. Both nextText and nextTag were responsible
for detecting "</a" end tags and "<!" comments. This change simplifies
the call chain and puts that responsibility in a single place.

R=andybalholm
CC=golang-dev
https://golang.org/cl/5263050
2011-10-18 09:42:16 +11:00
Russ Cox
d2b73730b7 exp/template/html: do not depend on reflection on internal fields
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5286049
2011-10-17 18:23:59 -04:00
Dmitriy Vyukov
b0c674b65d gc: treat uintptr as potentially containing a pointer
Fixes #2376

R=golang-dev, lvd, rsc
CC=golang-dev
https://golang.org/cl/5278048
2011-10-17 15:14:07 -04:00
Russ Cox
bdf66114c7 http: do not depend on map iteration order
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5284050
2011-10-17 14:51:54 -04:00
Russ Cox
9a7dd71944 template: do not depend on map iteration order
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5268048
2011-10-17 14:51:45 -04:00
Paul Borman
eea86de656 csv: fix issue 2366 - overly aggressive TrimLeadingSpace
Address the issue coalescing two records together when TrimLeadingSpace
is set to true.

The input

        a,b,
        c,d,e

Would result with a singled a,b,c,d,e record.
With TrailingComma set to true it should give two records.
With TrailingComma set to false it should be an error.

Fixes #2366.

R=golang-dev, go.peter.90, r
CC=golang-dev
https://golang.org/cl/5284046
2011-10-17 11:10:39 -07:00
Andrew Gerrand
64471ae762 http: fix panic when recovering from hijacked connection panic
Fixes #2375.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5279049
2011-10-17 15:54:36 +11:00
Nigel Tao
1887907fee html: tokenize "a < b" as one whole text token.
R=andybalholm
CC=golang-dev
https://golang.org/cl/5284042
2011-10-16 20:50:11 +11:00
Dmitriy Vyukov
1135fc3978 runtime: fix crash if user sets MemProfileRate=0
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5284044
2011-10-16 10:49:24 +03:00
Alex Brainman
78479163cb syscall: dll function load and calling changes
New DLL and Proc types to manage and call dll functions. These were
used to simplify syscall tests in runtime package. They were also
used to implement LazyDLL and LazyProc.

LazyProc, like Proc, now have Call function, that just a wrapper for
SyscallN. It is not as efficient as Syscall, but easier to use.

NewLazyDLL now supports non-ascii filenames.

LazyDLL and LazyProc now have Load and Find methods. These can be used
during runtime to discover if some dll functions are not present.

All dll functions now return errors that fit os.Error interface. They
also contain Windows error number.

Some of these changes are suggested by jp.

R=golang-dev, jp, rsc
CC=golang-dev
https://golang.org/cl/5272042
2011-10-15 17:29:25 +11:00
Andrew Balholm
b770c9e9a2 html: improve parsing of comments and "bogus comments"
R=nigeltao
CC=golang-dev
https://golang.org/cl/5279044
2011-10-15 12:22:08 +11:00
Brad Fitzpatrick
5079129deb http: DoS protection: cap non-Handler Request.Body reads
Previously, if an http.Handler didn't fully consume a
Request.Body before returning and the request and the response
from the handler indicated no reason to close the connection,
the server would read an unbounded amount of the request's
unread body to advance past the request message to find the
next request's header. That was a potential DoS.

With this CL there's a threshold under which we read
(currently 256KB) in order to keep the connection in
keep-alive mode, but once we hit that, we instead
switch into a "Connection: close" response and don't
read the request body.

Fixes #2093 (along with number of earlier CLs)

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5268043
2011-10-14 17:34:07 -07:00
Anthony Martin
b5077f82fa http: avoid panic caused by nil URL
The current code will panic if an invalid
request (one with a nil URL) is passed to
the doFollowingRedirects function.

Also, remove a redundant nil Header check.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5270046
2011-10-14 17:09:38 -07:00
Chris Farmiloe
55751a38f0 xml: match Marshal's XMLName behavior in Unmarshal
When xml.Marshal is called on a struct it will happily
reflect the information in the "tag" of an XMLName member
regardless of the type to give the struct a tag-name in
it's XML form. This is backed up by the documentation which
says:

However xml.Unmarshal *does* care about the XMLName field
being of type xml.Name, and currently returns the error
"field XMLName does not have type xml.Name" if you have it
set to something else.

This is firstly inconsistant with xml.Marshal but it also
makes it impossible to use xml.Marshal alongside other
Marshallers (like json/bson) without poluting the state's
namespace with XMLName fields. Inorder to exclude fields
from other Marshallers the convention has been started to
tag fields as "omitempty"; which will cause the field not
to display if it is at it's "zero" state, XMLName cannot
have such as zero-state since it is a struct, so it is nicer
to use a pointer/bool value for XMLName so it can be easily
excluded when I want to Marshal my struct by some other
wire format.

Attached is the proposed minor change, that simply stops
erring if it can't set the name on the XMLName field, which
is just optional metadata anyway.
Fixes #2265.

R=rsc
CC=golang-dev
https://golang.org/cl/5067044
2011-10-14 17:29:54 -04:00
Brad Fitzpatrick
b9ad2787dd http: RoundTrippers shouldn't mutate Request
Fixes #2146

R=rsc
CC=golang-dev
https://golang.org/cl/5284041
2011-10-14 14:16:43 -07:00
Russ Cox
236aff31c5 gofmt: fix //line handling
Fixes #2369.

R=gri
CC=golang-dev
https://golang.org/cl/5275048
2011-10-14 15:54:45 -04:00
Adam Langley
b3812bf6db crypto/x509: add code for dealing with PKIX public keys.
We also have functions for dealing with PKCS#1 private keys. This
change adds functions for PKIX /public/ keys. Most of the time one
won't be parsing them because they usually come in certificates, but
marshaling them happens and I've previously copied the code from
x509.go for this.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5286042
2011-10-14 15:11:21 -04:00
Adam Langley
e74dcbeb0f crypto/x509: keep the raw Subject and Issuer.
X509 names, like everything else X509, are ludicrously general. This
change keeps the raw version of the subject and issuer around for
matching. Since certificates use a distinguished encoding, comparing
the encoding is the same as comparing the values directly. This came
up recently when parsing the NSS built-in certificates which use the
raw subject and issuer for matching trust records to certificates.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5275047
2011-10-14 15:06:54 -04:00
Adam Langley
37e802a7c5 asn1: accept UTF8 strings as ASN.1 ANY values
R=bradfitz
CC=golang-dev
https://golang.org/cl/5172042
2011-10-14 15:06:11 -04:00
Brad Fitzpatrick
c4b9c8bb7d http: shut up a false Transport warning on Windows
Fixes #2057

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5269044
2011-10-14 11:31:00 -07:00
Luca Greco
d296fa1c95 websocket: tweak hybi ReadHandshake to supports Firefox implementation
Firefox Websocket implementation send a "Connection: keep-alive, upgrade"
header during the handshake (and as descripted on the last hybi draft
the "Connection" header must include, but doesn't need to be equal to,
"upgrade":

   '4. A "Connection" header field that includes the token "Upgrade",
    treated as an ASCII case-insensitive value.'

From:
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17#page-23

R=golang-dev, ukai, cw, rsc
CC=golang-dev
https://golang.org/cl/5233059
2011-10-14 14:27:45 -04:00
Brad Fitzpatrick
ddc3381e8b net: skip ICMP test on Windows too unless uid 0
This test fails for me on Windows 7 64-bit non-Admin.

R=golang-dev, rsc, krautz
CC=golang-dev
https://golang.org/cl/5276048
2011-10-14 10:07:27 -07:00
Mikkel Krautz
ec10d67725 crypto/tls: fix broken looping code in windows root CA fetcher
R=alex.brainman, hectorchu, rsc
CC=golang-dev
https://golang.org/cl/5263045
2011-10-14 12:26:38 -04:00
David Anderson
bb282baa93 syscall: adjust Mount to accomodate stricter FS implementations.
Notably, the "data" argument should be nil if no options are
given, or (at least) the cgroup filesystem will refuse to
mount.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5147047
2011-10-14 09:19:45 -07:00
Alex Brainman
8225f4d71f crypto/tls: disable root cert fetching to fix windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/5267044
2011-10-14 17:53:01 +11:00
Nigel Tao
b82a8e7c22 html: fix some tokenizer bugs with attribute key/values.
The relevant spec sections are 13.2.4.38-13.2.4.40.
http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#attribute-value-(double-quoted)-state

R=andybalholm
CC=golang-dev
https://golang.org/cl/5262044
2011-10-14 15:22:02 +11:00
Mikkel Krautz
3153395ed0 crypto/tls: fetch root CA from Windows store
R=rsc
CC=golang-dev
https://golang.org/cl/5281044
2011-10-13 22:58:19 -04:00
Robert Griesemer
812249fe5e gotype: move to exp/gotype per Go 1 plan
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/5269043
2011-10-13 16:36:53 -07:00
Nigel Tao
a49b8b9875 html: rewrite the tokenizer to be more consistent.
Previously, the tokenizer made two passes per token. The first pass
established the token boundary. The second pass picked out the tag name
and attributes inside that boundary. This was problematic when the two
passes disagreed. For example, "<p id=can't><p id=won't>" caused an
infinite loop because the first pass skipped everything inside the
single quotes, and recognized only one token, but the second pass never
got past the first '>'.

This change rewrites the tokenizer to use one pass, accumulating the
boundary points of token text, tag names, attribute keys and attribute
values as it looks for the token endpoint.

It should still be reasonably efficient: text, names, keys and values
are not lower-cased or unescaped (and converted from []byte to string)
until asked for.

One of the token_test test cases was fixed to be consistent with
html5lib. Three more test cases were temporarily disabled, and will be
re-enabled in a follow-up CL. All the parse_test test cases pass.

R=andybalholm, gri
CC=golang-dev
https://golang.org/cl/5244061
2011-10-14 09:58:39 +11:00
Robert Griesemer
29c2838cb4 go/types: move to exp/types per Go 1 plan
This package is only used by gotype at the moment.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5266042
2011-10-13 15:41:48 -07:00
Russ Cox
f58ed4e641 gc: disallow close on receive-only channels
Fixes #2353.
Fixes #2246.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5282042
2011-10-13 16:58:04 -04:00
Russ Cox
d65aaf24a6 crypto/tls: more Unix root certificate locations
Hard work done by
http://mercurial.selenic.com/wiki/CACertificates

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5276043
2011-10-13 16:17:15 -04:00
Russ Cox
d1bafffa4b runtime: run goroutines during init
Fixes #583.
Fixes #1776.
Fixes #2001.
Fixes #2112.

R=golang-dev, bradfitz, r, gri
CC=golang-dev
https://golang.org/cl/5265044
2011-10-13 15:54:23 -04:00
Mikkel Krautz
38fb09b412 crypto/tls: fetch root certificates using Mac OS API
Fixes #1009.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/5262041
2011-10-13 13:59:13 -04:00
Russ Cox
06862617c1 build: fix for new return restriction
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5257057
2011-10-13 12:17:18 -04:00
Russ Cox
f0e82dd493 go/types: clean up after test
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5245057
2011-10-13 12:17:08 -04:00
Dmitriy Vyukov
bf9c778fe2 gc: pass FlagNoPointers to runtime.new
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5151043
2011-10-13 11:06:55 +03:00
Robert Hencke
c50182480d pkg: fix incorrect prints found by govet
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5266041
2011-10-13 13:34:01 +11:00
Benny Siegert
beed0a7844 image/tiff: Implement PackBits decoding.
The decompression routine is in its own file because
G3 encoding (which is more complicated) will be put
there.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5177047
2011-10-13 13:31:26 +11:00
Andrew Balholm
c64e8e327e html: insert implied <p> and </p> tags
(test # 25 in tests1.dat)
#data
<p><b><div></p></b></div>X
#document
| <html>
|   <head>
|   <body>
|     <p>
|       <b>
|     <div>
|       <b>
|
|           <p>
|           "X"

R=nigeltao
CC=golang-dev
https://golang.org/cl/5254060
2011-10-13 12:40:48 +11:00
Nigel Tao
85368292a3 html: when a parse test fails, don't bother testing rendering.
R=andybalholm
CC=golang-dev
https://golang.org/cl/5248061
2011-10-13 11:53:15 +11:00
Rob Pike
aa2f439c6a fmt: remove an obsolete reference to os.ErrorString in a comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5229057
2011-10-12 13:50:08 -07:00
Christopher Wedgwood
707e5acd71 updates: append(y,[]byte(z)...) -> append(y,z...)"
(more are possible but omitted for now as they are part of
specific tests where rather than changing what is there we
should probably expand the tests to cover the new case)

R=rsc, dvyukov
CC=golang-dev
https://golang.org/cl/5247058
2011-10-12 13:42:04 -07:00
Robert Griesemer
3b5ff0fb14 go/typechecker: delete per Go 1 plan
(go/types will be future replacement)

R=r
CC=golang-dev
https://golang.org/cl/5232052
2011-10-12 13:07:55 -07:00
Brad Fitzpatrick
36036781d5 http: remove Request.RawURL
Its purpose is not only undocumented, it's also unknown (to me
and Russ, at least) and leads to complexity, bugs and
confusion.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5213043
2011-10-12 11:48:25 -07:00
Rob Pike
fefadcf51c netchan: move to old/netchan
Part of Go version 1 rearrangement.
No gofix, since the new name is not in Go 1.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5245055
2011-10-12 11:46:50 -07:00
Brad Fitzpatrick
0601000968 catch future accidental dependencies to exp/ or old/
R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5247055
2011-10-12 10:55:42 -07:00
Albert Strasheim
791b2a498e net: Return error from CloseRead and CloseWrite.
R=bradfitz, rsc, iant
CC=golang-dev
https://golang.org/cl/5167043
2011-10-12 13:45:25 -04:00
Albert Strasheim
51057bda3f net: fix "unexpected socket family" error from WriteToUDP.
R=rsc, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5128048
2011-10-12 13:36:45 -04:00
Russ Cox
8219cc9af8 runtime: fix memory leak in parallel garbage collector
The work buffer management used by the garbage
collector during parallel collections leaks buffers.
This CL tests for and fixes the leak.

R=golang-dev, dvyukov, r
CC=golang-dev
https://golang.org/cl/5254059
2011-10-12 13:23:34 -04:00
Dmitriy Vyukov
af1232fe38 runtime: faster strings
Use FlagNoPointers and do not zeroize memory when allocate strings.
test/garbage/parser.out        old         new
run #1                     32.923s     32.065s
run #2                     33.047s     31.931s
run #3                     32.702s     31.841s
run #4                     32.718s     31.838s
run #5                     32.702s     31.868s

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5259041
2011-10-12 17:40:02 +03:00
Luuk van Dijk
77fac21e82 runtime: append([]byte, string...)
Fixes #2274

R=rsc, gri, dsymonds, bradfitz, lvd
CC=golang-dev
https://golang.org/cl/5149045
2011-10-12 15:59:23 +02:00
Robert Griesemer
a0d335c31d go/scanner: remove AllowIllegalChars mode
This mode was needed before for clients of
the go/scanner that were parsing non-Go code.
All those clients have been moved to scanner
or have been deleted from the library.

R=r
CC=golang-dev
https://golang.org/cl/5232051
2011-10-11 22:28:56 -07:00
Robert Griesemer
187c3536a8 exp/datafmt: delete per Go 1 plan
R=r, bradfitz
CC=golang-dev
https://golang.org/cl/5249055
2011-10-11 17:52:37 -07:00
Robert Griesemer
e58a77809d ebnf, ebnflint: move under exp
pkg/ebnf -> pkg/exp/ebnf
cmd/ebnflint -> pkg/exp/ebnflint

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5188042
2011-10-11 17:43:10 -07:00
Brad Fitzpatrick
9b8cdad8aa exp/spdy: move http/spdy to exp/spdy
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5238051
2011-10-11 16:45:01 -07:00
Rob Pike
f4cb96b438 container/vector: delete
Slices are better:
http://code.google.com/p/go-wiki/wiki/SliceTricks

R=golang-dev, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/5248060
2011-10-11 16:41:48 -07:00
Alex Brainman
059c68bf0c net: implement ip protocol name to number resolver for windows
Fixes #2215.
Fixes #2216.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/5248055
2011-10-12 10:29:22 +11:00
Rob Pike
d69b820e01 try: delete
A fun experiment but not carrying its weight.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5246054
2011-10-11 16:17:21 -07:00
Dave Cheney
9691312e53 syscall: add #ifdefs to fix the manual corrections in ztypes_linux_arm.go
Fixes #1998.

ztypes_linux_arm.go has been regenerated on an arm5 debian sid host and
includes a few new constants.

R=golang-dev, mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/5240047
2011-10-11 15:47:00 -04:00
Louis Kruger
690d59fa3e crypto/tls: add 3DES ciphersuites
The following ciphersuites are added:
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
This change helps conform to the TLS1.1 standard because
the first ciphersuite is "mandatory" in RFC4346

R=golang-dev, agl, rsc
CC=golang-dev
https://golang.org/cl/5164042
2011-10-11 13:07:32 -04:00
Hector Chu
8584445289 runtime: fix crash when returning from syscall during gc
gp->m can go from non-nil to nil when it re-enters schedule().

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/5245042
2011-10-11 12:57:16 -04:00
Chris Farmiloe
4b749567b8 net: fix socket leak in case of Dial failure
Socket descriptors are not closed when fd.connect() fails during generic socket creation.
After a connection failure [ECONNREFUSED] descriptors are left in SYN_SENT state indefinitely (unless they get an explicit RST). Repeated failed connections will eventually cause your program to hit the user/system max-open-files limit.

Fixes #2349.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5229047
2011-10-11 12:53:16 -04:00
Brad Fitzpatrick
1444a08098 fmt: fix doc typo
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5252050
2011-10-11 08:49:09 -07:00
Andrew Gerrand
8440fdd904 godoc: support multiple examples
gotest: document examples
go/doc: tidy comment

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5235055
2011-10-11 11:11:47 +11:00
Rob Pike
c832ecf03e gob: avoid one copy for every message written.
Plus the need for a second in-memory buffer.
Plays a bit fast and loose with the contents of a byte buffer,
but saves a potentially huge allocation. The gotest
run is about 10% faster overall after this change.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5236043
2011-10-10 12:38:49 -07:00
Nigel Tao
be8b4d943f html: add a Render function.
R=mikesamuel, andybalholm
CC=golang-dev
https://golang.org/cl/5218041
2011-10-10 14:44:37 +11:00
Brad Fitzpatrick
e63fcd613f http: cancel test timers; don't t.Fatalf in other goroutines
R=rsc
CC=golang-dev
https://golang.org/cl/5228041
2011-10-09 17:57:31 -07:00
Luuk van Dijk
b536adbfba gc: changes to export format in preparation for inlining.
string literals used as package qualifiers are now prefixed with '@'
which obviates the need for the extra ':' before tags.

R=rsc, gri, lvd
CC=golang-dev
https://golang.org/cl/5129057
2011-10-08 19:37:06 +02:00
Adam Langley
bffadd6bd7 crypto/tls: forgot this file in the last change.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5244042
2011-10-08 10:11:38 -04:00
Adam Langley
7e48cb5ffe crypto/tls: add server side SNI support.
With this in place, a TLS server is capable of selecting the correct
certificate based on the client's ServerNameIndication extension.

The need to call Config.BuildNameToCertificate is unfortunate, but
adding a sync.Once to the Config structure made it uncopyable and I
felt that was too high a price to pay. Parsing the leaf certificates
in each handshake was too inefficient to consider.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5151048
2011-10-08 10:06:53 -04:00
Joel Sing
060ffabd18 runtime: improve locking on openbsd
Implement a locking model based on the current linux model - a
tri-state mutex with active spinning, passive spinning and sleeping.

R=golang-dev, dvyukov, rsc
CC=golang-dev
https://golang.org/cl/4974043
2011-10-09 00:56:13 +11:00
Rob Pike
c09af50213 testing: fix time reported for failing tests.
t.ns was hanging after recent changes.

R=gri, rsc
CC=golang-dev
https://golang.org/cl/5237044
2011-10-07 14:15:16 -07:00
Robert Griesemer
39b6fb7a19 go/token: remove obsolete comment (cleanup)
R=r
CC=golang-dev
https://golang.org/cl/5235042
2011-10-07 08:54:02 -07:00
Mikio Hara
b5260364b1 net: add File method to IPConn
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5237041
2011-10-07 22:53:12 +09:00
Brad Fitzpatrick
2b95cfbac3 utf8: add Valid and ValidString
R=r, rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/5234041
2011-10-06 22:47:24 -07:00
Nigel Tao
af2070598f image: delete obsolete color.go
I accidentally left it off of https://golang.org/cl/5132048/.

R=r
CC=golang-dev
https://golang.org/cl/5202042
2011-10-07 13:33:34 +11:00
Robert Griesemer
5782ea9646 go/token: document deserialization property
FileSet deserialization (Read) uses its own instance of a gob decoder.
If the FileSet data may be followed by other data on the reader, Read
may consume too much data that is lost unless the reader implements
ReadByte.

Also: Minor internal refactoring for symmetry.

R=r
CC=golang-dev
https://golang.org/cl/5233041
2011-10-06 17:37:59 -07:00
Robert Griesemer
3e46699958 go/ast: don't remove function bodies when filtering exports
This is a semantic but no API change. It is a cleaner
implementation of pure filtering. Applications that
need function bodies stripped can easily do this them-
selves.

R=rsc
CC=golang-dev
https://golang.org/cl/5206046
2011-10-06 16:07:56 -07:00
Rob Pike
b3dd32776b template: fix comments with different delimiters.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5208042
2011-10-06 15:21:56 -07:00
Rob Pike
dcf5318990 template: add method Delims to allow alternate action delimiters.
R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5209045
2011-10-06 13:30:50 -07:00
Andrew Gerrand
af1ae438b9 go/doc, godoc, gotest: support for reading example documentation
This CL introduces the go.Example type and go.Examples functions that
are used to represent and extract code samples from Go source.

They should be of the form:

// Output of this function.
func ExampleFoo() {
        fmt.Println("Output of this function.")
}

It also modifies godoc to read example code from _test.go files,
and include them in the HTML output with JavaScript-driven toggles.

It also implements testing of example functions with gotest.
The stdout/stderr is compared against the output comment on the
function.

This CL includes examples for the sort.Ints function and the
sort.SortInts type. After patching this CL in and re-building go/doc
and godoc, try
        godoc -http=localhost:6060
and visit http://localhost:6060/pkg/sort/

R=gri, r, rsc
CC=golang-dev
https://golang.org/cl/5137041
2011-10-06 11:56:17 -07:00
Brad Fitzpatrick
155e21cc7f exec: add Command.ExtraFiles
Allows passing extra fds to the child process.

Fixes #2329

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5162050
2011-10-06 11:00:02 -07:00
Miki Tebeka
f80d8fbcf0 testing: Add support for running tests in parallel (t.Parallel API).
See discussion at https://groups.google.com/d/topic/golang-dev/RAKiqi44GEU/discussion

R=golang-dev, bradfitz, dvyukov, rogpeppe, r, r, borman
CC=golang-dev
https://golang.org/cl/5071044
2011-10-06 09:58:36 -07:00
Dmitriy Vyukov
c14b2689f0 runtime: faster finalizers
Linux/amd64, 2 x Intel Xeon E5620, 8 HT cores, 2.40GHz
benchmark                    old ns/op    new ns/op    delta
BenchmarkFinalizer              420.00       261.00  -37.86%
BenchmarkFinalizer-2            985.00       201.00  -79.59%
BenchmarkFinalizer-4           1077.00       244.00  -77.34%
BenchmarkFinalizer-8           1155.00       180.00  -84.42%
BenchmarkFinalizer-16          1182.00       184.00  -84.43%

BenchmarkFinalizerRun          2128.00      1378.00  -35.24%
BenchmarkFinalizerRun-2        1655.00      1418.00  -14.32%
BenchmarkFinalizerRun-4        1634.00      1522.00   -6.85%
BenchmarkFinalizerRun-8        2213.00      1581.00  -28.56%
BenchmarkFinalizerRun-16       2424.00      1599.00  -34.03%

Darwin/amd64, Intel L9600, 2 cores, 2.13GHz
benchmark                    old ns/op    new ns/op    delta
BenchmarkChanCreation          1451.00       926.00  -36.18%
BenchmarkChanCreation-2        3124.00      1412.00  -54.80%
BenchmarkChanCreation-4        6121.00      2628.00  -57.07%

BenchmarkFinalizer              684.00       420.00  -38.60%
BenchmarkFinalizer-2          11195.00       398.00  -96.44%
BenchmarkFinalizer-4          15862.00       654.00  -95.88%

BenchmarkFinalizerRun          2025.00      1397.00  -31.01%
BenchmarkFinalizerRun-2        3920.00      1447.00  -63.09%
BenchmarkFinalizerRun-4        9471.00      1545.00  -83.69%

R=golang-dev, cw, rsc
CC=golang-dev
https://golang.org/cl/4963057
2011-10-06 18:42:51 +03:00
Russ Cox
ad35cea762 runtime: fix malloc sampling bug
The malloc sample trigger was not being set in a
new m, so the first allocation in each new m - the
goroutine structure - was being sampled with
probability 1 instead of probability sizeof(G)/rate,
an oversampling of about 5000x for the default
rate of 1 MB.  This bug made pprof graphs show
far more G allocations than there actually were.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5224041
2011-10-06 11:30:48 -04:00
Dmitriy Vyukov
5695915833 runtime: fix spurious deadlock reporting
Fixes #2337.
Unfortunate sequence of events is:
1. maxcpu=2, mcpu=1, grunning=1
2. starttheworld creates an extra M:
   maxcpu=2, mcpu=2, grunning=1
4. the goroutine calls runtime.GOMAXPROCS(1)
   maxcpu=1, mcpu=2, grunning=1
5. since it sees mcpu>maxcpu, it calls gosched()
6. schedule() deschedules the goroutine:
   maxcpu=1, mcpu=1, grunning=0
7. schedule() call getnextandunlock() which
   fails to pick up the goroutine again,
   because canaddcpu() fails, because mcpu==maxcpu
8. then it sees that grunning==0,
   reports deadlock and terminates

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5191044
2011-10-06 18:10:14 +03:00
Mikio Hara
504963e6a4 build: clear execute bit from source files
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5201042
2011-10-06 18:33:13 +09:00
Wei Guangjing
e7042418c5 cgo: support for mingw-w64 4.5.1 and newer
R=rsc, jp, hectorchu
CC=golang-dev
https://golang.org/cl/4962051
2011-10-06 07:22:48 +01:00
Marcel van Lohuizen
9a8da9d499 exp/norm: LastBoundary is used in preparation for an append operation. It seems
therefore unlikely that there is a good use for its string version
LastBoundaryInString. Yet, the implemenation of this method would complicate
things a bit as it would require the introduction for another interface and
some duplication of code. Removing it seems a better choice.

R=r
CC=golang-dev
https://golang.org/cl/5182044
2011-10-05 14:36:02 -07:00
Robert Griesemer
f7467e85e1 encoding/binary: added benchmarks
binary.BenchmarkPutUvarint32 20000000	 85.6 ns/op
binary.BenchmarkPutUvarint64 10000000	299   ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/5148049
2011-10-05 13:04:43 -07:00
Fumitoshi Ukai
9a0a30ec53 websocket: add hybi-13 support
Major changes between hybi-08 and hybi-13
- hybi-08 uses Sec-WebSocket-Origin, but hybi-13 uses Origin
- hybi-13 introduces new close status codes.

hybi-17 spec (editorial changes of hybi-13) mentions
- if a server doesn't support the requested version, it MUST respond
  with Sec-WebSocket-Version headers containing all available versions.
- client MUST close the connection upon receiving a masked frame
- server MUST close the connection upon receiving a non-masked frame
note that hybi-17 still uses "Sec-WebSocket-Version: 13"

see http://code.google.com/p/pywebsocket/wiki/WebSocketProtocolSpec
for changes between spec drafts.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5147043
2011-10-05 10:50:29 -07:00
Marcel van Lohuizen
5844fc1b21 exp/norm: introduced input interface to implement string versions
of methods.

R=r, mpvl
CC=golang-dev
https://golang.org/cl/5166045
2011-10-05 10:44:11 -07:00
Robert Griesemer
0da66a2e90 ebnf: use scanner instead of go/scanner
R=rsc, r
CC=golang-dev
https://golang.org/cl/5192043
2011-10-05 10:34:01 -07:00
Joel Sing
b2f1eba324 runtime: set runtime ncpu on openbsd
Set the runtime ncpu based on the hw.ncpu sysctl.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5191043
2011-10-05 13:16:43 -04:00
Rob Pike
457dfd7546 gob: when possible, allow sequential decoders on the same input stream.
This can work only if there is no type info required to initialize the decoder,
but it's easy and gains a few percent in the basic benchmarks by avoiding
bufio when it's a bytes.Buffer - a testing-only scenario, I admit.
Add a comment about what Decode expects from the input.

R=rsc
CC=golang-dev
https://golang.org/cl/5165048
2011-10-05 09:47:09 -07:00
Joel Sing
a5f064a3e1 gc: limit helper threads based on ncpu
When ncpu < 2, work.nproc is always 1 which results in infinite helper
threads being created if gomaxprocs > 1 and MaxGcproc > 1. Avoid this
by using the same limits as imposed helpgc().

R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/5176044
2011-10-05 12:08:28 -04:00
Anthony Martin
528ccdc513 runtime: fix Plan 9 build
This change adds the osyield and usleep
functions and code to read the number of
processors from /dev/sysstat.

I also changed SysAlloc to return nil
when brk fails (it was returning -1).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5177049
2011-10-05 12:07:44 -04:00