Commit graph

33 commits

Author SHA1 Message Date
Yasuhiro Matsumoto 76c45877c9 syscall: implement Unix Socket for Windows
Add implementation of AF_UNIX. This works only on Windows 10.

https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

Fixes #26072

Change-Id: I76a96a472385a17901885271622fbe55d66bb720
Reviewed-on: https://go-review.googlesource.com/125456
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2018-08-28 09:26:45 +00:00
Brad Fitzpatrick becd2a83c7 syscall: convert Windows AddrinfoW.Addr from uintptr to syscall.Pointer
API compatibility violation, but it wasn't safe before and people
should be using golang.org/x/sys/windows instead.

Fixes #24820

Change-Id: I3b43493f56b3116924b9d848a294899279f314fd
Reviewed-on: https://go-review.googlesource.com/123455
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-07-12 15:36:15 +00:00
Daniel Theophanes bedfa4e1c3 text/template/parse: undo breaking API changes
golang.org/cl/84480 altered the API for the parse package for
clarity and consistency. However, the changes also broke the
API for consumers of the package. This CL reverts the API
to the previous spelling, adding only a single new exported
symbol.

Fixes #25968

Change-Id: Ieb81054b61eeac7df3bc3864ef446df43c26b80f
Reviewed-on: https://go-review.googlesource.com/120355
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-22 08:05:11 +00:00
Thanabodee Charoenpiriyakij b74f7321e5 syscall: update TOKEN_ALL_ACCESS according to WinNT.h
TOKEN_ALL_ACCESS was changed at some stage by Microsoft.

Updates #25775

Change-Id: I3e18914207a0020b2ebfb99f4e57aa55f9de813b
Reviewed-on: https://go-review.googlesource.com/117635
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2018-06-11 00:45:20 +00:00
Alex Brainman 4869ec00e8 syscall: introduce Pointer type and use it instead of uintptr
Some syscall structures used by crypto/x509 have uintptr
fields that store pointers. These pointers are set with
a pointer to another Go structure. But the pointers are
not visible by garbage collector, and GC does not update
the fields after they were set. So when structure with
invalid uintptr pointers passed to Windows, we get
memory corruption.

This CL introduces CertInfo, CertTrustListInfo and
CertRevocationCrlInfo types. It uses pointers to new types
instead of uintptr in CertContext, CertSimpleChain and
CertRevocationInfo.

CertRevocationInfo, CertChainPolicyPara and
CertChainPolicyStatus types have uintptr field that can
be pointer to many different things (according to Windows
API). So this CL introduces Pointer type to be used for
those cases.

As suggested by Austin Clements.

Fixes #21376
Updates #24820

Change-Id: If95cd9eee3c69e4cfc35b7b25b1b40c2dc8f0df7
Reviewed-on: https://go-review.googlesource.com/106275
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-04-18 08:50:42 +00:00
Daniel Martí c5dd254393 api: remove unnecessary lines from except.txt
When I added the text/template/parse lines, I thought that both removed
and added APIs should be listed here (i.e. both -pkg and +pkg lines).
However that was wrong, as one can see by reading cmd/api/goapi.go, or
seeing how removing the +pkg lines does not break the API test.

Change-Id: I0a8dcd6db44762dadb58728acfb844bf118c9d45
Reviewed-on: https://go-review.googlesource.com/105376
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-09 21:19:11 +00:00
Daniel Martí 28c1ad9d35 text/template: add variable assignments
Variables can be declared and shadowing is supported, but modifying
existing variables via assignments was not available.

This meant that modifying a variable from a nested block was not
possible:

	{{ $v := "init" }}
	{{ if true }}
		{{ $v := "changed" }}
	{{ end }}
	v: {{ $v }} {{/* "init" */}}

Introduce the "=" assignment token, such that one can now do:

	{{ $v := "init" }}
	{{ if true }}
		{{ $v = "changed" }}
	{{ end }}
	v: {{ $v }} {{/* "changed" */}}

To avoid confusion, rename PipeNode.Decl to PipeNode.Vars, as the
variables may not always be declared after this change. Also change a
few other names to better reflect the added ambiguity of variables in
pipelines.

Modifying the text/template/parse package in a backwards incompatible
manner is acceptable, given that the package godoc clearly states that
it isn't intended for general use. It's the equivalent of an internal
package, back when internal packages didn't exist yet.

To make the changes to the parse package sit well with the cmd/api test,
update except.txt with the changes that we aren't worried about.

Fixes #10608.

Change-Id: I1f83a4297ee093fd45f9993cebb78fc9a9e81295
Reviewed-on: https://go-review.googlesource.com/84480
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-04-04 15:51:56 +00:00
Joe Tsai 5cf3b52308 api: add exception for os.ModeType value
The ModeType constant is a bit-wise OR of several other values.
It is reasonable for this to change without breaking compatibility.

This fixes the failures introduced by https://golang.org/cl/103597

Change-Id: I817e351cf3d1e0115dce665c8efbce21bc36426c
Reviewed-on: https://go-review.googlesource.com/103616
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-03-30 03:31:14 +00:00
Tobias Klauser acd17e9b2b syscall: support Getwd on all BSDs
All supported BSDs provide the SYS___GETCWD syscall which can be used to
implement syscall.Getwd. With this change os.Getwd can use a single
syscall instead of falling back to the current kludge solution on the
BSDs.

This doesn't add any new exported functions to the frozen syscall
package, only ImplementsGetwd changes to true for dragonfly, freebsd,
netbsd and openbsd.

As suggested by Ian, this follows CL 83755 which did the same for
golang.org/x/sys/unix.

Also, an entry for netbsd/arm is added to mkall.sh which was used to
generate the syscall wrappers there.

Change-Id: I84da1ec61a6b8625443699a63cde556b6442ad41
Reviewed-on: https://go-review.googlesource.com/84484
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-13 15:41:19 +00:00
Marcel van Lohuizen 2fd9549797 unicode: update to Unicode 10.0.0
Also includes all derived values as well as
vendored packages.

Generated by running
    UNICODE_VERSION=10.0.0 go generate
in golang.org/x/text

and modified by hand to add the tests and
entries in next.txt for new script and properties.

Closes Issue #21471

Change-Id: I1d10ee3887bd1fd3d5a756ee0d04bd6ec2814ba1
Reviewed-on: https://go-review.googlesource.com/63953
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-24 12:42:35 +00:00
griesemer 51cfe6849a math/big: provide support for conversion bases up to 62
Increase MaxBase from 36 to 62 and extend the conversion
alphabet with the upper-case letters 'A' to 'Z'. For int
conversions with bases <= 36, the letters 'A' to 'Z' have
the same values (10 to 35) as the corresponding lower-case
letters. For conversion bases > 36 up to 62, the upper-case
letters have the values 36 to 61.

Added MaxBase to api/except.txt: Clients should not make
assumptions about the value of MaxBase being constant.

The core of the change is in natconv.go. The remaining
changes are adjusted tests and documentation.

Fixes #21558.

Change-Id: I5f74da633caafca03993e13f32ac9546c572cc84
Reviewed-on: https://go-review.googlesource.com/65970
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
2017-10-06 17:46:15 +00:00
Robert Griesemer 174058038c math/big: define Word as uint instead of uintptr
For compatibility with math/bits uint operations.

When math/big was written originally, the Go compiler used 32bit
int/uint values even on a 64bit machine. uintptr was the type that
represented the machine register size. Now, the int/uint types are
sized to the native machine register size, so they are the natural
machine Word type.

On most machines, the size of int/uint correspond to the size of
uintptr. On platforms where uint and uintptr have different sizes,
this change may lead to performance differences (e.g., amd64p32).

Change-Id: Ief249c160b707b6441848f20041e32e9e9d8d8ca
Reviewed-on: https://go-review.googlesource.com/37372
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-21 19:31:40 +00:00
Joel Sing f91ddaabe6 runtime, syscall: update openbsd for changes to syskill
Change the openbsd runtime to use the current sys_kill and sys_thrkill
system calls.

Prior to OpenBSD 5.9 the sys_kill system call could be used with both
processes and threads. In OpenBSD 5.9 this functionality was split into
a sys_kill system call for processes (with a new syscall number) and a
sys_thrkill system call for threads. The original/legacy system call was
retained in OpenBSD 5.9 and OpenBSD 6.0, however has been removed and
will not exist in the upcoming OpenBSD 6.1 release.

Note: This change is needed to make Go work on OpenBSD 6.1 (to be
released in May 2017) and should be included in the Go 1.8 release.
This change also drops support for OpenBSD 5.8, which is already an
unsupported OpenBSD release.

Change-Id: I525ed9b57c66c0c6f438dfa32feb29c7eefc72b0
Reviewed-on: https://go-review.googlesource.com/34093
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-12-12 01:30:39 +00:00
Russ Cox c56cc9b3b5 testing: introduce testing/internal/testdeps for holding testmain dependencies
Currently, we don't have package testing to import package regexp directly,
because then regexp can't have internal tests (or at least they become more
difficult to write), for fear of an import cycle. The solution we've been using
is for the generated test main package (pseudo-import path "testmain", package main)
to import regexp and pass in a matchString function for use by testing when
implementing the -run flags. This lets testing use regexp but without depending
on regexp and creating unnecessary cycles.

We want to add a few dependencies to runtime/pprof, notably regexp
but also compress/gzip, without causing those packages to have to work
hard to write internal tests.

Restructure the (dare I say it) dependency injection of regexp.MatchString
to be more general, and use it for the runtime/pprof functionality in addition
to the regexp functionality. The new package testing/internal/testdeps is
the root for the testing dependencies handled this way.

Code using testing.MainStart will have to change from passing in a matchString
implementation to passing in testdeps.TestDeps{}. Users of 'go test' don't do this,
but other build systems that have recreated 'go test' (for example, Blaze/Bazel)
may need to be updated. The new testdeps setup should make future updates
unnecessary, but even so we keep the comment about MainStart not being
subject to Go 1 compatibility.

Change-Id: Iec821d2afde10c79f95f3b23de5e71b219f47b92
Reviewed-on: https://go-review.googlesource.com/32455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-02 19:14:39 +00:00
Russ Cox 5ad3bd99b5 api: sort except.txt
Make it easier to find lines and update the file.

Change-Id: I9db78ffd7316fbc17c5488e178e23777756d8f47
Reviewed-on: https://go-review.googlesource.com/32454
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-02 19:09:39 +00:00
Ian Gudger 154860ff17 syscall: remove X__cmsg_data from Cmsghdr
This field is a zero length array and has little use. Since Go 1.5, trailing
zero-length arrays take up space. Both syscall.UnixRights() and
syscall.ParseSocketControlMessage() depend on being able to do an unsafe cast
of socket control message data to Cmsghdr this is only safe if the socket
control message data is greater than or equal to the size of Cmsghdr. Since
control message data that is equal in size to Cmsghdr without X__cmsg_data is
a valid socket control message, we must remove X__cmsg_data or not perform the
unsafe cast.

Removing X__cmsg_data will prevent Go code that uses X__cmsg_data from
compiling, but removing the unsafe cast will cause Go code that uses
X__cmsg_data to fail or exhibit undefined behavior at runtime. It was
therefore decided that removing X__cmsg_data was the better option.

Fixes #17649

Change-Id: I39f323f978eca09d62da5785c5c5c9c7cbdf8c31
Reviewed-on: https://go-review.googlesource.com/32319
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-30 19:04:09 +00:00
Brad Fitzpatrick 1625da2410 encoding/json: marshal the RawMessage value type the same as its pointer type
Fixes #14493
Updates #6458 (changes its behavior)

Change-Id: I851a8113fd312dae3384e989ec2b70949dc22838
Reviewed-on: https://go-review.googlesource.com/21811
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Quentin Smith <quentin@golang.org>
2016-10-26 21:03:00 +00:00
Marcel van Lohuizen a2a4db7375 unicode: upgrade to version 9.0.0
Changes beyond generated tables:
- Now supports aliases to handle deprecated
  property classes.
- Some Mongolian letters are now modifiers.

Other changes:
- strconv: newly generated table to be in sync
- regexp/syntax: updated maxFold

Fixes #16191

Change-Id: I56bdf21ee2f775f2a82d0465b3772faf5c24cb61
Reviewed-on: https://go-review.googlesource.com/24496
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-28 15:08:11 +00:00
Marcel van Lohuizen fe15da62f7 unicode: upgrade to 8.0.0
Not sure if I'm on time for 1.5; Unicode 8 just got released.

Straighforward upgrade. Only changed maketables.go to prevent it from adding
the Cherokee upper and lower case mappings. This change causes the caseOrbit
table to NOT change. Added tests to verify that the relevant functions still
produce the correct result, even for Cherokee.

Fixes #11309

Change-Id: I42850f5b3399bde125b002efc78eff96dbd86a08
Reviewed-on: https://go-review.googlesource.com/11286
Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-26 18:01:29 +00:00
Marcel van Lohuizen 65d8cb985f unicode: strconv: regexp: Upgrade to Unicode 7.0.0.
LGTM=r, bradfitz
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/127470043
2014-08-18 20:26:10 +02:00
Mikio Hara ed963c908d undo CL 102610045 / 7244ce3ae9db
preparing for the syscall package freeze.

««« original CL description
syscall: regenerate z-files for darwin

Updates z-files from 10.7 kernel-based to 10.9 kernel-based.

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/102610045
»»»

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/114530044
2014-07-30 09:47:39 +09:00
Mikio Hara fbd5ad585d syscall: regenerate z-files for darwin
Updates z-files from 10.7 kernel-based to 10.9 kernel-based.

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/102610045
2014-06-24 09:20:42 +09:00
Mikio Hara 8c8c260d2e api: update openbsd exceptions
This CL restores dropped constants not supported in OpenBSD 5.5
and tris to keep the promise of API compatibility.

Update #7049

LGTM=jsing, bradfitz
R=rsc, jsing, bradfitz
CC=golang-codereviews
https://golang.org/cl/94950043
2014-05-16 06:49:50 +09:00
Shenghou Ma d957169cf8 api: add NetBSD/ARM EABI exceptions.
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/71940043
2014-03-06 01:19:16 -05:00
Mikio Hara d30d42915a api: add FreeBSD 10 exceptions
Update #7193

LGTM=minux.ma
R=golang-codereviews, rsc, minux.ma, iant
CC=golang-codereviews
https://golang.org/cl/57210043
2014-03-04 09:26:28 +09:00
Brad Fitzpatrick ac40fb4470 api: whitelist change to unicode.Version
Unbreaks the build.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/65650043
2014-02-18 13:38:47 -08:00
Brad Fitzpatrick ec8a24adbd api: add Fchflags exception to more platforms
Unbreaks the build.

R=golang-codereviews, dsymonds
CC=golang-codereviews
https://golang.org/cl/53820045
2014-01-22 10:48:58 -08:00
Joel Sing 8aaca37383 api: update except.txt and next.txt to reflect openbsd system ABI break
Update #7049

R=golang-codereviews, minux.ma, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/49470052
2014-01-11 20:16:39 +11:00
Brad Fitzpatrick 39e004b69e api: update go1.1, except and next.txt with constant values
O_SYNC changes only on linux-arm (and linux-arm-cgo), but
changes to match O_SYNC on linux-{386,amd64} and what Linux
upstream now uses.  See discussion and links on
https://golang.org/cl/13261050/

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13575045
2013-09-06 12:01:18 -07:00
Rob Pike a3695fb227 api: update next.txt, except.txt
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12926046
2013-08-20 11:14:45 +10:00
Shenghou Ma 6de184b385 syscall: fix prototype of Fchflags (API change)
API change, but the old API is obviously wrong.

R=golang-dev, iant, r, rsc
CC=golang-dev
https://golang.org/cl/9157044
2013-05-07 05:20:00 +08:00
Mikio Hara 0d197251ee net: change ListenUnixgram signature to return UnixConn instead of UDPConn
This CL breaks Go 1 API compatibility but it doesn't matter because
previous ListenUnixgram doesn't work in any use cases, oops.

The public API change is:
-pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
+pkg net, func ListenUnixgram(string, *UnixAddr) (*UnixConn, error)

Fixes #3875.

R=rsc, golang-dev, dave
CC=golang-dev
https://golang.org/cl/6937059
2012-12-16 11:51:47 +09:00
Rob Pike d87d488953 cmd/api: add exception file
Fixes build.

R=golang-dev, adg, bradfitz, dsymonds, dave
CC=golang-dev
https://golang.org/cl/6586074
2012-10-04 11:35:17 +10:00