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

175 Commits

Author SHA1 Message Date
Russ Cox
1cdd9b407d os: document that users of Fd should keep f alive
Fixes #9046.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/162680043
2014-11-06 09:36:51 -05:00
Keith Randall
23ecad07cd os/exec: tell lsof not to block
For some reason lsof is now hanging on my workstation
without the -b (avoid blocking in the kernel) option.
Adding -b makes the test pass and shouldn't hurt.

I don't know how recent the -b option is.  If the builders
are ok with it, it's probably ok.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/166220043
2014-11-05 20:25:20 -08:00
Russ Cox
599199fd9f [dev.power64] all: merge default (dd5014ed9b01) into dev.power64
Still passes on amd64.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/165110043
2014-10-29 11:45:01 -04:00
David du Colombier
5f54f06a35 os: fix write on Plan 9
In CL 160670043 the write function was changed
so a zero-length write is now allowed. This leads
the ExampleWriter_Init test to fail.

The reason is that Plan 9 preserves message
boundaries, while the os library expects systems
that don't preserve them. We have to ignore
zero-length writes so they will never turn into EOF.

This issue was previously discussed in CL 7406046.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/163510043
2014-10-28 22:44:59 +01:00
Russ Cox
8a9c2c55bd os: fix build
TBR=crawshaw
CC=golang-codereviews
https://golang.org/cl/162390043
2014-10-28 15:34:50 -04:00
Russ Cox
a62da2027b os: do not assume syscall i/o funcs return n=0 on error
Fixes #9007.

LGTM=iant, r
R=r, iant
CC=golang-codereviews
https://golang.org/cl/160670043
2014-10-28 15:00:13 -04:00
Austin Clements
f0bd539c59 [dev.power64] all: merge default into dev.power64
This brings dev.power64 up-to-date with the current tip of
default.  go_bootstrap is still panicking with a bad defer
when initializing the runtime (even on amd64).

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/152570049
2014-10-22 15:51:54 -04:00
Austin Clements
2bd616b1a7 build: merge the great pkg/ rename into dev.power64
This also removes pkg/runtime/traceback_lr.c, which was ported
to Go in an earlier commit and then moved to
runtime/traceback.go.

Reviewer: rsc@golang.org
          rsc: LGTM
2014-10-22 13:25:37 -04:00
David du Colombier
1946afb662 os/exec: fix number of expected file descriptors on Plan 9
Since CL 104570043 and 112720043, we are using the
nsec system call instead of /dev/bintime on Plan 9.

LGTM=rsc
R=rsc
CC=aram, golang-codereviews
https://golang.org/cl/155590043
2014-10-20 23:01:32 +02:00
Russ Cox
05c4b69f84 os/exec: document that Stdin goroutine must finish in Wait
Fixes #7990.

LGTM=iant, bradfitz
R=bradfitz, iant, robryk
CC=golang-codereviews
https://golang.org/cl/156220043
2014-10-15 13:09:59 -04:00
David du Colombier
b9fc8d8cbd os: handle 'no parent' error as IsNotExist on Plan 9
This error is returned by lib9p when removing a file
without parent. It should fix TestRemoveAllRace
when running on ramfs.

LGTM=bradfitz, aram
R=rsc, bradfitz, aram
CC=golang-codereviews, mischief
https://golang.org/cl/153410044
2014-10-13 20:39:46 +02:00
Russ Cox
ab724f928f os, syscall: test Chtimes on directories, fix on Windows
Fixes #8090.

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews
https://golang.org/cl/154020043
2014-10-06 19:22:48 -04:00
Russ Cox
1eea5caa30 os: recomment MkdirAll
The internal comments are not completely precise about
what is going on, and they are causing confusion.

Fixes #8283.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/151460043
2014-10-06 15:49:33 -04:00
Russ Cox
d21b37bbe7 os: make Process.Signal 'process finished' error consistent on Unix
While we're here, fix the implementation of Release on both
Unix and Windows: Release is supposed to make Signal an error.

While we're here, make sure we never Signal pid 0.
(Don't try this at home.)

Fixes #7658.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/152240043
2014-10-06 15:49:19 -04:00
Brad Fitzpatrick
85cdc49e8a os, syscall: add Unsetenv
Also address a TODO, making Clearenv pass through to cgo.

Based largely on Minux's earlier https://golang.org/cl/82040044

Fixes #6423

LGTM=iant, alex.brainman, r, rsc
R=rsc, iant, r, alex.brainman
CC=golang-codereviews
https://golang.org/cl/148370043
2014-10-01 11:17:15 -07:00
Brad Fitzpatrick
665a416665 os: fix Args setup on Windows
Should fix the Windows build. Untested.

on Windows, args are made by src/os/exec_windows.go, not package runtime.
runtime·goargs has if(Windows) return;

The two init funcs in pkg os were conflicting, with the second
overwriting Args back to an empty slice.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/143540044
2014-09-24 18:50:54 -04:00
Russ Cox
193daab988 cmd/cc, cmd/ld, runtime: disallow conservative data/bss objects
In linker, refuse to write conservative (array of pointers) as the
garbage collection type for any variable in the data/bss GC program.

In the linker, attach the Go type to an already-read C declaration
during dedup. This gives us Go types for C globals for free as long
as the cmd/dist-generated Go code contains the declaration.
(Most runtime C declarations have a corresponding Go declaration.
Both are bss declarations and so the linker dedups them.)

In cmd/dist, add a few more C files to the auto-Go-declaration list
in order to get Go type information for the C declarations into the linker.

In C compiler, mark all non-pointer-containing global declarations
and all string data as NOPTR. This allows them to exist in C files
without any corresponding Go declaration. Count C function pointers
as "non-pointer-containing", since we have no heap-allocated C functions.

In runtime, add NOPTR to the remaining pointer-containing declarations,
none of which refer to Go heap objects.

In runtime, also move os.Args and syscall.envs data into runtime-owned
variables. Otherwise, in programs that do not import os or syscall, the
runtime variables named os.Args and syscall.envs will be missing type
information.

I believe that this CL eliminates the final source of conservative GC scanning
in non-SWIG Go programs, and therefore...

Fixes #909.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/149770043
2014-09-24 16:55:26 -04:00
Brad Fitzpatrick
db492b8df4 os: add a comment inside RemoveAll
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/149950043
2014-09-23 14:55:19 -07:00
Brad Fitzpatrick
82ddcc05f4 os: fix another case where RemoveAll should return nil
This hopefully fixes issue 8793.

Fixes #8793

LGTM=iant
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/150860046
2014-09-23 14:26:20 -07:00
David du Colombier
2debfeb936 os: handle 'has been removed' error as IsNotExist on Plan 9
It fixes the TestRemoveAllRace test introduced
in CL 145860043.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/147820044
2014-09-18 21:16:01 -04:00
Russ Cox
84f9c42bbb os: skip TestRemoveAllRace on Windows
It's just fundamentally incompatible with
Windows' pickiness about removing things
that are in use.

TBR=brainman
CC=golang-codereviews
https://golang.org/cl/142270043
2014-09-18 20:13:07 -04:00
Russ Cox
98a5f52ef0 os: avoid error result when dir is removed out from under RemoveAll
Fixes #7776.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews, r
https://golang.org/cl/145860043
2014-09-18 14:48:47 -04:00
Mikio Hara
484cc67151 net: separate NaCl dependent placeholders from BSD's
To clarify the dependency of NaCl platform.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/143830044
2014-09-18 19:17:55 +09:00
Russ Cox
c1e332020d os/signal: increase timeout from 10ms to 100ms
Might make test less flaky.
Fixes #8682.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/143160043
2014-09-16 15:26:00 -04:00
Russ Cox
c007ce824d build: move package sources from src/pkg to src
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.
2014-09-08 00:08:51 -04:00