summaryrefslogtreecommitdiff
path: root/src/internal/syscall
Commit message (Collapse)AuthorAgeFilesLines
* internal/syscall/windows: add GetModuleFileNameShenghou Ma2016-11-072-0/+15
| | | | | | | | For os.Executable. Updates #12773. Change-Id: Iff6593514b7453b6c5e1f20079e35cb4992cc74a Reviewed-on: https://go-review.googlesource.com/32877 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: make copyright headers consistent with one space after periodMichael Munday2016-11-042-2/+2
| | | | | | | | Continuation of CL 20111. Change-Id: Ie2f62237e6ec316989c021de9b267cc9d6ee6676 Reviewed-on: https://go-review.googlesource.com/32830 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* internal/syscall/unix: add randomTrap const for GOARCH=mips{,le}Vladimir Stefanovic2016-11-031-0/+11
| | | | | | Change-Id: I76c62a7b79ea526f59f281e933e4fd431539d2da Reviewed-on: https://go-review.googlesource.com/31486 Reviewed-by: Cherry Zhang <cherryyz@google.com>
* syscall: use ERROR_IO_PENDING value in errnoErrAlex Brainman2016-10-222-8/+8
| | | | | | | | | | | | | So errnoErr can be used in other packages. This is something I missed when I sent CL 28990. Fixes #17539 Change-Id: I8ee3b79c4d70ca1e5b29e5b40024f7ae9a86061e Reviewed-on: https://go-review.googlesource.com/29690 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os, syscall: fix incorrect offset calculation in Readlink on windowsHiroshi Ioka2016-10-192-0/+35
| | | | | | | | | | | | | | | | Current implementation of syscall.Readlink mistakenly calculates the end offset of the PrintName field. Also, there are some cases that the PrintName field is empty. Instead, the CL uses SubstituteName with correct calculation. Fixes #15978 Fixes #16145 Change-Id: If3257137141129ac1c552d003726d5b9c08bb754 Reviewed-on: https://go-review.googlesource.com/31118 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os: use FindFirstFile when GetFileAttributesEx fails in StatAlex Brainman2016-10-141-0/+1
| | | | | | | | | | Fixes #15355 Change-Id: Idbab7a627c5de249bb62d519c5a47f3d2f6c82a7 Reviewed-on: https://go-review.googlesource.com/22796 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os: make readConsole handle its input and output correctlyAlex Brainman2016-10-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL introduces first test for readConsole. And new test discovered couple of problems with readConsole. Console characters consist of multiple bytes each, but byte blocks returned by syscall.ReadFile have no character boundaries. Some multi-byte characters might start at the end of one block, and end at the start of next block. readConsole feeds these blocks to syscall.MultiByteToWideChar to convert them into utf16, but if some multi-byte characters have no ending or starting bytes, the syscall.MultiByteToWideChar might get confused. Current version of syscall.MultiByteToWideChar call will make syscall.MultiByteToWideChar ignore all these not complete multi-byte characters. The CL solves this issue by changing processing from "randomly sized block of bytes at a time" to "one multi-byte character at a time". New readConsole code calls syscall.ReadFile to get 1 byte first. Then it feeds this byte to syscall.MultiByteToWideChar. The new syscall.MultiByteToWideChar call uses MB_ERR_INVALID_CHARS flag to make syscall.MultiByteToWideChar return error if input is not complete character. If syscall.MultiByteToWideChar returns correspondent error, we read another byte and pass 2 byte buffer into syscall.MultiByteToWideChar, and so on until success. Old readConsole code would also sometimes return no data if user buffer was smaller then uint16 size, which would confuse callers that supply 1 byte buffer. This CL fixes that problem too. Fixes #17097 Change-Id: I88136cdf6a7bf3aed5fbb9ad2c759b6c0304ce30 Reviewed-on: https://go-review.googlesource.com/29493 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* os: add new tests for symbolic links and directory junctionsAlex Brainman2016-10-125-7/+222
| | | | | | | | | | | Updates #15978 Updates #16145 Change-Id: I161f5bc97d41c08bf5e1405ccafa86232d70886d Reviewed-on: https://go-review.googlesource.com/25320 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* os: use GetConsoleCP() instead of GetACP()Yasuhiro Matsumoto2016-09-212-0/+8
| | | | | | | | | | | | | | | | | | | | | | It is possible (and common) for Windows systems to use a different codepage for console applications from that used on normal windowed application (called ANSI codepage); for instance, most of the western Europe uses CP850 for console (for backward compatibility with MS-DOS), while windowed applications use a different codepage depending on the country (eg: CP1252 aka Latin-1). The usage being changed with this commit is specifically related to decoding input coming from the console, so the previous usage of the ANSI codepage was wrong. Also fixes an issue that previous did convert bytes as NFD. Go is designed to handle single Unicode code point. This fix change behaivor to NFC. Fixes #16857. Change-Id: I4f41ae83ece47321b6e9a79a2087ecbb8ac066dd Reviewed-on: https://go-review.googlesource.com/27575 Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* syscall: avoid convT2I allocs for common Windows error valuesBrad Fitzpatrick2016-09-072-4/+54
| | | | | | | | | | | | | This is was already done for Unix in https://golang.org/cl/6701 + https://golang.org/cl/8192. Do it for Windows also. Fixes #16988 Change-Id: Ia7832b0d0d48566b0cd205652b85130df529592e Reviewed-on: https://go-review.googlesource.com/28484 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
* syscall, internal/syscall/windows, internal/syscall/windows/registry: make ↵Alex Brainman2016-08-244-4/+14
| | | | | | | | | | | | go generate work on every os Fixes #16368 Change-Id: I2ef7a2deb5798e11cc1d3f8ca29a6e1655155422 Reviewed-on: https://go-review.googlesource.com/27411 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* syscall: make mksyscall_windows.go -systemdll flag true by defaultAlex Brainman2016-05-122-2/+2
| | | | | | | | | | Updates #15167 Change-Id: I826f67e75011ba79325a1294ac0d70d7c6a3e32f Reviewed-on: https://go-review.googlesource.com/23022 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* syscall: remove mksyscall_windows.go -xsys flagAlex Brainman2016-05-112-6/+10
| | | | | | | | | | | | | Also run "go generate" in internal/syscall/windows and internal/syscall/windows/registry Updates #15167 Change-Id: I0109226962f81857fe11d308b869d561ea8ed9f9 Reviewed-on: https://go-review.googlesource.com/23021 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* runtime, syscall: only search for Windows DLLs in the System32 directoryBrad Fitzpatrick2016-04-015-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Make sure that for any DLL that Go uses itself, we only look for the DLL in the Windows System32 directory, guarding against DLL preloading attacks. (Unless the Windows version is ancient and LoadLibraryEx is unavailable, in which case the user probably has bigger security problems anyway.) This does not change the behavior of syscall.LoadLibrary or NewLazyDLL if the DLL name is something unused by Go itself. This change also intentionally does not add any new API surface. Instead, x/sys is updated with a LoadLibraryEx function and LazyDLL.Flags in: https://golang.org/cl/21388 Updates #14959 Change-Id: I8d29200559cc19edf8dcf41dbdd39a389cd6aeb9 Reviewed-on: https://go-review.googlesource.com/21140 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* internal/syscall/unix: add randomTrap const for s390xMichael Munday2016-03-221-0/+9
| | | | | | | Change-Id: I81376f524e76db25fd52cc5bec2c80fbf618a0c5 Reviewed-on: https://go-review.googlesource.com/20877 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* internal/syscall/unix: document randomTrapBrad Fitzpatrick2016-03-216-0/+17
| | | | | | | | Updates #10848 Change-Id: I8353100ed01cb0e8fc19225157f5709bae388612 Reviewed-on: https://go-review.googlesource.com/20975 Reviewed-by: Rob Pike <r@golang.org>
* all: make copyright headers consistent with one space after periodBrad Fitzpatrick2016-03-019-9/+9
| | | | | | | | | | | | | | | | | | | | | | This is a subset of https://golang.org/cl/20022 with only the copyright header lines, so the next CL will be smaller and more reviewable. Go policy has been single space after periods in comments for some time. The copyright header template at: https://golang.org/doc/contribute.html#copyright also uses a single space. Make them all consistent. Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0 Reviewed-on: https://go-review.googlesource.com/20111 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* crypto/rand: use the getentropy syscall on OpenBSDMichael McConville2016-02-261-0/+25
| | | | | | | | | | | | | | | | | Go already supports Linux's getrandom, which is a slightly modified version of getentropy. getentropy was added in OpenBSD 5.6. All supported versions of OpenBSD include it so, unlike with Linux and getrandom, we don't need to test for its presence. Fixes #13785. Change-Id: Ib536b96675f257cd8c5de1e3a36165e15c9abac9 Reviewed-on: https://go-review.googlesource.com/18219 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: fix typos and spellingMartin Möhrmann2016-02-241-2/+2
| | | | | | | | Change-Id: Icd06d99c42b8299fd931c7da821e1f418684d913 Reviewed-on: https://go-review.googlesource.com/19829 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* internal/syscall/windows: correct GetACP and MultiByteToWideCharAlex Brainman2016-01-082-16/+9
| | | | | | | | | | | CL 4310 introduced these functions, but their implementation does not match with their published documentation. Correct the implementation. Change-Id: I285e41f9c7c5fc4e550ff59b0adb8b2bcbf6737a Reviewed-on: https://go-review.googlesource.com/17997 Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com> Reviewed-by: Russ Cox <rsc@golang.org>
* internal/syscall/windows/registry: adjust TestGetMUIStringValueAlex Brainman2016-01-061-6/+8
| | | | | | | | | | | Do not check DaylightName if DynamicDaylightTimeDisabled is false. Fixes #13502 Change-Id: I03e01ec0afdeb0037a5d3ee243674e5a6b559da5 Reviewed-on: https://go-review.googlesource.com/17998 Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com> Reviewed-by: Russ Cox <rsc@golang.org>
* os,internal/syscall/windows: use ReadFile/MultiByteToWideChar to read from ↵mattn2015-12-172-0/+31
| | | | | | | | | | console Fixes #6303 Change-Id: Ib2cd15ac6106ef8e6b975943db8efc8d8ab21052 Reviewed-on: https://go-review.googlesource.com/4310 Reviewed-by: Russ Cox <rsc@golang.org>
* net, internal/syscall/windows: fix interface and address identification on ↵Mikio Hara2015-12-102-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | windows The current implementation including Go 1.5 through 1.5.2 misuses Windows API and mishandles the returned values from GetAdapterAddresses on Windows. This change fixes various issues related to network facility information by readjusting interface and interface address parsers. Updates #5395. Updates #10530. Updates #12301. Updates #12551. Updates #13542. Fixes #12691. Fixes #12811. Fixes #13476. Fixes #13544. Also fixes fragile screen scraping test cases in net_windows_test.go. Additional information for reviewers: It seems like almost all the issues above have the same root cause and it is misunderstanding of Windows API. If my interpretation of the information on MSDN is correctly, current implementation contains the following bugs: - SIO_GET_INTERFACE_LIST should not be used for IPv6. The behavior of SIO_GET_INTERFACE_LIST is different on kernels and probably it doesn't work correctly for IPv6 on old kernels such as Windows XP w/ SP2. Unfortunately MSDN doesn't describe the detail of SIO_GET_INTERFACE_LIST, but information on the net suggests so. - Fetching IP_ADAPTER_ADDRESSES structures with fixed size area may not work when using IPv6. IPv6 generates ton of interface addresses for various addressing scopes. We need to adjust the area appropriately. - PhysicalAddress field of IP_ADAPTER_ADDRESSES structure may have extra space. We cannot ignore PhysicalAddressLength field of IP_ADAPTER_ADDRESS structure. - Flags field of IP_ADAPTER_ADDRESSES structure doesn't represent any of administratively and operatinal statuses. It just represents settings for windows network adapter. - MTU field of IP_ADAPTER_ADDRESSES structure may have a uint32(-1) on 64-bit platform. We need to convert the value to interger appropriately. - IfType field of IP_ADAPTER_ADDRESSES structure is not a bit field. Bitwire operation for the field is completely wrong. - OperStatus field of IP_ADAPTER_ADDRESSES structure is not a bit field. Bitwire operation for the field is completely wrong. - IPv6IfIndex field of IP_ADAPTER_ADDRESSES structure is just a substitute for IfIndex field. We cannot prefer IPv6IfIndex to IfIndex. - Windows XP, 2003 server and below don't set OnLinkPrefixLength field of IP_ADAPTER_UNICAST_ADDRESS structure. We cannot rely on the field on old kernels. We can use FirstPrefix field of IP_ADAPTER_ADDRESSES structure and IP_ADAPTER_PREFIX structure instead. - Length field of IP_ADAPTER_{UNICAST,ANYCAST,MULTICAST}_ADDRESS sturecures doesn't represent an address prefix length. It just represents a socket address length. Change-Id: Icabdaf7bd1d41360a981d2dad0b830b02b584528 Reviewed-on: https://go-review.googlesource.com/17412 Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* internal/syscall/unix: added support for linux/mips64{,le}Yao Zhang2015-11-121-0/+9
| | | | | | | Change-Id: Ib6f168b6a2daf3befbf75b4b95967ff91ac95d12 Reviewed-on: https://go-review.googlesource.com/14456 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* internal/syscall/unix: eliminate non-trivial randomTrap initializerMatthew Dempsky2015-11-056-9/+39
| | | | | | | | | | | | | | While here, enable getrandom on arm64 too (using the value found in include/uapi/asm-generic/unistd.h, which seems to match up with other GOARCH=arm64 syscall numbers). Updates #10848. Change-Id: I5ab36ccf6ee8d5cc6f0e1a61d09f0da7410288b9 Reviewed-on: https://go-review.googlesource.com/16662 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* internal/syscall/windows/registry: do not panic when data is largeAlex Brainman2015-09-041-5/+5
| | | | | | | | | | Allow registry blobs to be as large as 500MB Update #12493 Change-Id: I1d0e5c10772d25f8e7e17fed6e2e7dd12ca4e7cf Reviewed-on: https://go-review.googlesource.com/14287 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* registry: Explain how GetMUIStringValue works and where it falls shortDaniel Johansson2015-08-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GetMUIStringValue tries as a convenience to resolve string values even for pathless resource DLLs by searching the system directory (one of several paths used by the system's standard DLL search order algorithm). This would not be needed if regLoadMUIString searched for pathless DLLs itself, but it doesn't, instead it needs an absolute path, otherwise it will fail. This approach works fine for solving issue #12015 (handle localized time zone names; for which GetMUIStringValue was created) since tzres.dll that is used to resolve localized time zone names has no path in the registry but is located under the system directory. However, this approach will fail if a pathless DLL is located somewhere else than the system directory. Because of this limitation GetMUIStringValue may have to be revised in the future to allow for custom paths, possibly through another version of the function. See also: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724890%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx Change-Id: Ida66a0ef1928e0461ce248c795827902d785e6cd Reviewed-on: https://go-review.googlesource.com/13929 Reviewed-by: Rob Pike <r@golang.org>
* time: handle localized time zone namesDaniel Johansson2015-08-264-0/+133
| | | | | | | | | | | | | | | The existing implementation fails to determine the correct time zone abbreviations when the display language is non-English. This change adds support for localized time zone names (standard- and daylightname) by using the function RegLoadMUIString. Fixes #12015 Change-Id: Ic0dc89c50993af8f292b199c20bc5932903e7e87 Reviewed-on: https://go-review.googlesource.com/13854 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* internal/syscall/windows/registry: remove debugging dregAlex Brainman2015-08-241-1/+0
| | | | | | Change-Id: I1b9f6ad322a7f68fa160c4f09d7fb56815e505a7 Reviewed-on: https://go-review.googlesource.com/13828 Reviewed-by: Rob Pike <r@golang.org>
* Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn"Mikio Hara2015-07-025-201/+0
| | | | | | | | | | | | | | | | This reverts commit 6f7961da28232c609f7c51b3bed7f15db7dd33e1. Russ suggests changing the frozon syscall package and obviously it's a better solution. Perhaps he will also let me know the way how to get the project owners to agree later. Fixes #11492. Change-Id: I98f9f366b72b85db54b4acfc3a604b62fb6d783c Reviewed-on: https://go-review.googlesource.com/11854 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* internal/syscall/windows/registry: fix read overrun in GetStringsValuePatrick Mezard2015-05-153-2/+86
| | | | | | | | | | | | | | | | | | According to MSDN RegQueryValueEx page: If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, the string may not have been stored with the proper terminating null characters. Therefore, even if the function returns ERROR_SUCCESS, the application should ensure that the string is properly terminated before using it; otherwise, it may overwrite a buffer. (Note that REG_MULTI_SZ strings should have two terminating null characters.) Test written by Alex Brainman <alex.brainman@gmail.com> Change-Id: I8c0852e0527e27ceed949134ed5e6de944189986 Reviewed-on: https://go-review.googlesource.com/9806 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
* net, internal/syscall/unix: add SocketConn, SocketPacketConnMikio Hara2015-05-135-0/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | FileConn and FilePacketConn APIs accept user-configured socket descriptors to make them work together with runtime-integrated network poller, but there's a limitation. The APIs reject protocol sockets that are not supported by standard library. It's very hard for the net, syscall packages to look after all platform, feature-specific sockets. This change allows various platform, feature-specific socket descriptors to use runtime-integrated network poller by using SocketConn, SocketPacketConn APIs that bridge between the net, syscall packages and platforms. New exposed APIs: pkg net, func SocketConn(*os.File, SocketAddr) (Conn, error) pkg net, func SocketPacketConn(*os.File, SocketAddr) (PacketConn, error) pkg net, type SocketAddr interface { Addr, Raw } pkg net, type SocketAddr interface, Addr([]uint8) Addr pkg net, type SocketAddr interface, Raw(Addr) []uint8 Fixes #10565. Change-Id: Iec57499b3d84bb5cb0bcf3f664330c535eec11e3 Reviewed-on: https://go-review.googlesource.com/9275 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* internal/syscall/windows/registry: handle invalid integer valuesPatrick Mezard2015-05-111-0/+6
| | | | | | | | | I have around twenty of such values on a Windows 7 development machine. regedit displays (translated): "invalid 32-bits DWORD value". Change-Id: Ib37a414ee4c85e891b0a25fed2ddad9e105f5f4e Reviewed-on: https://go-review.googlesource.com/9901 Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* internal/syscall/windows: increase registry.ExpandString bufferPatrick Mezard2015-05-101-1/+1
| | | | | | | | | | | | | | | | ExpandString correctly loops on the syscall until it reaches the required buffer size but truncates it before converting it back to string. The truncation limit is increased to 2^15 bytes which is the documented maximum ExpandEnvironmentStrings output size. This fixes TestExpandString on systems where len($PATH) > 1024. Change-Id: I2a6f184eeca939121b458bcffe1a436a50f3298e Reviewed-on: https://go-review.googlesource.com/9805 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* mime, time, internal/syscall/windows/registry: use new registry package to ↵Alex Brainman2015-04-305-0/+1205
| | | | | | | | | | | | | simplify code This CL copies golang.org/x/sys/windows/registry into internal/syscall/windows/registry (minus KeyInfo.ModTime to prevent dependency cycles). New registry package is used in mime and time packages instead of calling Windows API directly. Change-Id: I965a5a41d4739b3ba38e539a7b8d96d3223e3d56 Reviewed-on: https://go-review.googlesource.com/9271 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* internal/syscall: move to unix subdirectoryIan Lance Taylor2015-04-151-6/+6
| | | | | | | | | | Move the single file from internal/syscall to internal/syscall/unix, to match the golang.org/x/sys layout. Change-Id: I2fb2832b4cb22efc7666bd276f5401ac3e73dc40 Reviewed-on: https://go-review.googlesource.com/8972 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rob Pike <r@golang.org>
* os: windows Rename should overwrite destination file.Daniel Theophanes2015-04-092-1/+33
| | | | | | | | | | Rename now uses MoveFileEx which was previously not available to use because it is not supported on Windows 2000. Change-Id: I583d029c4467c9be6d1574a790c423559b441e87 Reviewed-on: https://go-review.googlesource.com/6140 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
* crypto/x509: use syscall.GetVersion instead of ↵Alex Brainman2015-03-312-13/+0
| | | | | | | | | | | | | internal/syscall/windows.GetVersion cl8167 introduced internal/syscall/windows.GetVersion, but we already have that function in syscall.GetVersion. Use that instead. Also revert all internal/syscall/windows cl8167 changes. Change-Id: I512a5bf4b3b696e93aaf69e9e8b7df7022670ec0 Reviewed-on: https://go-review.googlesource.com/8302 Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Reviewed-by: Minux Ma <minux@golang.org>
* crypto/x509: skip SHA2 system verify test if not supported.Daniel Theophanes2015-03-302-0/+13
| | | | | | | | | | Windows XP SP2 and Windows 2003 do not support SHA2. Change-Id: Ica5faed040e9ced8b79fe78d512586e0e8788b3f Reviewed-on: https://go-review.googlesource.com/8167 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* os: Use GetComputerNameEx to get Hostname on win32Carlos Castillo2015-02-252-3/+31
| | | | | | | | | | | | | | | | | | | | | | The existing Hostname function uses the GetComputerName system function in windows to determine the hostname. It has some downsides: - The name is limited to 15 characters. - The name returned is for NetBIOS, other OS's return a DNS name This change adds to the internal/syscall/windows package a GetComputerNameEx function, and related enum constants. They are used instead of the syscall.ComputerName function to implement os.Hostname on windows. Fixes #9982 Change-Id: Idc8782785eb1eea37e64022bd201699ce9c4b39c Reviewed-on: https://go-review.googlesource.com/5852 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Carlos Castillo <cookieo9@gmail.com> Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
* net: re-implement Interfaces and InterfaceAddrs for IPNet, IPv6 on Windowsmattn2015-02-102-0/+119
| | | | | | | | Fixes #5395 Change-Id: I4322bc8a974d04d9bae6b48c71c5d32d9252973c Reviewed-on: https://go-review.googlesource.com/3024 Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* internal/syscall: add getrandom syscall number for ppc64/ppc64leShenghou Ma2015-01-211-3/+5
| | | | | | Change-Id: I04c1b8f2a9ac4efba227d6c0a20459420cd3dc05 Reviewed-on: https://go-review.googlesource.com/3014 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+56
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.