1
0
mirror of https://github.com/golang/go synced 2024-10-04 15:11:20 -06:00
Commit Graph

147 Commits

Author SHA1 Message Date
Joe Tsai
260ea68999 os: deprecate os.SEEK_SET, os.SEEK_CUR, and os.SEEK_END
CL/19862 introduced the same set of constants to the io package.
We should steer users away from the os.SEEK* versions and towards
the io.Seek* versions.

Updates #6885

Change-Id: I96ec5be3ec3439e1295c937159dadaf1ebfb2737
Reviewed-on: https://go-review.googlesource.com/21540
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-05 19:59:50 +00:00
Brad Fitzpatrick
7c15b2ab4b os: make IsExists also recognize syscall.ENOTEMPTY
And adds missing tests.

Fixes #14970

Change-Id: I0dba02603bc245f555498cb5dd3e0a9d87c52353
Reviewed-on: https://go-review.googlesource.com/21467
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-03 06:22:07 +00:00
Elias Naur
fb49655d7b os: skip TestStatStdin on Android
Android doesn't (generally) have /bin/sh.

Change-Id: I343817c342e3473d09c85155761682b5ddb043e4
Reviewed-on: https://go-review.googlesource.com/21075
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-24 19:07:11 +00:00
Yasuhiro Matsumoto
ebd67ba588 os: fix Stdin.Stat() on windows
If name is /dev/{stdin,stdout,stderr}, return fileInfo.

Fixes #14853.

Change-Id: Ibf7d1ae7b9f3dc43f6ed7c905ea2c5102e1971cc
Reviewed-on: https://go-review.googlesource.com/20845
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2016-03-24 09:22:33 +00:00
Russ Cox
80a0517129 os/user: allow LookupGroupId to fail during test
On my Mac I am in group 5000 which apparently has no name
(I suspect because it is an LDAP group and I cannot reach the
LDAP server). Do not make the test fail in that case.

Fixes #14806

Change-Id: I56b11a8e86b048abfb00812eaad37802fd2adcc5
Reviewed-on: https://go-review.googlesource.com/20710
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-15 16:25:40 +00:00
Brad Fitzpatrick
b55a5dbb8a os/user: fix formatting of error group lookup message
It was failing like "unknown groupid ᎈ|" instead of "unknown groupid
5000" due to the conversion from int to string.

Updates #14806

Change-Id: I83e4b478ff628ad4053573a9f32b3fadce22e847
Reviewed-on: https://go-review.googlesource.com/20642
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2016-03-14 00:45:25 +00:00
Ross Light
f128b5421e os/user: make OS-specific getgrouplist calls
getgrouplist is non-standard and has slightly different semantics on
each platform.  Darwin defines the function in terms of ints instead of
gid_ts.  Solaris only recently supported the call, so stubbing out for
now.

Fixes #14696
Fixes #14709

Change-Id: I5a44538d41594909efb6f3f9610c55d638c36757
Reviewed-on: https://go-review.googlesource.com/20348
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-08 20:58:00 +00:00
Brad Fitzpatrick
b20187196f os/user: skip Current test on android
Also, add more failure output to debug why linux/mips64le and
linux/ppc64 are failing. They should be working. I suspect their
builder test envs are missing something.

Change-Id: I97273fe72c4e3009db400394636d0da1ef147485
Reviewed-on: https://go-review.googlesource.com/20358
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-08 17:28:13 +00:00
Brad Fitzpatrick
40e60e7c13 os, syscall: skip tests when environment doesn't permit testing
Fixes #14693

Change-Id: Id0a6a80b4c37c0b0f1c2755667b7233ed8964e40
Reviewed-on: https://go-review.googlesource.com/20342
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-07 22:40:50 +00:00
Brad Fitzpatrick
795e712b72 os/user: make Current work without cgo
Fixes #14626

Change-Id: I91c40407dc35355e5c5046f24111a126f99260d9
Reviewed-on: https://go-review.googlesource.com/20192
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2016-03-07 20:22:32 +00:00
Ross Light
42f07ff267 os/user: add LookupGroup, LookupGroupId, and User.GroupIds functions
As part of local testing with a large group member list, I discovered
that the lookup functions don't resize their buffer if they receive
ERANGE.  I fixed this as a side-effect of this CL.

Thanks to @andrenth for the original CL.

Fixes #2617

Change-Id: Ie6aae2fe0a89eae5cce85786869a8acaa665ffe9
Reviewed-on: https://go-review.googlesource.com/19235
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-07 20:11:19 +00:00
Brad Fitzpatrick
5fea2ccc77 all: single space after period.
The tree's pretty inconsistent about single space vs double space
after a period in documentation. Make it consistently a single space,
per earlier decisions. This means contributors won't be confused by
misleading precedence.

This CL doesn't use go/doc to parse. It only addresses // comments.
It was generated with:

$ perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')
$ go test go/doc -update

Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7
Reviewed-on: https://go-review.googlesource.com/20022
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Day <djd@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-02 00:13:47 +00:00
Brad Fitzpatrick
519474451a all: make copyright headers consistent with one space after period
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>
2016-03-01 23:34:33 +00:00
Brad Fitzpatrick
351c15f1ce all: remove public named return values when useless
Named returned values should only be used on public funcs and methods
when it contributes to the documentation.

Named return values should not be used if they're only saving the
programmer a few lines of code inside the body of the function,
especially if that means there's stutter in the documentation or it
was only there so the programmer could use a naked return
statement. (Naked returns should not be used except in very small
functions)

This change is a manual audit & cleanup of public func signatures.

Signatures were not changed if:

* the func was private (wouldn't be in public godoc)
* the documentation referenced it
* the named return value was an interesting name. (i.e. it wasn't
  simply stutter, repeating the name of the type)

There should be no changes in behavior. (At least: none intended)

Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109
Reviewed-on: https://go-review.googlesource.com/20024
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-02-29 03:31:19 +00:00
Burcu Dogan
47b0422885 os: fix tests on brillo
Not every Android contains the /system/framework directory, e.g. Brillo.
Test against other Android-only system files.

Fixes #14489.

Change-Id: I6d9ec1c4d4ceba3803798015e6917d59cf515de8
Reviewed-on: https://go-review.googlesource.com/19904
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Burcu Dogan <jbd@google.com>
Run-TryBot: Burcu Dogan <jbd@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 21:05:40 +00:00
Martin Möhrmann
fdd0179bb1 all: fix typos and spelling
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>
2016-02-24 18:42:29 +00:00
Shawn Smith
58ec5839cd all: fix typos
Change-Id: I6035941df8b0de6aeaf6c05df7257bcf6e9191fe
Reviewed-on: https://go-review.googlesource.com/19320
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-23 13:58:47 +00:00
Josh Bleecher Snyder
e43c74a0d8 all: use cannot instead of can not
You can not use cannot, but you cannot spell cannot can not.

Change-Id: I2f0971481a460804de96fd8c9e46a9cc62a3fc5b
Reviewed-on: https://go-review.googlesource.com/19772
Reviewed-by: Rob Pike <r@golang.org>
2016-02-21 15:35:50 +00:00
Nathan VanBenschoten
b04f3b06ec all: replace strings.Index with strings.Contains where possible
Change-Id: Ia613f1c37bfce800ece0533a5326fca91d99a66a
Reviewed-on: https://go-review.googlesource.com/18120
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
2016-02-19 01:06:05 +00:00
Brad Fitzpatrick
af15beeab5 os: document that FindProcess always succeeds on Unix
Fixes #14146

Change-Id: I892ca4ccdc1ba785750e1eae800852dc5825156c
Reviewed-on: https://go-review.googlesource.com/19093
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-29 18:29:10 +00:00
Ian Lance Taylor
21b4f234c7 runtime: for c-archive/c-shared, install signal handlers synchronously
The previous behaviour of installing the signal handlers in a separate
thread meant that Go initialization raced with non-Go initialization if
the non-Go initialization also wanted to install signal handlers.  Make
installing signal handlers synchronous so that the process-wide behavior
is predictable.

Update #9896.

Change-Id: Ice24299877ec46f8518b072a381932d273096a32
Reviewed-on: https://go-review.googlesource.com/18150
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-09 00:58:38 +00:00
Russ Cox
29eea94abe os: read only 10,000 bytes at a time from Windows console
Reading 32,767 is too many on some versions of Windows.
The exact upper bound is unclear.

For #13697, but may not fix the problem on all systems.

Change-Id: I197021ed60cbcd33c91ca6ceed456ec3d5a6c9d6
Reviewed-on: https://go-review.googlesource.com/18433
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-08 16:52:37 +00:00
Alex Brainman
d75acd67ec internal/syscall/windows: correct GetACP and MultiByteToWideChar
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>
2016-01-08 16:15:59 +00:00
Ian Lance Taylor
8971d61835 os/signal: clarify signal doc
Based on comments from Thomas Bushnell.

Update #9896.

Change-Id: I603b1382d17dff00b5d18f17f8b5d011503e9e4c
Reviewed-on: https://go-review.googlesource.com/18365
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-08 15:01:09 +00:00
David du Colombier
161f2e85ee os: fix rename on Plan 9
Rename should remove newname if the file already exists
and is not a directory.

Fixes #13844.

Change-Id: I85a5cc28e8d161637a8bc1de33f4a637d9154cd1
Reviewed-on: https://go-review.googlesource.com/18291
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-08 14:22:47 +00:00
Russ Cox
5d8442aeaa os: document that Rename overwrites existing file
Fixes #13673.

Change-Id: I60d1603ca0dfd2ae136117e0f89cee4b6fc6c3d3
Reviewed-on: https://go-review.googlesource.com/18332
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-07 00:41:10 +00:00
Russ Cox
901810ae55 os/exec: document that examples assume Unix
Fixes #13693.

Change-Id: Ieb89d8a8874ee8c6b304de99dceb07193c26b60e
Reviewed-on: https://go-review.googlesource.com/18315
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-06 17:58:48 +00:00
Ian Lance Taylor
e24b2445b4 os/signal: Stop restores original signal handling
Since Stop was introduced, it would revert to the system default for the
signal, rather than to the default Go behavior.  Change it to revert to
the default Go behavior.

Change-Id: I345467ece0e49e31b2806d6fce2f1937b17905a6
Reviewed-on: https://go-review.googlesource.com/18229
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-06 14:25:39 +00:00
Ian Lance Taylor
81b35117d9 runtime: set SIGCONT to _SigNotify + _SigDefault
Use the current ability to say that we don't do anything with SIGCONT by
default, but programs can catch it using signal.Notify if they want.

Fixes #8953.

Change-Id: I67d40ce36a029cbc58a235cbe957335f4a58e1c5
Reviewed-on: https://go-review.googlesource.com/18185
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-05 17:44:46 +00:00
Ian Lance Taylor
b80ea53200 os: remove unused import to fix build
Change-Id: Ia8c1c77590115a5ffda144962436d489ed77a423
Reviewed-on: https://go-review.googlesource.com/18227
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-05 01:21:26 +00:00
Ian Lance Taylor
58c73de7d0 os, runtime: better EPIPE behavior for command line programs
Old behavior: 10 consecutive EPIPE errors on any descriptor cause the
program to exit with a SIGPIPE signal.

New behavior: an EPIPE error on file descriptors 1 or 2 cause the
program to raise a SIGPIPE signal.  If os/signal.Notify was not used to
catch SIGPIPE signals, this will cause the program to exit with SIGPIPE.
An EPIPE error on a file descriptor other than 1 or 2 will simply be
returned from Write.

Fixes #11845.
Update #9896.

Change-Id: Ic85d77e386a8bb0255dc4be1e4b3f55875d10f18
Reviewed-on: https://go-review.googlesource.com/18151
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-05 00:32:50 +00:00
Ian Lance Taylor
a7d2b4d7ce runtime: disable a signal by restoring the original disposition
Fixes #13034.
Fixes #13042.
Update #9896.

Change-Id: I189f381090223dd07086848aac2d69d2c00d80c4
Reviewed-on: https://go-review.googlesource.com/18062
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-05 00:25:50 +00:00
Alex Brainman
ca47157395 os: change Open(C:) to open current directory on C:
Open(`C:`) currently opens root directory on C:. Change that to open
current directory on C:. Just like cmd.exe's "dir C:" command does.
Just like FindFirstFile("C:*") Windows API does. It is also consistent
with what filepath.Join("C:", "a") currently does.

Fixes #13763

Change-Id: I60b6e7d80215d110bbbb6265c9f32717401638c6
Reviewed-on: https://go-review.googlesource.com/18184
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
2015-12-31 00:20:54 +00:00
Hiroshi Ioka
4601776901 os: fix race condition between (*os.File).Stat and os.Chdir on windows
Fixes #13752

Change-Id: I53cfc4ecae90c35b6f1074f3be08489c408a6464
Reviewed-on: https://go-review.googlesource.com/18181
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-12-30 06:37:08 +00:00
Mikio Hara
6766a293ef os: add missing copyright notice
Change-Id: I496b701e2fcc944c764002643c7b0b2ce9e08806
Reviewed-on: https://go-review.googlesource.com/18182
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-12-29 09:02:28 +00:00
Ian Lance Taylor
fbdfa99246 runtime: for c-archive/c-shared, don't install unnecessary signal handlers
Only install signal handlers for synchronous signals that become
run-time panics.  Set the SA_ONSTACK flag for other signal handlers as
needed.

Fixes #13028.
Update #12465.
Update #13034.
Update #13042.

Change-Id: I28375e70641f60630e10f3c86e24b6e4f8a35cc9
Reviewed-on: https://go-review.googlesource.com/17903
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-12-18 22:27:38 +00:00
Ian Lance Taylor
ab39b8de7e os/signal: document signal handling
This is an attempt to document the current state of signal handling.
It's not intended to describe the best way to handle signals.  Future
changes to signal handling should update these docs as appropriate.

update #9896.

Change-Id: I3c50af5cc641357b57dfe90ae1c7883a7e1ec059
Reviewed-on: https://go-review.googlesource.com/17877
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 16:59:39 +00:00
mattn
7a48117899 os,internal/syscall/windows: use ReadFile/MultiByteToWideChar to read from console
Fixes #6303

Change-Id: Ib2cd15ac6106ef8e6b975943db8efc8d8ab21052
Reviewed-on: https://go-review.googlesource.com/4310
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-17 16:23:39 +00:00
Rahul Chaudhry
a27bbb7f74 os: make TestLchown actually test Lchown.
TestLchown was creating a hard-link instead of a symlink. It would
have passed if you replaced all Lchown() calls in it with Chown().

Change-Id: I3a108948ec25fcbac8ea890a6eaf5bac094f0800
Reviewed-on: https://go-review.googlesource.com/17397
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-14 22:42:55 +00:00
Volker Dobler
008e96c056 os: be more specific on what flags are used for
The flags are used in OpenFile, not Open.

Change-Id: I45c1639e36694529cb29c2b580c43a22e6fd10ac
Reviewed-on: https://go-review.googlesource.com/17352
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-03 16:27:11 +00:00
Rahul Chaudhry
3afee4380b os: skip TestHardLink on Android.
From Android release M (Marshmallow), hard linking files is blocked
and an attempt to call link() on a file will return EACCES.
- https://code.google.com/p/android-developer-preview/issues/detail?id=3150

Change-Id: Ifdadaa31e3d5ee330553f45db6c001897dc955be
Reviewed-on: https://go-review.googlesource.com/17339
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-03 01:24:13 +00:00
David Crawshaw
9fa6a2d42d os: use different test files on android
Some Android OS installations have very strange permissions on their
/system/etc directory, meaning that Readdir fails. Instead use
/system/framework, which is far more regular.

Change-Id: Iefc140614183cda0f875e0f6ef859f4d4eaad9da
Reviewed-on: https://go-review.googlesource.com/17078
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-11-20 16:37:21 +00:00
Shenghou Ma
85ca578d4a os: add document for ErrInvalid
Fixes #12391.

Change-Id: I31211cd711c035151785c3083571594d15c7d93e
Reviewed-on: https://go-review.googlesource.com/16873
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-13 01:09:10 +00:00
Taru Karttunen
f5f480e1df os: reduce allocations in Readdir on unix
Include syscall.Stat_t on unix to the
unexported fileStat structure rather than
accessing it though an interface.

Additionally add a benchmark for Readdir
(and Readdirnames).

Tested on linux, freebsd, netbsd, openbsd
darwin, solaris, does not touch windows
stuff. Does not change the API, as
discussed on golang-dev.

E.g. on linux/amd64 with a directory of 65 files:

benchmark              old ns/op     new ns/op     delta
BenchmarkReaddir-4     67774         66225         -2.29%

benchmark              old allocs     new allocs     delta
BenchmarkReaddir-4     334            269            -19.46%

benchmark              old bytes     new bytes     delta
BenchmarkReaddir-4     25208         24168         -4.13%

Change-Id: I44ef72a04ad7055523a980f29aa11122040ae8fe
Reviewed-on: https://go-review.googlesource.com/16423
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-30 19:47:55 +00:00
Burcu Dogan
3356624df3 os/signal: don't expect to be notified for os.Kill
os.Kill cannot be caught on Unix systems.
The example gives the false impression that it can.

Fixes #13080.

Change-Id: I3b9e6f38a38f437a463c5b869ae84a0d3fd23f72
Reviewed-on: https://go-review.googlesource.com/16467
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-10-29 15:39:15 +00:00
Brad Fitzpatrick
c4fa25f4fc os/exec: make Cmd.Output include stderr in ExitError
Change-Id: I3c6649d2f2521ab0843b13308569867d2e5f02da
Reviewed-on: https://go-review.googlesource.com/11415
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-22 14:08:10 +00:00
Hyang-Ah Hana Kim
84808a2a90 os: disable symlink tests on android.
Creating symlinks (/data/local/tmp/*) doesn't seem to work
on android-L (tested on nexus5). I cannot find any official
documentation yet but just guess it's a measure for security
attacks using symlinks.

The tests failed with 'permission denied' errors.

For golang/go#10807

Change-Id: I99a9c401c6ecca3c4adc7b21708adaf3dd601279
Reviewed-on: https://go-review.googlesource.com/16115
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-10-20 22:18:23 +00:00
Michael Hudson-Doyle
0b8d583320 runtime, os/signal: use //go:linkname instead of assembly stubs to get access to runtime functions
os/signal depends on a few unexported runtime functions. This removes the
assembly stubs it used to get access to these in favour of using
//go:linkname in runtime to make the functions accessible to os/signal.

This is motivated by ppc64le shared libraries, where you cannot BR to a symbol
defined in a shared library (only BL), but it seems like an improvment anyway.

Change-Id: I09361203ce38070bd3f132f6dc5ac212f2dc6f58
Reviewed-on: https://go-review.googlesource.com/15871
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-10-16 07:11:04 +00:00
Brad Fitzpatrick
735c65fa9c os: make IsPermission, IsExist, and IsNotExist unwrap SyscallError too
Fixes #12674

Change-Id: I82f53026dd2fc27bd7999d43c27932d683d92af6
Reviewed-on: https://go-review.googlesource.com/15730
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-10 21:20:14 +00:00
Shenghou Ma
53c92f95a8 os: document that behavior of Seek on O_APPEND files is not specified
The actual behavior varies across platforms, and due to the inherent
race, we can't do anything better (other than to always return 0).

Fixes #12710.

Change-Id: Icb52f0f1f0a267e0f9f70767cae427f3f0239965
Reviewed-on: https://go-review.googlesource.com/14881
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-23 17:06:02 +00:00